
(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 13 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 -5e-272) (not (<= t_0 0.0)))
t_0
(- (/ (* z (+ x z)) (- y)) z))))
double code(double x, double y, double z) {
double t_0 = (x + y) / (1.0 - (y / z));
double tmp;
if ((t_0 <= -5e-272) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = ((z * (x + z)) / -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 = (x + y) / (1.0d0 - (y / z))
if ((t_0 <= (-5d-272)) .or. (.not. (t_0 <= 0.0d0))) then
tmp = t_0
else
tmp = ((z * (x + z)) / -y) - z
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 <= -5e-272) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = ((z * (x + z)) / -y) - z;
}
return tmp;
}
def code(x, y, z): t_0 = (x + y) / (1.0 - (y / z)) tmp = 0 if (t_0 <= -5e-272) or not (t_0 <= 0.0): tmp = t_0 else: tmp = ((z * (x + z)) / -y) - z 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 <= -5e-272) || !(t_0 <= 0.0)) tmp = t_0; else tmp = Float64(Float64(Float64(z * Float64(x + z)) / Float64(-y)) - z); 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 <= -5e-272) || ~((t_0 <= 0.0))) tmp = t_0; else tmp = ((z * (x + z)) / -y) - z; 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, -5e-272], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], t$95$0, N[(N[(N[(z * N[(x + z), $MachinePrecision]), $MachinePrecision] / (-y)), $MachinePrecision] - z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-272} \lor \neg \left(t\_0 \leq 0\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(x + z\right)}{-y} - z\\
\end{array}
\end{array}
if (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < -4.99999999999999982e-272 or -0.0 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) Initial program 99.8%
if -4.99999999999999982e-272 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < -0.0Initial program 13.3%
Taylor expanded in y around inf 100.0%
sub-neg100.0%
mul-1-neg100.0%
unsub-neg100.0%
associate-+l-100.0%
distribute-frac-neg100.0%
mul-1-neg100.0%
div-sub100.0%
unsub-neg100.0%
mul-1-neg100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (let* ((t_0 (/ (+ x y) (- 1.0 (/ y z))))) (if (or (<= t_0 -5e-272) (not (<= t_0 0.0))) t_0 (* z (- -1.0 (/ x y))))))
double code(double x, double y, double z) {
double t_0 = (x + y) / (1.0 - (y / z));
double tmp;
if ((t_0 <= -5e-272) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = z * (-1.0 - (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 = (x + y) / (1.0d0 - (y / z))
if ((t_0 <= (-5d-272)) .or. (.not. (t_0 <= 0.0d0))) then
tmp = t_0
else
tmp = z * ((-1.0d0) - (x / y))
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 <= -5e-272) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = z * (-1.0 - (x / y));
}
return tmp;
}
def code(x, y, z): t_0 = (x + y) / (1.0 - (y / z)) tmp = 0 if (t_0 <= -5e-272) or not (t_0 <= 0.0): tmp = t_0 else: tmp = z * (-1.0 - (x / y)) 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 <= -5e-272) || !(t_0 <= 0.0)) tmp = t_0; else tmp = Float64(z * Float64(-1.0 - Float64(x / y))); 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 <= -5e-272) || ~((t_0 <= 0.0))) tmp = t_0; else tmp = z * (-1.0 - (x / y)); 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, -5e-272], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], t$95$0, N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-272} \lor \neg \left(t\_0 \leq 0\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < -4.99999999999999982e-272 or -0.0 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) Initial program 99.8%
if -4.99999999999999982e-272 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < -0.0Initial program 13.3%
clear-num13.3%
associate-/r/13.3%
Applied egg-rr13.3%
Taylor expanded in z around 0 95.1%
associate-*r/95.1%
+-commutative95.1%
neg-mul-195.1%
distribute-frac-neg95.1%
distribute-frac-neg295.1%
sub0-neg95.1%
associate-/l*99.9%
+-commutative99.9%
sub0-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
mul-1-neg99.9%
distribute-neg-frac299.9%
Simplified99.9%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ y z))) (t_1 (* z (- -1.0 (/ x y)))))
(if (<= y -4.2e+64)
t_1
(if (<= y -5.7e-18)
(/ y t_0)
(if (<= y -3.3e-93)
(* x (/ 1.0 t_0))
(if (<= y -1.08e-147) (+ x y) (if (<= y 120000.0) (/ x t_0) t_1)))))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = z * (-1.0 - (x / y));
double tmp;
if (y <= -4.2e+64) {
tmp = t_1;
} else if (y <= -5.7e-18) {
tmp = y / t_0;
} else if (y <= -3.3e-93) {
tmp = x * (1.0 / t_0);
} else if (y <= -1.08e-147) {
tmp = x + y;
} else if (y <= 120000.0) {
tmp = x / t_0;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - (y / z)
t_1 = z * ((-1.0d0) - (x / y))
if (y <= (-4.2d+64)) then
tmp = t_1
else if (y <= (-5.7d-18)) then
tmp = y / t_0
else if (y <= (-3.3d-93)) then
tmp = x * (1.0d0 / t_0)
else if (y <= (-1.08d-147)) then
tmp = x + y
else if (y <= 120000.0d0) then
tmp = x / t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = z * (-1.0 - (x / y));
double tmp;
if (y <= -4.2e+64) {
tmp = t_1;
} else if (y <= -5.7e-18) {
tmp = y / t_0;
} else if (y <= -3.3e-93) {
tmp = x * (1.0 / t_0);
} else if (y <= -1.08e-147) {
tmp = x + y;
} else if (y <= 120000.0) {
tmp = x / t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) t_1 = z * (-1.0 - (x / y)) tmp = 0 if y <= -4.2e+64: tmp = t_1 elif y <= -5.7e-18: tmp = y / t_0 elif y <= -3.3e-93: tmp = x * (1.0 / t_0) elif y <= -1.08e-147: tmp = x + y elif y <= 120000.0: tmp = x / t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) t_1 = Float64(z * Float64(-1.0 - Float64(x / y))) tmp = 0.0 if (y <= -4.2e+64) tmp = t_1; elseif (y <= -5.7e-18) tmp = Float64(y / t_0); elseif (y <= -3.3e-93) tmp = Float64(x * Float64(1.0 / t_0)); elseif (y <= -1.08e-147) tmp = Float64(x + y); elseif (y <= 120000.0) tmp = Float64(x / t_0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); t_1 = z * (-1.0 - (x / y)); tmp = 0.0; if (y <= -4.2e+64) tmp = t_1; elseif (y <= -5.7e-18) tmp = y / t_0; elseif (y <= -3.3e-93) tmp = x * (1.0 / t_0); elseif (y <= -1.08e-147) tmp = x + y; elseif (y <= 120000.0) tmp = x / t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.2e+64], t$95$1, If[LessEqual[y, -5.7e-18], N[(y / t$95$0), $MachinePrecision], If[LessEqual[y, -3.3e-93], N[(x * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.08e-147], N[(x + y), $MachinePrecision], If[LessEqual[y, 120000.0], N[(x / t$95$0), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
t_1 := z \cdot \left(-1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -4.2 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -5.7 \cdot 10^{-18}:\\
\;\;\;\;\frac{y}{t\_0}\\
\mathbf{elif}\;y \leq -3.3 \cdot 10^{-93}:\\
\;\;\;\;x \cdot \frac{1}{t\_0}\\
\mathbf{elif}\;y \leq -1.08 \cdot 10^{-147}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 120000:\\
\;\;\;\;\frac{x}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.2000000000000001e64 or 1.2e5 < y Initial program 72.6%
clear-num72.5%
associate-/r/72.5%
Applied egg-rr72.5%
Taylor expanded in z around 0 65.7%
associate-*r/65.7%
+-commutative65.7%
neg-mul-165.7%
distribute-frac-neg65.7%
distribute-frac-neg265.7%
sub0-neg65.7%
associate-/l*77.9%
+-commutative77.9%
sub0-neg77.9%
Simplified77.9%
Taylor expanded in x around 0 77.9%
sub-neg77.9%
metadata-eval77.9%
+-commutative77.9%
mul-1-neg77.9%
distribute-neg-frac277.9%
Simplified77.9%
if -4.2000000000000001e64 < y < -5.69999999999999971e-18Initial program 99.7%
Taylor expanded in x around 0 72.8%
if -5.69999999999999971e-18 < y < -3.3000000000000001e-93Initial program 99.6%
Taylor expanded in x around inf 69.5%
*-un-lft-identity69.5%
associate-*l/69.5%
Applied egg-rr69.5%
if -3.3000000000000001e-93 < y < -1.07999999999999995e-147Initial program 99.8%
Taylor expanded in z around inf 79.4%
+-commutative79.4%
Simplified79.4%
if -1.07999999999999995e-147 < y < 1.2e5Initial program 99.9%
Taylor expanded in x around inf 87.0%
Final simplification80.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ y z))) (t_1 (* z (- -1.0 (/ x y)))) (t_2 (/ x t_0)))
(if (<= y -7e+64)
t_1
(if (<= y -6.6e-15)
(/ y t_0)
(if (<= y -1.8e-92)
t_2
(if (<= y -1.14e-147) (+ x y) (if (<= y 750.0) t_2 t_1)))))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = z * (-1.0 - (x / y));
double t_2 = x / t_0;
double tmp;
if (y <= -7e+64) {
tmp = t_1;
} else if (y <= -6.6e-15) {
tmp = y / t_0;
} else if (y <= -1.8e-92) {
tmp = t_2;
} else if (y <= -1.14e-147) {
tmp = x + y;
} else if (y <= 750.0) {
tmp = t_2;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = 1.0d0 - (y / z)
t_1 = z * ((-1.0d0) - (x / y))
t_2 = x / t_0
if (y <= (-7d+64)) then
tmp = t_1
else if (y <= (-6.6d-15)) then
tmp = y / t_0
else if (y <= (-1.8d-92)) then
tmp = t_2
else if (y <= (-1.14d-147)) then
tmp = x + y
else if (y <= 750.0d0) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = z * (-1.0 - (x / y));
double t_2 = x / t_0;
double tmp;
if (y <= -7e+64) {
tmp = t_1;
} else if (y <= -6.6e-15) {
tmp = y / t_0;
} else if (y <= -1.8e-92) {
tmp = t_2;
} else if (y <= -1.14e-147) {
tmp = x + y;
} else if (y <= 750.0) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) t_1 = z * (-1.0 - (x / y)) t_2 = x / t_0 tmp = 0 if y <= -7e+64: tmp = t_1 elif y <= -6.6e-15: tmp = y / t_0 elif y <= -1.8e-92: tmp = t_2 elif y <= -1.14e-147: tmp = x + y elif y <= 750.0: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) t_1 = Float64(z * Float64(-1.0 - Float64(x / y))) t_2 = Float64(x / t_0) tmp = 0.0 if (y <= -7e+64) tmp = t_1; elseif (y <= -6.6e-15) tmp = Float64(y / t_0); elseif (y <= -1.8e-92) tmp = t_2; elseif (y <= -1.14e-147) tmp = Float64(x + y); elseif (y <= 750.0) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); t_1 = z * (-1.0 - (x / y)); t_2 = x / t_0; tmp = 0.0; if (y <= -7e+64) tmp = t_1; elseif (y <= -6.6e-15) tmp = y / t_0; elseif (y <= -1.8e-92) tmp = t_2; elseif (y <= -1.14e-147) tmp = x + y; elseif (y <= 750.0) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / t$95$0), $MachinePrecision]}, If[LessEqual[y, -7e+64], t$95$1, If[LessEqual[y, -6.6e-15], N[(y / t$95$0), $MachinePrecision], If[LessEqual[y, -1.8e-92], t$95$2, If[LessEqual[y, -1.14e-147], N[(x + y), $MachinePrecision], If[LessEqual[y, 750.0], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
t_1 := z \cdot \left(-1 - \frac{x}{y}\right)\\
t_2 := \frac{x}{t\_0}\\
\mathbf{if}\;y \leq -7 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -6.6 \cdot 10^{-15}:\\
\;\;\;\;\frac{y}{t\_0}\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{-92}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.14 \cdot 10^{-147}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 750:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.9999999999999997e64 or 750 < y Initial program 72.6%
clear-num72.5%
associate-/r/72.5%
Applied egg-rr72.5%
Taylor expanded in z around 0 65.7%
associate-*r/65.7%
+-commutative65.7%
neg-mul-165.7%
distribute-frac-neg65.7%
distribute-frac-neg265.7%
sub0-neg65.7%
associate-/l*77.9%
+-commutative77.9%
sub0-neg77.9%
Simplified77.9%
Taylor expanded in x around 0 77.9%
sub-neg77.9%
metadata-eval77.9%
+-commutative77.9%
mul-1-neg77.9%
distribute-neg-frac277.9%
Simplified77.9%
if -6.9999999999999997e64 < y < -6.6e-15Initial program 99.7%
Taylor expanded in x around 0 72.8%
if -6.6e-15 < y < -1.80000000000000008e-92 or -1.14e-147 < y < 750Initial program 99.9%
Taylor expanded in x around inf 85.2%
if -1.80000000000000008e-92 < y < -1.14e-147Initial program 99.8%
Taylor expanded in z around inf 79.4%
+-commutative79.4%
Simplified79.4%
Final simplification80.7%
(FPCore (x y z)
:precision binary64
(if (<= y -6.1e+50)
(- z)
(if (<= y -4.2e-148)
(+ x y)
(if (<= y -1.3e-177)
(* x (/ z (- y)))
(if (<= y 16500.0) (+ x y) (* y (/ z (- z y))))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -6.1e+50) {
tmp = -z;
} else if (y <= -4.2e-148) {
tmp = x + y;
} else if (y <= -1.3e-177) {
tmp = x * (z / -y);
} else if (y <= 16500.0) {
tmp = x + y;
} else {
tmp = y * (z / (z - 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 <= (-6.1d+50)) then
tmp = -z
else if (y <= (-4.2d-148)) then
tmp = x + y
else if (y <= (-1.3d-177)) then
tmp = x * (z / -y)
else if (y <= 16500.0d0) then
tmp = x + y
else
tmp = y * (z / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -6.1e+50) {
tmp = -z;
} else if (y <= -4.2e-148) {
tmp = x + y;
} else if (y <= -1.3e-177) {
tmp = x * (z / -y);
} else if (y <= 16500.0) {
tmp = x + y;
} else {
tmp = y * (z / (z - y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -6.1e+50: tmp = -z elif y <= -4.2e-148: tmp = x + y elif y <= -1.3e-177: tmp = x * (z / -y) elif y <= 16500.0: tmp = x + y else: tmp = y * (z / (z - y)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -6.1e+50) tmp = Float64(-z); elseif (y <= -4.2e-148) tmp = Float64(x + y); elseif (y <= -1.3e-177) tmp = Float64(x * Float64(z / Float64(-y))); elseif (y <= 16500.0) tmp = Float64(x + y); else tmp = Float64(y * Float64(z / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -6.1e+50) tmp = -z; elseif (y <= -4.2e-148) tmp = x + y; elseif (y <= -1.3e-177) tmp = x * (z / -y); elseif (y <= 16500.0) tmp = x + y; else tmp = y * (z / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -6.1e+50], (-z), If[LessEqual[y, -4.2e-148], N[(x + y), $MachinePrecision], If[LessEqual[y, -1.3e-177], N[(x * N[(z / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 16500.0], N[(x + y), $MachinePrecision], N[(y * N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.1 \cdot 10^{+50}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{-148}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq -1.3 \cdot 10^{-177}:\\
\;\;\;\;x \cdot \frac{z}{-y}\\
\mathbf{elif}\;y \leq 16500:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{z - y}\\
\end{array}
\end{array}
if y < -6.10000000000000026e50Initial program 65.7%
Taylor expanded in y around inf 70.6%
mul-1-neg70.6%
Simplified70.6%
if -6.10000000000000026e50 < y < -4.2e-148 or -1.3e-177 < y < 16500Initial program 99.9%
Taylor expanded in z around inf 76.6%
+-commutative76.6%
Simplified76.6%
if -4.2e-148 < y < -1.3e-177Initial program 99.8%
Taylor expanded in x around inf 99.8%
Taylor expanded in y around inf 80.1%
mul-1-neg80.1%
associate-/l*80.1%
distribute-lft-neg-in80.1%
Simplified80.1%
if 16500 < y Initial program 80.6%
clear-num80.4%
Applied egg-rr80.4%
Taylor expanded in x around 0 64.4%
Taylor expanded in y around inf 80.8%
frac-sub58.9%
associate-/r/58.9%
*-un-lft-identity58.9%
*-rgt-identity58.9%
Applied egg-rr58.9%
associate-*l/59.0%
*-lft-identity59.0%
associate-/l*66.7%
Simplified66.7%
Final simplification72.8%
(FPCore (x y z)
:precision binary64
(if (<= y -6.8e+89)
(* z (- -1.0 (/ x y)))
(if (or (<= y -5e-5) (not (<= y 4.8e+22)))
(/ 1.0 (+ (/ 1.0 y) (/ -1.0 z)))
(/ x (- 1.0 (/ y z))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -6.8e+89) {
tmp = z * (-1.0 - (x / y));
} else if ((y <= -5e-5) || !(y <= 4.8e+22)) {
tmp = 1.0 / ((1.0 / y) + (-1.0 / z));
} 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) :: tmp
if (y <= (-6.8d+89)) then
tmp = z * ((-1.0d0) - (x / y))
else if ((y <= (-5d-5)) .or. (.not. (y <= 4.8d+22))) then
tmp = 1.0d0 / ((1.0d0 / y) + ((-1.0d0) / z))
else
tmp = x / (1.0d0 - (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -6.8e+89) {
tmp = z * (-1.0 - (x / y));
} else if ((y <= -5e-5) || !(y <= 4.8e+22)) {
tmp = 1.0 / ((1.0 / y) + (-1.0 / z));
} else {
tmp = x / (1.0 - (y / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -6.8e+89: tmp = z * (-1.0 - (x / y)) elif (y <= -5e-5) or not (y <= 4.8e+22): tmp = 1.0 / ((1.0 / y) + (-1.0 / z)) else: tmp = x / (1.0 - (y / z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -6.8e+89) tmp = Float64(z * Float64(-1.0 - Float64(x / y))); elseif ((y <= -5e-5) || !(y <= 4.8e+22)) tmp = Float64(1.0 / Float64(Float64(1.0 / y) + Float64(-1.0 / z))); else tmp = Float64(x / Float64(1.0 - Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -6.8e+89) tmp = z * (-1.0 - (x / y)); elseif ((y <= -5e-5) || ~((y <= 4.8e+22))) tmp = 1.0 / ((1.0 / y) + (-1.0 / z)); else tmp = x / (1.0 - (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -6.8e+89], N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -5e-5], N[Not[LessEqual[y, 4.8e+22]], $MachinePrecision]], N[(1.0 / N[(N[(1.0 / y), $MachinePrecision] + N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{+89}:\\
\;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\
\mathbf{elif}\;y \leq -5 \cdot 10^{-5} \lor \neg \left(y \leq 4.8 \cdot 10^{+22}\right):\\
\;\;\;\;\frac{1}{\frac{1}{y} + \frac{-1}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 - \frac{y}{z}}\\
\end{array}
\end{array}
if y < -6.8000000000000004e89Initial program 64.0%
clear-num63.9%
associate-/r/64.0%
Applied egg-rr64.0%
Taylor expanded in z around 0 74.5%
associate-*r/74.5%
+-commutative74.5%
neg-mul-174.5%
distribute-frac-neg74.5%
distribute-frac-neg274.5%
sub0-neg74.5%
associate-/l*91.4%
+-commutative91.4%
sub0-neg91.4%
Simplified91.4%
Taylor expanded in x around 0 91.4%
sub-neg91.4%
metadata-eval91.4%
+-commutative91.4%
mul-1-neg91.4%
distribute-neg-frac291.4%
Simplified91.4%
if -6.8000000000000004e89 < y < -5.00000000000000024e-5 or 4.8e22 < y Initial program 82.4%
clear-num82.2%
Applied egg-rr82.2%
Taylor expanded in x around 0 66.0%
Taylor expanded in y around inf 81.2%
if -5.00000000000000024e-5 < y < 4.8e22Initial program 99.9%
Taylor expanded in x around inf 81.6%
Final simplification83.5%
(FPCore (x y z)
:precision binary64
(if (<= y -2.95e+51)
(- z)
(if (<= y -4.2e-148)
(+ x y)
(if (<= y -1.3e-177)
(* x (/ z (- y)))
(if (<= y 5.5e+69) (+ x y) (- z))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.95e+51) {
tmp = -z;
} else if (y <= -4.2e-148) {
tmp = x + y;
} else if (y <= -1.3e-177) {
tmp = x * (z / -y);
} else if (y <= 5.5e+69) {
tmp = 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 <= (-2.95d+51)) then
tmp = -z
else if (y <= (-4.2d-148)) then
tmp = x + y
else if (y <= (-1.3d-177)) then
tmp = x * (z / -y)
else if (y <= 5.5d+69) then
tmp = 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 <= -2.95e+51) {
tmp = -z;
} else if (y <= -4.2e-148) {
tmp = x + y;
} else if (y <= -1.3e-177) {
tmp = x * (z / -y);
} else if (y <= 5.5e+69) {
tmp = x + y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.95e+51: tmp = -z elif y <= -4.2e-148: tmp = x + y elif y <= -1.3e-177: tmp = x * (z / -y) elif y <= 5.5e+69: tmp = x + y else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.95e+51) tmp = Float64(-z); elseif (y <= -4.2e-148) tmp = Float64(x + y); elseif (y <= -1.3e-177) tmp = Float64(x * Float64(z / Float64(-y))); elseif (y <= 5.5e+69) tmp = Float64(x + y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.95e+51) tmp = -z; elseif (y <= -4.2e-148) tmp = x + y; elseif (y <= -1.3e-177) tmp = x * (z / -y); elseif (y <= 5.5e+69) tmp = x + y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.95e+51], (-z), If[LessEqual[y, -4.2e-148], N[(x + y), $MachinePrecision], If[LessEqual[y, -1.3e-177], N[(x * N[(z / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e+69], N[(x + y), $MachinePrecision], (-z)]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.95 \cdot 10^{+51}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{-148}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq -1.3 \cdot 10^{-177}:\\
\;\;\;\;x \cdot \frac{z}{-y}\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+69}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -2.94999999999999991e51 or 5.50000000000000002e69 < y Initial program 70.1%
Taylor expanded in y around inf 67.1%
mul-1-neg67.1%
Simplified67.1%
if -2.94999999999999991e51 < y < -4.2e-148 or -1.3e-177 < y < 5.50000000000000002e69Initial program 99.2%
Taylor expanded in z around inf 73.9%
+-commutative73.9%
Simplified73.9%
if -4.2e-148 < y < -1.3e-177Initial program 99.8%
Taylor expanded in x around inf 99.8%
Taylor expanded in y around inf 80.1%
mul-1-neg80.1%
associate-/l*80.1%
distribute-lft-neg-in80.1%
Simplified80.1%
Final simplification71.2%
(FPCore (x y z)
:precision binary64
(if (<= y -1.8e+67)
(- z)
(if (or (<= y -8.5e-6) (not (<= y 8.5e+22)))
(* y (/ z (- z y)))
(/ x (- 1.0 (/ y z))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.8e+67) {
tmp = -z;
} else if ((y <= -8.5e-6) || !(y <= 8.5e+22)) {
tmp = y * (z / (z - y));
} 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) :: tmp
if (y <= (-1.8d+67)) then
tmp = -z
else if ((y <= (-8.5d-6)) .or. (.not. (y <= 8.5d+22))) then
tmp = y * (z / (z - y))
else
tmp = x / (1.0d0 - (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.8e+67) {
tmp = -z;
} else if ((y <= -8.5e-6) || !(y <= 8.5e+22)) {
tmp = y * (z / (z - y));
} else {
tmp = x / (1.0 - (y / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.8e+67: tmp = -z elif (y <= -8.5e-6) or not (y <= 8.5e+22): tmp = y * (z / (z - y)) else: tmp = x / (1.0 - (y / z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.8e+67) tmp = Float64(-z); elseif ((y <= -8.5e-6) || !(y <= 8.5e+22)) tmp = Float64(y * Float64(z / Float64(z - y))); else tmp = Float64(x / Float64(1.0 - Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.8e+67) tmp = -z; elseif ((y <= -8.5e-6) || ~((y <= 8.5e+22))) tmp = y * (z / (z - y)); else tmp = x / (1.0 - (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.8e+67], (-z), If[Or[LessEqual[y, -8.5e-6], N[Not[LessEqual[y, 8.5e+22]], $MachinePrecision]], N[(y * N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+67}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -8.5 \cdot 10^{-6} \lor \neg \left(y \leq 8.5 \cdot 10^{+22}\right):\\
\;\;\;\;y \cdot \frac{z}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 - \frac{y}{z}}\\
\end{array}
\end{array}
if y < -1.7999999999999999e67Initial program 63.9%
Taylor expanded in y around inf 70.8%
mul-1-neg70.8%
Simplified70.8%
if -1.7999999999999999e67 < y < -8.4999999999999999e-6 or 8.49999999999999979e22 < y Initial program 83.6%
clear-num83.5%
Applied egg-rr83.5%
Taylor expanded in x around 0 67.5%
Taylor expanded in y around inf 81.3%
frac-sub62.8%
associate-/r/62.8%
*-un-lft-identity62.8%
*-rgt-identity62.8%
Applied egg-rr62.8%
associate-*l/62.9%
*-lft-identity62.9%
associate-/l*69.4%
Simplified69.4%
if -8.4999999999999999e-6 < y < 8.49999999999999979e22Initial program 99.9%
Taylor expanded in x around inf 81.6%
Final simplification75.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ y z))))
(if (<= y -1.8e+67)
(- z)
(if (<= y -0.0007)
(/ y t_0)
(if (<= y 7.4e+22) (/ x t_0) (* y (/ z (- z y))))))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double tmp;
if (y <= -1.8e+67) {
tmp = -z;
} else if (y <= -0.0007) {
tmp = y / t_0;
} else if (y <= 7.4e+22) {
tmp = x / t_0;
} else {
tmp = y * (z / (z - 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 = 1.0d0 - (y / z)
if (y <= (-1.8d+67)) then
tmp = -z
else if (y <= (-0.0007d0)) then
tmp = y / t_0
else if (y <= 7.4d+22) then
tmp = x / t_0
else
tmp = y * (z / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double tmp;
if (y <= -1.8e+67) {
tmp = -z;
} else if (y <= -0.0007) {
tmp = y / t_0;
} else if (y <= 7.4e+22) {
tmp = x / t_0;
} else {
tmp = y * (z / (z - y));
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) tmp = 0 if y <= -1.8e+67: tmp = -z elif y <= -0.0007: tmp = y / t_0 elif y <= 7.4e+22: tmp = x / t_0 else: tmp = y * (z / (z - y)) return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) tmp = 0.0 if (y <= -1.8e+67) tmp = Float64(-z); elseif (y <= -0.0007) tmp = Float64(y / t_0); elseif (y <= 7.4e+22) tmp = Float64(x / t_0); else tmp = Float64(y * Float64(z / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); tmp = 0.0; if (y <= -1.8e+67) tmp = -z; elseif (y <= -0.0007) tmp = y / t_0; elseif (y <= 7.4e+22) tmp = x / t_0; else tmp = y * (z / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.8e+67], (-z), If[LessEqual[y, -0.0007], N[(y / t$95$0), $MachinePrecision], If[LessEqual[y, 7.4e+22], N[(x / t$95$0), $MachinePrecision], N[(y * N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{+67}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -0.0007:\\
\;\;\;\;\frac{y}{t\_0}\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{+22}:\\
\;\;\;\;\frac{x}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{z - y}\\
\end{array}
\end{array}
if y < -1.7999999999999999e67Initial program 63.9%
Taylor expanded in y around inf 70.8%
mul-1-neg70.8%
Simplified70.8%
if -1.7999999999999999e67 < y < -6.99999999999999993e-4Initial program 99.7%
Taylor expanded in x around 0 79.2%
if -6.99999999999999993e-4 < y < 7.3999999999999996e22Initial program 99.9%
Taylor expanded in x around inf 81.6%
if 7.3999999999999996e22 < y Initial program 80.0%
clear-num79.8%
Applied egg-rr79.8%
Taylor expanded in x around 0 64.9%
Taylor expanded in y around inf 81.8%
frac-sub59.1%
associate-/r/59.1%
*-un-lft-identity59.1%
*-rgt-identity59.1%
Applied egg-rr59.1%
associate-*l/59.3%
*-lft-identity59.3%
associate-/l*67.2%
Simplified67.2%
(FPCore (x y z) :precision binary64 (if (<= y -1.75e+46) (- z) (if (<= y -6e-119) y (if (<= y 25000.0) x (- z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.75e+46) {
tmp = -z;
} else if (y <= -6e-119) {
tmp = y;
} else if (y <= 25000.0) {
tmp = 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.75d+46)) then
tmp = -z
else if (y <= (-6d-119)) then
tmp = y
else if (y <= 25000.0d0) then
tmp = 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.75e+46) {
tmp = -z;
} else if (y <= -6e-119) {
tmp = y;
} else if (y <= 25000.0) {
tmp = x;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.75e+46: tmp = -z elif y <= -6e-119: tmp = y elif y <= 25000.0: tmp = x else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.75e+46) tmp = Float64(-z); elseif (y <= -6e-119) tmp = y; elseif (y <= 25000.0) tmp = x; else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.75e+46) tmp = -z; elseif (y <= -6e-119) tmp = y; elseif (y <= 25000.0) tmp = x; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.75e+46], (-z), If[LessEqual[y, -6e-119], y, If[LessEqual[y, 25000.0], x, (-z)]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+46}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -6 \cdot 10^{-119}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 25000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -1.74999999999999992e46 or 25000 < y Initial program 73.5%
Taylor expanded in y around inf 63.4%
mul-1-neg63.4%
Simplified63.4%
if -1.74999999999999992e46 < y < -6.0000000000000004e-119Initial program 99.7%
Taylor expanded in x around 0 54.7%
Taylor expanded in y around 0 41.2%
if -6.0000000000000004e-119 < y < 25000Initial program 99.9%
Taylor expanded in y around 0 72.4%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.45e+52) (not (<= y 6e+69))) (- z) (+ x y)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.45e+52) || !(y <= 6e+69)) {
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 <= (-1.45d+52)) .or. (.not. (y <= 6d+69))) 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 <= -1.45e+52) || !(y <= 6e+69)) {
tmp = -z;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.45e+52) or not (y <= 6e+69): tmp = -z else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.45e+52) || !(y <= 6e+69)) tmp = Float64(-z); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.45e+52) || ~((y <= 6e+69))) tmp = -z; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.45e+52], N[Not[LessEqual[y, 6e+69]], $MachinePrecision]], (-z), N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{+52} \lor \neg \left(y \leq 6 \cdot 10^{+69}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -1.45e52 or 5.99999999999999967e69 < y Initial program 70.1%
Taylor expanded in y around inf 67.1%
mul-1-neg67.1%
Simplified67.1%
if -1.45e52 < y < 5.99999999999999967e69Initial program 99.3%
Taylor expanded in z around inf 71.3%
+-commutative71.3%
Simplified71.3%
Final simplification69.5%
(FPCore (x y z) :precision binary64 (if (<= y -1.95e-118) y (if (<= y 9e+43) x y)))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.95e-118) {
tmp = y;
} else if (y <= 9e+43) {
tmp = x;
} else {
tmp = 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 <= (-1.95d-118)) then
tmp = y
else if (y <= 9d+43) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.95e-118) {
tmp = y;
} else if (y <= 9e+43) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.95e-118: tmp = y elif y <= 9e+43: tmp = x else: tmp = y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.95e-118) tmp = y; elseif (y <= 9e+43) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.95e-118) tmp = y; elseif (y <= 9e+43) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.95e-118], y, If[LessEqual[y, 9e+43], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.95 \cdot 10^{-118}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+43}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -1.95e-118 or 9e43 < y Initial program 78.0%
Taylor expanded in x around 0 58.8%
Taylor expanded in y around 0 22.6%
if -1.95e-118 < y < 9e43Initial program 99.1%
Taylor expanded in y around 0 69.0%
(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 87.0%
Taylor expanded in y around 0 34.4%
(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 2024097
(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))))