(05-25-2021 10:05 PM)Gerson W. Barbosa Wrote:
Code:
001 { 42 21 15 } f LBL E
002 { 44 1 } STO 1
003 { 2 } 2
004 { 20 } ×
005 { 34 } x↔y
006 { 44 2 } STO 2
007 { 45 40 1 } RCL + 1
008 { 43 30 6 } g TEST x≠y
009 { 10 } ÷
010 { 1 } 1
011 { 30 } -
012 { 43 11 } g x²
013 { 3 } 3
014 { 2 } 2
015 { 34 } x↔y
016 { 10 } ÷
017 { 43 36 } g LSTx
018 { 48 } .
019 { 3 } 3
020 { 6 } 6
021 { 1 } 1
022 { 43 2 } g →H
023 { 20 } ×
024 { 30 } -
025 { 4 } 4
026 { 30 } -
027 { 15 } 1/x
028 { 1 } 1
029 { 48 } .
030 { 5 } 5
031 { 40 } +
032 { 42 4 1 } f Χ↔ 1
033 { 45 1 } RCL 1
034 { 14 } y^x
035 { 45 2 } RCL 2
036 { 43 36 } g LSTx
037 { 14 } y^x
038 { 40 } +
039 { 2 } 2
040 { 10 } ÷
041 { 45 1 } RCL 1
042 { 15 } 1/x
043 { 14 } y^x
044 { 2 } 2
045 { 20 } ×
046 { 43 26 } g π
047 { 20 } ×
048 { 43 32 } g RTN
# ------------------------------------------------------------------------------
# Perimeter of the Ellipse
# ------------------------------------------------------------------------------
# Usage:
#
# a ENTER b f E
# ------------------------------------------------------------------------------
# Formula:
#
# p ≈ 2π[(aˢ + bˢ)/2]¹ᐟˢ
#
# where
#
# s = 3/2 + 1/(32/h² - 217h²/360 - 4)
#
# and
#
# h = [(a - b)/(a + b)]
#
# See https://www.hpmuseum.org/forum/post-126478.html#pid126478
#
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Listing generated by
# HEWLETT·PACKARD 15C Simulator program
# Created with version 4.3.00
# ------------------------------------------------------------------------------
# © 2021 Torsten Manz
# http://hp-15c.homepage.t-online.de/download.htm
# ------------------------------------------------------------------------------
# --------
Please replace steps 3 through 15 with these:
Code:
003 { 34 } x↔y
004 { 44 2 } STO 2
005 { 30 } -
006 { 45 1 } RCL 1
007 { 45 40 2 } RCL + 2
008 { 10 } ÷
009 { 43 11 } g x²
010 { 3 } 3
011 { 2 } 2
012 { 34 } x↔y
013 { 43 20 } g x=0
014 { 42 0 } g x!
Now
0 ENTER 0 f E will return
“Error 0” (no problem, we all know the result is 0). On the other hand
0.5 ENTER 0.5 f E will return
3.141592654 comme il faut, instead of a division by zero error.