real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (cosh(x) * (y / x)) / 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 = (cosh(x) * (y / x)) / z
t_1 = (y / z) / x
if (t_0 <= (-2d+267)) then
tmp = t_1
else if (t_0 <= 1d-40) then
tmp = t_0
else
tmp = t_1 + (0.5d0 * (y / (z / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
return (Math.cosh(x) * (y / x)) / z;
}
(+.f64 (/.f64 (/.f64 y z) x) (*.f64 1/2 (/.f64 y (/.f64 z x)))): 0 points increase in error, 0 points decrease in error
(+.f64 (Rewrite<= associate-/r*_binary64 (/.f64 y (*.f64 z x))) (*.f64 1/2 (/.f64 y (/.f64 z x)))): 77 points increase in error, 60 points decrease in error
(+.f64 (/.f64 y (*.f64 z x)) (*.f64 1/2 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y x) z)))): 0 points increase in error, 0 points decrease in error
Recombined 3 regimes into one program.
Final simplification0.6
\[\leadsto \begin{array}{l}
\mathbf{if}\;\frac{\cosh x \cdot \frac{y}{x}}{z} \leq -2 \cdot 10^{+267}:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\mathbf{elif}\;\frac{\cosh x \cdot \frac{y}{x}}{z} \leq 10^{-40}:\\
\;\;\;\;\frac{\cosh x \cdot \frac{y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{x} + 0.5 \cdot \frac{y}{\frac{z}{x}}\\
\end{array}
\]