
(FPCore (x y z) :precision binary64 (/ (+ x y) (- 1.0 (/ y z))))
double code(double x, double y, double z) {
return (x + y) / (1.0 - (y / z));
}
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) / (1.0d0 - (y / z))
end function
public static double code(double x, double y, double z) {
return (x + y) / (1.0 - (y / z));
}
def code(x, y, z): return (x + y) / (1.0 - (y / z))
function code(x, y, z) return Float64(Float64(x + y) / Float64(1.0 - Float64(y / z))) end
function tmp = code(x, y, z) tmp = (x + y) / (1.0 - (y / z)); end
code[x_, y_, z_] := N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + y}{1 - \frac{y}{z}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (+ x y) (- 1.0 (/ y z))))
double code(double x, double y, double z) {
return (x + y) / (1.0 - (y / z));
}
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) / (1.0d0 - (y / z))
end function
public static double code(double x, double y, double z) {
return (x + y) / (1.0 - (y / z));
}
def code(x, y, z): return (x + y) / (1.0 - (y / z))
function code(x, y, z) return Float64(Float64(x + y) / Float64(1.0 - Float64(y / z))) end
function tmp = code(x, y, z) tmp = (x + y) / (1.0 - (y / z)); end
code[x_, y_, z_] := N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + y}{1 - \frac{y}{z}}
\end{array}
(FPCore (x y z) :precision binary64 (let* ((t_0 (/ (+ x y) (- 1.0 (/ y z))))) (if (or (<= t_0 -2e-281) (not (<= t_0 0.0))) t_0 (- (- z) (/ z (/ y x))))))
double code(double x, double y, double z) {
double t_0 = (x + y) / (1.0 - (y / z));
double tmp;
if ((t_0 <= -2e-281) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = -z - (z / (y / x));
}
return tmp;
}
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) :: tmp
t_0 = (x + y) / (1.0d0 - (y / z))
if ((t_0 <= (-2d-281)) .or. (.not. (t_0 <= 0.0d0))) then
tmp = t_0
else
tmp = -z - (z / (y / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x + y) / (1.0 - (y / z));
double tmp;
if ((t_0 <= -2e-281) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = -z - (z / (y / x));
}
return tmp;
}
def code(x, y, z): t_0 = (x + y) / (1.0 - (y / z)) tmp = 0 if (t_0 <= -2e-281) or not (t_0 <= 0.0): tmp = t_0 else: tmp = -z - (z / (y / x)) return tmp
function code(x, y, z) t_0 = Float64(Float64(x + y) / Float64(1.0 - Float64(y / z))) tmp = 0.0 if ((t_0 <= -2e-281) || !(t_0 <= 0.0)) tmp = t_0; else tmp = Float64(Float64(-z) - Float64(z / Float64(y / x))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x + y) / (1.0 - (y / z)); tmp = 0.0; if ((t_0 <= -2e-281) || ~((t_0 <= 0.0))) tmp = t_0; else tmp = -z - (z / (y / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -2e-281], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], t$95$0, N[((-z) - N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-281} \lor \neg \left(t\_0 \leq 0\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) - \frac{z}{\frac{y}{x}}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < -2e-281 or -0.0 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) Initial program 99.9%
if -2e-281 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < -0.0Initial program 8.3%
Taylor expanded in y around inf 8.3%
neg-mul-18.3%
distribute-neg-frac8.3%
Simplified8.3%
Taylor expanded in x around 0 99.9%
mul-1-neg99.9%
unsub-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
Simplified99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- -1.0 (/ x y)))))
(if (<= y -9.6e+205)
t_0
(if (<= y -3.1e+86)
(* y (/ z (- z y)))
(if (<= y -5.1e-11)
t_0
(if (<= y 1.5e-55) (/ x (- 1.0 (/ y z))) (- (- z) (/ z (/ y x)))))))))
double code(double x, double y, double z) {
double t_0 = z * (-1.0 - (x / y));
double tmp;
if (y <= -9.6e+205) {
tmp = t_0;
} else if (y <= -3.1e+86) {
tmp = y * (z / (z - y));
} else if (y <= -5.1e-11) {
tmp = t_0;
} else if (y <= 1.5e-55) {
tmp = x / (1.0 - (y / z));
} else {
tmp = -z - (z / (y / x));
}
return tmp;
}
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) :: tmp
t_0 = z * ((-1.0d0) - (x / y))
if (y <= (-9.6d+205)) then
tmp = t_0
else if (y <= (-3.1d+86)) then
tmp = y * (z / (z - y))
else if (y <= (-5.1d-11)) then
tmp = t_0
else if (y <= 1.5d-55) then
tmp = x / (1.0d0 - (y / z))
else
tmp = -z - (z / (y / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (-1.0 - (x / y));
double tmp;
if (y <= -9.6e+205) {
tmp = t_0;
} else if (y <= -3.1e+86) {
tmp = y * (z / (z - y));
} else if (y <= -5.1e-11) {
tmp = t_0;
} else if (y <= 1.5e-55) {
tmp = x / (1.0 - (y / z));
} else {
tmp = -z - (z / (y / x));
}
return tmp;
}
def code(x, y, z): t_0 = z * (-1.0 - (x / y)) tmp = 0 if y <= -9.6e+205: tmp = t_0 elif y <= -3.1e+86: tmp = y * (z / (z - y)) elif y <= -5.1e-11: tmp = t_0 elif y <= 1.5e-55: tmp = x / (1.0 - (y / z)) else: tmp = -z - (z / (y / x)) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(-1.0 - Float64(x / y))) tmp = 0.0 if (y <= -9.6e+205) tmp = t_0; elseif (y <= -3.1e+86) tmp = Float64(y * Float64(z / Float64(z - y))); elseif (y <= -5.1e-11) tmp = t_0; elseif (y <= 1.5e-55) tmp = Float64(x / Float64(1.0 - Float64(y / z))); else tmp = Float64(Float64(-z) - Float64(z / Float64(y / x))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (-1.0 - (x / y)); tmp = 0.0; if (y <= -9.6e+205) tmp = t_0; elseif (y <= -3.1e+86) tmp = y * (z / (z - y)); elseif (y <= -5.1e-11) tmp = t_0; elseif (y <= 1.5e-55) tmp = x / (1.0 - (y / z)); else tmp = -z - (z / (y / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9.6e+205], t$95$0, If[LessEqual[y, -3.1e+86], N[(y * N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.1e-11], t$95$0, If[LessEqual[y, 1.5e-55], N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-z) - N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(-1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -9.6 \cdot 10^{+205}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -3.1 \cdot 10^{+86}:\\
\;\;\;\;y \cdot \frac{z}{z - y}\\
\mathbf{elif}\;y \leq -5.1 \cdot 10^{-11}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-55}:\\
\;\;\;\;\frac{x}{1 - \frac{y}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) - \frac{z}{\frac{y}{x}}\\
\end{array}
\end{array}
if y < -9.59999999999999945e205 or -3.1000000000000002e86 < y < -5.09999999999999984e-11Initial program 69.0%
Taylor expanded in y around inf 60.3%
neg-mul-160.3%
distribute-neg-frac60.3%
Simplified60.3%
Taylor expanded in x around 0 87.8%
mul-1-neg87.8%
unsub-neg87.8%
neg-mul-187.8%
*-commutative87.8%
associate-/l*91.1%
Simplified91.1%
Taylor expanded in z around 0 91.2%
mul-1-neg91.2%
distribute-rgt-neg-in91.2%
distribute-neg-in91.2%
metadata-eval91.2%
sub-neg91.2%
Simplified91.2%
if -9.59999999999999945e205 < y < -3.1000000000000002e86Initial program 84.2%
Taylor expanded in z around 0 84.2%
Taylor expanded in x around 0 61.6%
associate-/l*76.6%
Simplified76.6%
if -5.09999999999999984e-11 < y < 1.50000000000000008e-55Initial program 99.9%
Taylor expanded in x around inf 83.2%
if 1.50000000000000008e-55 < y Initial program 81.7%
Taylor expanded in y around inf 56.4%
neg-mul-156.4%
distribute-neg-frac56.4%
Simplified56.4%
Taylor expanded in x around 0 73.1%
mul-1-neg73.1%
unsub-neg73.1%
neg-mul-173.1%
*-commutative73.1%
associate-/l*74.5%
Simplified74.5%
clear-num74.4%
un-div-inv74.5%
Applied egg-rr74.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- -1.0 (/ x y)))))
(if (<= y -9.5e+205)
t_0
(if (<= y -2.1e+86)
(* y (/ z (- z y)))
(if (<= y -1.04e-19)
t_0
(if (<= y 1.5e-55) (/ x (- 1.0 (/ y z))) (- (- z) (* z (/ x y)))))))))
double code(double x, double y, double z) {
double t_0 = z * (-1.0 - (x / y));
double tmp;
if (y <= -9.5e+205) {
tmp = t_0;
} else if (y <= -2.1e+86) {
tmp = y * (z / (z - y));
} else if (y <= -1.04e-19) {
tmp = t_0;
} else if (y <= 1.5e-55) {
tmp = x / (1.0 - (y / z));
} else {
tmp = -z - (z * (x / y));
}
return tmp;
}
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) :: tmp
t_0 = z * ((-1.0d0) - (x / y))
if (y <= (-9.5d+205)) then
tmp = t_0
else if (y <= (-2.1d+86)) then
tmp = y * (z / (z - y))
else if (y <= (-1.04d-19)) then
tmp = t_0
else if (y <= 1.5d-55) then
tmp = x / (1.0d0 - (y / z))
else
tmp = -z - (z * (x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (-1.0 - (x / y));
double tmp;
if (y <= -9.5e+205) {
tmp = t_0;
} else if (y <= -2.1e+86) {
tmp = y * (z / (z - y));
} else if (y <= -1.04e-19) {
tmp = t_0;
} else if (y <= 1.5e-55) {
tmp = x / (1.0 - (y / z));
} else {
tmp = -z - (z * (x / y));
}
return tmp;
}
def code(x, y, z): t_0 = z * (-1.0 - (x / y)) tmp = 0 if y <= -9.5e+205: tmp = t_0 elif y <= -2.1e+86: tmp = y * (z / (z - y)) elif y <= -1.04e-19: tmp = t_0 elif y <= 1.5e-55: tmp = x / (1.0 - (y / z)) else: tmp = -z - (z * (x / y)) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(-1.0 - Float64(x / y))) tmp = 0.0 if (y <= -9.5e+205) tmp = t_0; elseif (y <= -2.1e+86) tmp = Float64(y * Float64(z / Float64(z - y))); elseif (y <= -1.04e-19) tmp = t_0; elseif (y <= 1.5e-55) tmp = Float64(x / Float64(1.0 - Float64(y / z))); else tmp = Float64(Float64(-z) - Float64(z * Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (-1.0 - (x / y)); tmp = 0.0; if (y <= -9.5e+205) tmp = t_0; elseif (y <= -2.1e+86) tmp = y * (z / (z - y)); elseif (y <= -1.04e-19) tmp = t_0; elseif (y <= 1.5e-55) tmp = x / (1.0 - (y / z)); else tmp = -z - (z * (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9.5e+205], t$95$0, If[LessEqual[y, -2.1e+86], N[(y * N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.04e-19], t$95$0, If[LessEqual[y, 1.5e-55], N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-z) - N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(-1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -9.5 \cdot 10^{+205}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{+86}:\\
\;\;\;\;y \cdot \frac{z}{z - y}\\
\mathbf{elif}\;y \leq -1.04 \cdot 10^{-19}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-55}:\\
\;\;\;\;\frac{x}{1 - \frac{y}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) - z \cdot \frac{x}{y}\\
\end{array}
\end{array}
if y < -9.4999999999999997e205 or -2.0999999999999999e86 < y < -1.03999999999999998e-19Initial program 69.0%
Taylor expanded in y around inf 60.3%
neg-mul-160.3%
distribute-neg-frac60.3%
Simplified60.3%
Taylor expanded in x around 0 87.8%
mul-1-neg87.8%
unsub-neg87.8%
neg-mul-187.8%
*-commutative87.8%
associate-/l*91.1%
Simplified91.1%
Taylor expanded in z around 0 91.2%
mul-1-neg91.2%
distribute-rgt-neg-in91.2%
distribute-neg-in91.2%
metadata-eval91.2%
sub-neg91.2%
Simplified91.2%
if -9.4999999999999997e205 < y < -2.0999999999999999e86Initial program 84.2%
Taylor expanded in z around 0 84.2%
Taylor expanded in x around 0 61.6%
associate-/l*76.6%
Simplified76.6%
if -1.03999999999999998e-19 < y < 1.50000000000000008e-55Initial program 99.9%
Taylor expanded in x around inf 83.2%
if 1.50000000000000008e-55 < y Initial program 81.7%
Taylor expanded in y around inf 56.4%
neg-mul-156.4%
distribute-neg-frac56.4%
Simplified56.4%
Taylor expanded in x around 0 73.1%
mul-1-neg73.1%
unsub-neg73.1%
neg-mul-173.1%
*-commutative73.1%
associate-/l*74.5%
Simplified74.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- -1.0 (/ x y)))))
(if (<= y -9.5e+205)
t_0
(if (<= y -8.2e+85)
(* y (/ z (- z y)))
(if (or (<= y -1.1e-14) (not (<= y 1.5e-55)))
t_0
(/ x (- 1.0 (/ y z))))))))
double code(double x, double y, double z) {
double t_0 = z * (-1.0 - (x / y));
double tmp;
if (y <= -9.5e+205) {
tmp = t_0;
} else if (y <= -8.2e+85) {
tmp = y * (z / (z - y));
} else if ((y <= -1.1e-14) || !(y <= 1.5e-55)) {
tmp = t_0;
} else {
tmp = x / (1.0 - (y / z));
}
return tmp;
}
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) :: tmp
t_0 = z * ((-1.0d0) - (x / y))
if (y <= (-9.5d+205)) then
tmp = t_0
else if (y <= (-8.2d+85)) then
tmp = y * (z / (z - y))
else if ((y <= (-1.1d-14)) .or. (.not. (y <= 1.5d-55))) then
tmp = t_0
else
tmp = x / (1.0d0 - (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (-1.0 - (x / y));
double tmp;
if (y <= -9.5e+205) {
tmp = t_0;
} else if (y <= -8.2e+85) {
tmp = y * (z / (z - y));
} else if ((y <= -1.1e-14) || !(y <= 1.5e-55)) {
tmp = t_0;
} else {
tmp = x / (1.0 - (y / z));
}
return tmp;
}
def code(x, y, z): t_0 = z * (-1.0 - (x / y)) tmp = 0 if y <= -9.5e+205: tmp = t_0 elif y <= -8.2e+85: tmp = y * (z / (z - y)) elif (y <= -1.1e-14) or not (y <= 1.5e-55): tmp = t_0 else: tmp = x / (1.0 - (y / z)) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(-1.0 - Float64(x / y))) tmp = 0.0 if (y <= -9.5e+205) tmp = t_0; elseif (y <= -8.2e+85) tmp = Float64(y * Float64(z / Float64(z - y))); elseif ((y <= -1.1e-14) || !(y <= 1.5e-55)) tmp = t_0; else tmp = Float64(x / Float64(1.0 - Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (-1.0 - (x / y)); tmp = 0.0; if (y <= -9.5e+205) tmp = t_0; elseif (y <= -8.2e+85) tmp = y * (z / (z - y)); elseif ((y <= -1.1e-14) || ~((y <= 1.5e-55))) tmp = t_0; else tmp = x / (1.0 - (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9.5e+205], t$95$0, If[LessEqual[y, -8.2e+85], N[(y * N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -1.1e-14], N[Not[LessEqual[y, 1.5e-55]], $MachinePrecision]], t$95$0, N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(-1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -9.5 \cdot 10^{+205}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -8.2 \cdot 10^{+85}:\\
\;\;\;\;y \cdot \frac{z}{z - y}\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{-14} \lor \neg \left(y \leq 1.5 \cdot 10^{-55}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 - \frac{y}{z}}\\
\end{array}
\end{array}
if y < -9.4999999999999997e205 or -8.19999999999999957e85 < y < -1.1e-14 or 1.50000000000000008e-55 < y Initial program 77.0%
Taylor expanded in y around inf 57.8%
neg-mul-157.8%
distribute-neg-frac57.8%
Simplified57.8%
Taylor expanded in x around 0 78.5%
mul-1-neg78.5%
unsub-neg78.5%
neg-mul-178.5%
*-commutative78.5%
associate-/l*80.6%
Simplified80.6%
Taylor expanded in z around 0 80.6%
mul-1-neg80.6%
distribute-rgt-neg-in80.6%
distribute-neg-in80.6%
metadata-eval80.6%
sub-neg80.6%
Simplified80.6%
if -9.4999999999999997e205 < y < -8.19999999999999957e85Initial program 84.2%
Taylor expanded in z around 0 84.2%
Taylor expanded in x around 0 61.6%
associate-/l*76.6%
Simplified76.6%
if -1.1e-14 < y < 1.50000000000000008e-55Initial program 99.9%
Taylor expanded in x around inf 83.2%
Final simplification81.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- -1.0 (/ x y)))))
(if (<= y -9.5e+205)
t_0
(if (<= y -2.1e+86)
(* y (/ z (- z y)))
(if (or (<= y -1.05e-37) (not (<= y 1.8e-51))) t_0 (+ x y))))))
double code(double x, double y, double z) {
double t_0 = z * (-1.0 - (x / y));
double tmp;
if (y <= -9.5e+205) {
tmp = t_0;
} else if (y <= -2.1e+86) {
tmp = y * (z / (z - y));
} else if ((y <= -1.05e-37) || !(y <= 1.8e-51)) {
tmp = t_0;
} else {
tmp = x + y;
}
return tmp;
}
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) :: tmp
t_0 = z * ((-1.0d0) - (x / y))
if (y <= (-9.5d+205)) then
tmp = t_0
else if (y <= (-2.1d+86)) then
tmp = y * (z / (z - y))
else if ((y <= (-1.05d-37)) .or. (.not. (y <= 1.8d-51))) then
tmp = t_0
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (-1.0 - (x / y));
double tmp;
if (y <= -9.5e+205) {
tmp = t_0;
} else if (y <= -2.1e+86) {
tmp = y * (z / (z - y));
} else if ((y <= -1.05e-37) || !(y <= 1.8e-51)) {
tmp = t_0;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): t_0 = z * (-1.0 - (x / y)) tmp = 0 if y <= -9.5e+205: tmp = t_0 elif y <= -2.1e+86: tmp = y * (z / (z - y)) elif (y <= -1.05e-37) or not (y <= 1.8e-51): tmp = t_0 else: tmp = x + y return tmp
function code(x, y, z) t_0 = Float64(z * Float64(-1.0 - Float64(x / y))) tmp = 0.0 if (y <= -9.5e+205) tmp = t_0; elseif (y <= -2.1e+86) tmp = Float64(y * Float64(z / Float64(z - y))); elseif ((y <= -1.05e-37) || !(y <= 1.8e-51)) tmp = t_0; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (-1.0 - (x / y)); tmp = 0.0; if (y <= -9.5e+205) tmp = t_0; elseif (y <= -2.1e+86) tmp = y * (z / (z - y)); elseif ((y <= -1.05e-37) || ~((y <= 1.8e-51))) tmp = t_0; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9.5e+205], t$95$0, If[LessEqual[y, -2.1e+86], N[(y * N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -1.05e-37], N[Not[LessEqual[y, 1.8e-51]], $MachinePrecision]], t$95$0, N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(-1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -9.5 \cdot 10^{+205}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{+86}:\\
\;\;\;\;y \cdot \frac{z}{z - y}\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{-37} \lor \neg \left(y \leq 1.8 \cdot 10^{-51}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -9.4999999999999997e205 or -2.0999999999999999e86 < y < -1.05e-37 or 1.8e-51 < y Initial program 77.8%
Taylor expanded in y around inf 57.6%
neg-mul-157.6%
distribute-neg-frac57.6%
Simplified57.6%
Taylor expanded in x around 0 77.5%
mul-1-neg77.5%
unsub-neg77.5%
neg-mul-177.5%
*-commutative77.5%
associate-/l*79.6%
Simplified79.6%
Taylor expanded in z around 0 79.6%
mul-1-neg79.6%
distribute-rgt-neg-in79.6%
distribute-neg-in79.6%
metadata-eval79.6%
sub-neg79.6%
Simplified79.6%
if -9.4999999999999997e205 < y < -2.0999999999999999e86Initial program 84.2%
Taylor expanded in z around 0 84.2%
Taylor expanded in x around 0 61.6%
associate-/l*76.6%
Simplified76.6%
if -1.05e-37 < y < 1.8e-51Initial program 100.0%
Taylor expanded in z around inf 75.8%
+-commutative75.8%
Simplified75.8%
Final simplification77.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ z (- z y)))))
(if (<= y -1e+206)
(- z)
(if (<= y -7e-10)
t_0
(if (<= y 1.5e-55) (+ x y) (if (<= y 6.5e+158) t_0 (- z)))))))
double code(double x, double y, double z) {
double t_0 = y * (z / (z - y));
double tmp;
if (y <= -1e+206) {
tmp = -z;
} else if (y <= -7e-10) {
tmp = t_0;
} else if (y <= 1.5e-55) {
tmp = x + y;
} else if (y <= 6.5e+158) {
tmp = t_0;
} else {
tmp = -z;
}
return tmp;
}
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) :: tmp
t_0 = y * (z / (z - y))
if (y <= (-1d+206)) then
tmp = -z
else if (y <= (-7d-10)) then
tmp = t_0
else if (y <= 1.5d-55) then
tmp = x + y
else if (y <= 6.5d+158) then
tmp = t_0
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (z / (z - y));
double tmp;
if (y <= -1e+206) {
tmp = -z;
} else if (y <= -7e-10) {
tmp = t_0;
} else if (y <= 1.5e-55) {
tmp = x + y;
} else if (y <= 6.5e+158) {
tmp = t_0;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): t_0 = y * (z / (z - y)) tmp = 0 if y <= -1e+206: tmp = -z elif y <= -7e-10: tmp = t_0 elif y <= 1.5e-55: tmp = x + y elif y <= 6.5e+158: tmp = t_0 else: tmp = -z return tmp
function code(x, y, z) t_0 = Float64(y * Float64(z / Float64(z - y))) tmp = 0.0 if (y <= -1e+206) tmp = Float64(-z); elseif (y <= -7e-10) tmp = t_0; elseif (y <= 1.5e-55) tmp = Float64(x + y); elseif (y <= 6.5e+158) tmp = t_0; else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (z / (z - y)); tmp = 0.0; if (y <= -1e+206) tmp = -z; elseif (y <= -7e-10) tmp = t_0; elseif (y <= 1.5e-55) tmp = x + y; elseif (y <= 6.5e+158) tmp = t_0; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e+206], (-z), If[LessEqual[y, -7e-10], t$95$0, If[LessEqual[y, 1.5e-55], N[(x + y), $MachinePrecision], If[LessEqual[y, 6.5e+158], t$95$0, (-z)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{z}{z - y}\\
\mathbf{if}\;y \leq -1 \cdot 10^{+206}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -7 \cdot 10^{-10}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-55}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+158}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -1e206 or 6.5000000000000001e158 < y Initial program 59.2%
Taylor expanded in y around inf 88.1%
mul-1-neg88.1%
Simplified88.1%
if -1e206 < y < -6.99999999999999961e-10 or 1.50000000000000008e-55 < y < 6.5000000000000001e158Initial program 89.1%
Taylor expanded in z around 0 89.2%
Taylor expanded in x around 0 52.7%
associate-/l*59.1%
Simplified59.1%
if -6.99999999999999961e-10 < y < 1.50000000000000008e-55Initial program 99.9%
Taylor expanded in z around inf 73.9%
+-commutative73.9%
Simplified73.9%
Final simplification71.5%
(FPCore (x y z) :precision binary64 (if (<= y -1.9e+118) (- z) (if (<= y 1.8e-51) (+ x y) (if (<= y 2e+72) (* (/ z y) (- x)) (- z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.9e+118) {
tmp = -z;
} else if (y <= 1.8e-51) {
tmp = x + y;
} else if (y <= 2e+72) {
tmp = (z / y) * -x;
} else {
tmp = -z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-1.9d+118)) then
tmp = -z
else if (y <= 1.8d-51) then
tmp = x + y
else if (y <= 2d+72) then
tmp = (z / y) * -x
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.9e+118) {
tmp = -z;
} else if (y <= 1.8e-51) {
tmp = x + y;
} else if (y <= 2e+72) {
tmp = (z / y) * -x;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.9e+118: tmp = -z elif y <= 1.8e-51: tmp = x + y elif y <= 2e+72: tmp = (z / y) * -x else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.9e+118) tmp = Float64(-z); elseif (y <= 1.8e-51) tmp = Float64(x + y); elseif (y <= 2e+72) tmp = Float64(Float64(z / y) * Float64(-x)); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.9e+118) tmp = -z; elseif (y <= 1.8e-51) tmp = x + y; elseif (y <= 2e+72) tmp = (z / y) * -x; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.9e+118], (-z), If[LessEqual[y, 1.8e-51], N[(x + y), $MachinePrecision], If[LessEqual[y, 2e+72], N[(N[(z / y), $MachinePrecision] * (-x)), $MachinePrecision], (-z)]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+118}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-51}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+72}:\\
\;\;\;\;\frac{z}{y} \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -1.90000000000000008e118 or 1.99999999999999989e72 < y Initial program 70.6%
Taylor expanded in y around inf 69.6%
mul-1-neg69.6%
Simplified69.6%
if -1.90000000000000008e118 < y < 1.8e-51Initial program 99.2%
Taylor expanded in z around inf 69.7%
+-commutative69.7%
Simplified69.7%
if 1.8e-51 < y < 1.99999999999999989e72Initial program 95.8%
Taylor expanded in y around inf 69.7%
neg-mul-169.7%
distribute-neg-frac69.7%
Simplified69.7%
Taylor expanded in x around inf 53.0%
*-commutative53.0%
associate-*l/53.1%
associate-*l*53.1%
*-commutative53.1%
associate-*l*53.1%
neg-mul-153.1%
Simplified53.1%
Final simplification68.2%
(FPCore (x y z) :precision binary64 (if (<= y -1.35e+118) (- z) (if (<= y 3.05e-50) (+ x y) (if (<= y 2.8e+70) (* (- z) (/ x y)) (- z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.35e+118) {
tmp = -z;
} else if (y <= 3.05e-50) {
tmp = x + y;
} else if (y <= 2.8e+70) {
tmp = -z * (x / y);
} else {
tmp = -z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-1.35d+118)) then
tmp = -z
else if (y <= 3.05d-50) then
tmp = x + y
else if (y <= 2.8d+70) then
tmp = -z * (x / y)
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.35e+118) {
tmp = -z;
} else if (y <= 3.05e-50) {
tmp = x + y;
} else if (y <= 2.8e+70) {
tmp = -z * (x / y);
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.35e+118: tmp = -z elif y <= 3.05e-50: tmp = x + y elif y <= 2.8e+70: tmp = -z * (x / y) else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.35e+118) tmp = Float64(-z); elseif (y <= 3.05e-50) tmp = Float64(x + y); elseif (y <= 2.8e+70) tmp = Float64(Float64(-z) * Float64(x / y)); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.35e+118) tmp = -z; elseif (y <= 3.05e-50) tmp = x + y; elseif (y <= 2.8e+70) tmp = -z * (x / y); else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.35e+118], (-z), If[LessEqual[y, 3.05e-50], N[(x + y), $MachinePrecision], If[LessEqual[y, 2.8e+70], N[((-z) * N[(x / y), $MachinePrecision]), $MachinePrecision], (-z)]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+118}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 3.05 \cdot 10^{-50}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+70}:\\
\;\;\;\;\left(-z\right) \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -1.35e118 or 2.7999999999999999e70 < y Initial program 70.6%
Taylor expanded in y around inf 69.6%
mul-1-neg69.6%
Simplified69.6%
if -1.35e118 < y < 3.0499999999999998e-50Initial program 99.2%
Taylor expanded in z around inf 69.7%
+-commutative69.7%
Simplified69.7%
if 3.0499999999999998e-50 < y < 2.7999999999999999e70Initial program 95.8%
Taylor expanded in x around inf 52.6%
Taylor expanded in y around inf 53.0%
mul-1-neg53.0%
associate-*r/53.1%
*-commutative53.1%
associate-*l/53.0%
distribute-frac-neg253.0%
associate-/l*52.9%
Simplified52.9%
Final simplification68.2%
(FPCore (x y z) :precision binary64 (if (<= y -3.7e-5) (- z) (if (<= y 1.3e-91) x (if (<= y 6e+30) y (- z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -3.7e-5) {
tmp = -z;
} else if (y <= 1.3e-91) {
tmp = x;
} else if (y <= 6e+30) {
tmp = y;
} else {
tmp = -z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-3.7d-5)) then
tmp = -z
else if (y <= 1.3d-91) then
tmp = x
else if (y <= 6d+30) then
tmp = y
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -3.7e-5) {
tmp = -z;
} else if (y <= 1.3e-91) {
tmp = x;
} else if (y <= 6e+30) {
tmp = y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -3.7e-5: tmp = -z elif y <= 1.3e-91: tmp = x elif y <= 6e+30: tmp = y else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -3.7e-5) tmp = Float64(-z); elseif (y <= 1.3e-91) tmp = x; elseif (y <= 6e+30) tmp = y; else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -3.7e-5) tmp = -z; elseif (y <= 1.3e-91) tmp = x; elseif (y <= 6e+30) tmp = y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -3.7e-5], (-z), If[LessEqual[y, 1.3e-91], x, If[LessEqual[y, 6e+30], y, (-z)]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.7 \cdot 10^{-5}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-91}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+30}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -3.69999999999999981e-5 or 5.99999999999999956e30 < y Initial program 75.0%
Taylor expanded in y around inf 61.8%
mul-1-neg61.8%
Simplified61.8%
if -3.69999999999999981e-5 < y < 1.30000000000000007e-91Initial program 99.9%
Taylor expanded in y around 0 62.0%
if 1.30000000000000007e-91 < y < 5.99999999999999956e30Initial program 99.6%
Taylor expanded in x around 0 52.0%
Taylor expanded in y around 0 39.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -4.6e+117) (not (<= y 4.3e+105))) (- z) (+ x y)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4.6e+117) || !(y <= 4.3e+105)) {
tmp = -z;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-4.6d+117)) .or. (.not. (y <= 4.3d+105))) then
tmp = -z
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -4.6e+117) || !(y <= 4.3e+105)) {
tmp = -z;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4.6e+117) or not (y <= 4.3e+105): tmp = -z else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4.6e+117) || !(y <= 4.3e+105)) tmp = Float64(-z); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -4.6e+117) || ~((y <= 4.3e+105))) tmp = -z; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4.6e+117], N[Not[LessEqual[y, 4.3e+105]], $MachinePrecision]], (-z), N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+117} \lor \neg \left(y \leq 4.3 \cdot 10^{+105}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -4.59999999999999976e117 or 4.3000000000000002e105 < y Initial program 67.9%
Taylor expanded in y around inf 73.6%
mul-1-neg73.6%
Simplified73.6%
if -4.59999999999999976e117 < y < 4.3000000000000002e105Initial program 98.3%
Taylor expanded in z around inf 62.9%
+-commutative62.9%
Simplified62.9%
Final simplification66.3%
(FPCore (x y z) :precision binary64 (if (<= x -3.4e-70) x (if (<= x 6.8e-224) y x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.4e-70) {
tmp = x;
} else if (x <= 6.8e-224) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-3.4d-70)) then
tmp = x
else if (x <= 6.8d-224) then
tmp = y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.4e-70) {
tmp = x;
} else if (x <= 6.8e-224) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.4e-70: tmp = x elif x <= 6.8e-224: tmp = y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.4e-70) tmp = x; elseif (x <= 6.8e-224) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.4e-70) tmp = x; elseif (x <= 6.8e-224) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.4e-70], x, If[LessEqual[x, 6.8e-224], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-70}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-224}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.39999999999999995e-70 or 6.79999999999999984e-224 < x Initial program 88.0%
Taylor expanded in y around 0 40.4%
if -3.39999999999999995e-70 < x < 6.79999999999999984e-224Initial program 90.0%
Taylor expanded in x around 0 85.0%
Taylor expanded in y around 0 46.2%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 88.4%
Taylor expanded in y around 0 33.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ (+ y x) (- y)) z)))
(if (< y -3.7429310762689856e+171)
t_0
(if (< y 3.5534662456086734e+168) (/ (+ x y) (- 1.0 (/ y z))) t_0))))
double code(double x, double y, double z) {
double t_0 = ((y + x) / -y) * z;
double tmp;
if (y < -3.7429310762689856e+171) {
tmp = t_0;
} else if (y < 3.5534662456086734e+168) {
tmp = (x + y) / (1.0 - (y / z));
} else {
tmp = t_0;
}
return tmp;
}
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) :: tmp
t_0 = ((y + x) / -y) * z
if (y < (-3.7429310762689856d+171)) then
tmp = t_0
else if (y < 3.5534662456086734d+168) then
tmp = (x + y) / (1.0d0 - (y / z))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((y + x) / -y) * z;
double tmp;
if (y < -3.7429310762689856e+171) {
tmp = t_0;
} else if (y < 3.5534662456086734e+168) {
tmp = (x + y) / (1.0 - (y / z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((y + x) / -y) * z tmp = 0 if y < -3.7429310762689856e+171: tmp = t_0 elif y < 3.5534662456086734e+168: tmp = (x + y) / (1.0 - (y / z)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(y + x) / Float64(-y)) * z) tmp = 0.0 if (y < -3.7429310762689856e+171) tmp = t_0; elseif (y < 3.5534662456086734e+168) tmp = Float64(Float64(x + y) / Float64(1.0 - Float64(y / z))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((y + x) / -y) * z; tmp = 0.0; if (y < -3.7429310762689856e+171) tmp = t_0; elseif (y < 3.5534662456086734e+168) tmp = (x + y) / (1.0 - (y / z)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y + x), $MachinePrecision] / (-y)), $MachinePrecision] * z), $MachinePrecision]}, If[Less[y, -3.7429310762689856e+171], t$95$0, If[Less[y, 3.5534662456086734e+168], N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y + x}{-y} \cdot z\\
\mathbf{if}\;y < -3.7429310762689856 \cdot 10^{+171}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y < 3.5534662456086734 \cdot 10^{+168}:\\
\;\;\;\;\frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
herbie shell --seed 2024107
(FPCore (x y z)
:name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, A"
:precision binary64
:alt
(if (< y -3.7429310762689856e+171) (* (/ (+ y x) (- y)) z) (if (< y 3.5534662456086734e+168) (/ (+ x y) (- 1.0 (/ y z))) (* (/ (+ y x) (- y)) z)))
(/ (+ x y) (- 1.0 (/ y z))))