real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * (y + z)) / z
end function
↓
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x * (y + z)) / z
t_1 = x + (x * (y / z))
if (t_0 <= (-5d+300)) then
tmp = t_1
else if (t_0 <= (-1000000.0d0)) then
tmp = t_0
else if (t_0 <= 2d+33) then
tmp = x * ((y / z) + 1.0d0)
else if (t_0 <= 5d+230) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
return (x * (y + z)) / z;
}
\[\leadsto \color{blue}{\frac{y}{z} \cdot x + x}
\]
if -5.00000000000000026e300 < (/.f64 (*.f64 x (+.f64 y z)) z) < -1e6 or 1.9999999999999999e33 < (/.f64 (*.f64 x (+.f64 y z)) z) < 5.0000000000000003e230
Initial program 0.2
\[\frac{x \cdot \left(y + z\right)}{z}
\]
if -1e6 < (/.f64 (*.f64 x (+.f64 y z)) z) < 1.9999999999999999e33
herbie shell --seed 2022316
(FPCore (x y z)
:name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(/ x (/ z (+ y z)))
(/ (* x (+ y z)) z))