
(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 (- 1.0 (/ y z))) (t_1 (/ (+ x y) t_0)))
(if (<= t_1 -2e-256)
t_1
(if (<= t_1 0.0) (* z (- -1.0 (/ x y))) (* (/ 1.0 t_0) (+ x y))))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = (x + y) / t_0;
double tmp;
if (t_1 <= -2e-256) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = z * (-1.0 - (x / y));
} else {
tmp = (1.0 / t_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) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - (y / z)
t_1 = (x + y) / t_0
if (t_1 <= (-2d-256)) then
tmp = t_1
else if (t_1 <= 0.0d0) then
tmp = z * ((-1.0d0) - (x / y))
else
tmp = (1.0d0 / t_0) * (x + 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 t_1 = (x + y) / t_0;
double tmp;
if (t_1 <= -2e-256) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = z * (-1.0 - (x / y));
} else {
tmp = (1.0 / t_0) * (x + y);
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) t_1 = (x + y) / t_0 tmp = 0 if t_1 <= -2e-256: tmp = t_1 elif t_1 <= 0.0: tmp = z * (-1.0 - (x / y)) else: tmp = (1.0 / t_0) * (x + y) return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) t_1 = Float64(Float64(x + y) / t_0) tmp = 0.0 if (t_1 <= -2e-256) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(z * Float64(-1.0 - Float64(x / y))); else tmp = Float64(Float64(1.0 / t_0) * Float64(x + y)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); t_1 = (x + y) / t_0; tmp = 0.0; if (t_1 <= -2e-256) tmp = t_1; elseif (t_1 <= 0.0) tmp = z * (-1.0 - (x / y)); else tmp = (1.0 / t_0) * (x + y); 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[(N[(x + y), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-256], t$95$1, If[LessEqual[t$95$1, 0.0], N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / t$95$0), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
t_1 := \frac{x + y}{t_0}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{-256}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_0} \cdot \left(x + y\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < -1.99999999999999995e-256Initial program 99.8%
if -1.99999999999999995e-256 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < 0.0Initial program 6.0%
Taylor expanded in z around 0 99.8%
mul-1-neg99.8%
associate-/l*6.0%
+-commutative6.0%
associate-/r/100.0%
distribute-rgt-neg-in100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in x around 0 99.9%
distribute-lft-out99.9%
associate-/l*100.0%
neg-mul-1100.0%
+-commutative100.0%
+-commutative100.0%
associate-/l*99.9%
*-lft-identity99.9%
*-commutative99.9%
associate-/l*75.8%
associate-/r/99.9%
distribute-rgt-in100.0%
distribute-rgt-neg-in100.0%
distribute-neg-in100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
if 0.0 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) Initial program 99.8%
clear-num99.6%
associate-/r/99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (let* ((t_0 (/ (+ x y) (- 1.0 (/ y z))))) (if (or (<= t_0 -2e-256) (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 <= -2e-256) || !(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 <= (-2d-256)) .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 <= -2e-256) || !(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 <= -2e-256) 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 <= -2e-256) || !(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 <= -2e-256) || ~((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, -2e-256], 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 -2 \cdot 10^{-256} \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 1 (/.f64 y z))) < -1.99999999999999995e-256 or 0.0 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) Initial program 99.8%
if -1.99999999999999995e-256 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < 0.0Initial program 6.0%
Taylor expanded in z around 0 99.8%
mul-1-neg99.8%
associate-/l*6.0%
+-commutative6.0%
associate-/r/100.0%
distribute-rgt-neg-in100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in x around 0 99.9%
distribute-lft-out99.9%
associate-/l*100.0%
neg-mul-1100.0%
+-commutative100.0%
+-commutative100.0%
associate-/l*99.9%
*-lft-identity99.9%
*-commutative99.9%
associate-/l*75.8%
associate-/r/99.9%
distribute-rgt-in100.0%
distribute-rgt-neg-in100.0%
distribute-neg-in100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ x (- 1.0 (/ y z)))) (t_1 (/ 1.0 (+ (/ 1.0 y) (/ -1.0 z)))))
(if (<= y -1.25e+61)
t_1
(if (<= y -1.65e-92)
t_0
(if (<= y -3.4e-206)
(* (+ x y) (+ 1.0 (/ y z)))
(if (<= y 2.2e-36) t_0 t_1))))))
double code(double x, double y, double z) {
double t_0 = x / (1.0 - (y / z));
double t_1 = 1.0 / ((1.0 / y) + (-1.0 / z));
double tmp;
if (y <= -1.25e+61) {
tmp = t_1;
} else if (y <= -1.65e-92) {
tmp = t_0;
} else if (y <= -3.4e-206) {
tmp = (x + y) * (1.0 + (y / z));
} else if (y <= 2.2e-36) {
tmp = 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 = x / (1.0d0 - (y / z))
t_1 = 1.0d0 / ((1.0d0 / y) + ((-1.0d0) / z))
if (y <= (-1.25d+61)) then
tmp = t_1
else if (y <= (-1.65d-92)) then
tmp = t_0
else if (y <= (-3.4d-206)) then
tmp = (x + y) * (1.0d0 + (y / z))
else if (y <= 2.2d-36) then
tmp = 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 = x / (1.0 - (y / z));
double t_1 = 1.0 / ((1.0 / y) + (-1.0 / z));
double tmp;
if (y <= -1.25e+61) {
tmp = t_1;
} else if (y <= -1.65e-92) {
tmp = t_0;
} else if (y <= -3.4e-206) {
tmp = (x + y) * (1.0 + (y / z));
} else if (y <= 2.2e-36) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = x / (1.0 - (y / z)) t_1 = 1.0 / ((1.0 / y) + (-1.0 / z)) tmp = 0 if y <= -1.25e+61: tmp = t_1 elif y <= -1.65e-92: tmp = t_0 elif y <= -3.4e-206: tmp = (x + y) * (1.0 + (y / z)) elif y <= 2.2e-36: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(x / Float64(1.0 - Float64(y / z))) t_1 = Float64(1.0 / Float64(Float64(1.0 / y) + Float64(-1.0 / z))) tmp = 0.0 if (y <= -1.25e+61) tmp = t_1; elseif (y <= -1.65e-92) tmp = t_0; elseif (y <= -3.4e-206) tmp = Float64(Float64(x + y) * Float64(1.0 + Float64(y / z))); elseif (y <= 2.2e-36) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x / (1.0 - (y / z)); t_1 = 1.0 / ((1.0 / y) + (-1.0 / z)); tmp = 0.0; if (y <= -1.25e+61) tmp = t_1; elseif (y <= -1.65e-92) tmp = t_0; elseif (y <= -3.4e-206) tmp = (x + y) * (1.0 + (y / z)); elseif (y <= 2.2e-36) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[(N[(1.0 / y), $MachinePrecision] + N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.25e+61], t$95$1, If[LessEqual[y, -1.65e-92], t$95$0, If[LessEqual[y, -3.4e-206], N[(N[(x + y), $MachinePrecision] * N[(1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e-36], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{1 - \frac{y}{z}}\\
t_1 := \frac{1}{\frac{1}{y} + \frac{-1}{z}}\\
\mathbf{if}\;y \leq -1.25 \cdot 10^{+61}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.65 \cdot 10^{-92}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -3.4 \cdot 10^{-206}:\\
\;\;\;\;\left(x + y\right) \cdot \left(1 + \frac{y}{z}\right)\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-36}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.25000000000000004e61 or 2.1999999999999999e-36 < y Initial program 74.7%
clear-num74.4%
inv-pow74.4%
Applied egg-rr74.4%
Taylor expanded in z around 0 85.3%
+-commutative85.3%
mul-1-neg85.3%
unsub-neg85.3%
+-commutative85.3%
*-commutative85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in x around 0 82.3%
if -1.25000000000000004e61 < y < -1.64999999999999999e-92 or -3.39999999999999985e-206 < y < 2.1999999999999999e-36Initial program 99.0%
Taylor expanded in x around inf 83.3%
if -1.64999999999999999e-92 < y < -3.39999999999999985e-206Initial program 99.9%
Taylor expanded in z around inf 84.3%
associate-/l*84.2%
+-commutative84.2%
associate-/r/84.3%
+-commutative84.3%
*-lft-identity84.3%
distribute-rgt-in84.3%
+-commutative84.3%
+-commutative84.3%
Simplified84.3%
Final simplification82.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ y z))) (t_1 (* z (- -1.0 (/ x y)))))
(if (<= y -3.5e+63)
t_1
(if (<= y 3.2e-16)
(/ x t_0)
(if (or (<= y 9.7e+176) (not (<= y 7.2e+212))) t_1 (/ y t_0))))))
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 <= -3.5e+63) {
tmp = t_1;
} else if (y <= 3.2e-16) {
tmp = x / t_0;
} else if ((y <= 9.7e+176) || !(y <= 7.2e+212)) {
tmp = t_1;
} else {
tmp = y / 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) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - (y / z)
t_1 = z * ((-1.0d0) - (x / y))
if (y <= (-3.5d+63)) then
tmp = t_1
else if (y <= 3.2d-16) then
tmp = x / t_0
else if ((y <= 9.7d+176) .or. (.not. (y <= 7.2d+212))) then
tmp = t_1
else
tmp = y / t_0
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 <= -3.5e+63) {
tmp = t_1;
} else if (y <= 3.2e-16) {
tmp = x / t_0;
} else if ((y <= 9.7e+176) || !(y <= 7.2e+212)) {
tmp = t_1;
} else {
tmp = y / t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) t_1 = z * (-1.0 - (x / y)) tmp = 0 if y <= -3.5e+63: tmp = t_1 elif y <= 3.2e-16: tmp = x / t_0 elif (y <= 9.7e+176) or not (y <= 7.2e+212): tmp = t_1 else: tmp = y / t_0 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 <= -3.5e+63) tmp = t_1; elseif (y <= 3.2e-16) tmp = Float64(x / t_0); elseif ((y <= 9.7e+176) || !(y <= 7.2e+212)) tmp = t_1; else tmp = Float64(y / t_0); 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 <= -3.5e+63) tmp = t_1; elseif (y <= 3.2e-16) tmp = x / t_0; elseif ((y <= 9.7e+176) || ~((y <= 7.2e+212))) tmp = t_1; else tmp = y / t_0; 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, -3.5e+63], t$95$1, If[LessEqual[y, 3.2e-16], N[(x / t$95$0), $MachinePrecision], If[Or[LessEqual[y, 9.7e+176], N[Not[LessEqual[y, 7.2e+212]], $MachinePrecision]], t$95$1, N[(y / t$95$0), $MachinePrecision]]]]]]
\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 -3.5 \cdot 10^{+63}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-16}:\\
\;\;\;\;\frac{x}{t_0}\\
\mathbf{elif}\;y \leq 9.7 \cdot 10^{+176} \lor \neg \left(y \leq 7.2 \cdot 10^{+212}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t_0}\\
\end{array}
\end{array}
if y < -3.50000000000000029e63 or 3.20000000000000023e-16 < y < 9.70000000000000041e176 or 7.2e212 < y Initial program 71.8%
Taylor expanded in z around 0 65.2%
mul-1-neg65.2%
associate-/l*50.9%
+-commutative50.9%
associate-/r/78.9%
distribute-rgt-neg-in78.9%
+-commutative78.9%
Simplified78.9%
Taylor expanded in y around 0 79.0%
Taylor expanded in x around 0 76.0%
distribute-lft-out76.0%
associate-/l*79.0%
neg-mul-179.0%
+-commutative79.0%
+-commutative79.0%
associate-/l*76.0%
*-lft-identity76.0%
*-commutative76.0%
associate-/l*72.4%
associate-/r/79.0%
distribute-rgt-in79.0%
distribute-rgt-neg-in79.0%
distribute-neg-in79.0%
metadata-eval79.0%
unsub-neg79.0%
Simplified79.0%
if -3.50000000000000029e63 < y < 3.20000000000000023e-16Initial program 99.2%
Taylor expanded in x around inf 77.3%
if 9.70000000000000041e176 < y < 7.2e212Initial program 100.0%
Taylor expanded in x around 0 100.0%
Final simplification78.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ y z))) (t_1 (- (- z) (/ z (/ y x)))))
(if (<= y -1.25e+61)
t_1
(if (<= y 1.35e-16)
(/ x t_0)
(if (<= y 4.05e+173)
t_1
(if (<= y 5.8e+212) (/ y t_0) (* z (- -1.0 (/ x y)))))))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = -z - (z / (y / x));
double tmp;
if (y <= -1.25e+61) {
tmp = t_1;
} else if (y <= 1.35e-16) {
tmp = x / t_0;
} else if (y <= 4.05e+173) {
tmp = t_1;
} else if (y <= 5.8e+212) {
tmp = y / 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) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - (y / z)
t_1 = -z - (z / (y / x))
if (y <= (-1.25d+61)) then
tmp = t_1
else if (y <= 1.35d-16) then
tmp = x / t_0
else if (y <= 4.05d+173) then
tmp = t_1
else if (y <= 5.8d+212) then
tmp = y / 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 = 1.0 - (y / z);
double t_1 = -z - (z / (y / x));
double tmp;
if (y <= -1.25e+61) {
tmp = t_1;
} else if (y <= 1.35e-16) {
tmp = x / t_0;
} else if (y <= 4.05e+173) {
tmp = t_1;
} else if (y <= 5.8e+212) {
tmp = y / t_0;
} else {
tmp = z * (-1.0 - (x / y));
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) t_1 = -z - (z / (y / x)) tmp = 0 if y <= -1.25e+61: tmp = t_1 elif y <= 1.35e-16: tmp = x / t_0 elif y <= 4.05e+173: tmp = t_1 elif y <= 5.8e+212: tmp = y / t_0 else: tmp = z * (-1.0 - (x / y)) return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) t_1 = Float64(Float64(-z) - Float64(z / Float64(y / x))) tmp = 0.0 if (y <= -1.25e+61) tmp = t_1; elseif (y <= 1.35e-16) tmp = Float64(x / t_0); elseif (y <= 4.05e+173) tmp = t_1; elseif (y <= 5.8e+212) tmp = Float64(y / 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 = 1.0 - (y / z); t_1 = -z - (z / (y / x)); tmp = 0.0; if (y <= -1.25e+61) tmp = t_1; elseif (y <= 1.35e-16) tmp = x / t_0; elseif (y <= 4.05e+173) tmp = t_1; elseif (y <= 5.8e+212) tmp = y / t_0; else tmp = z * (-1.0 - (x / y)); 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[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.25e+61], t$95$1, If[LessEqual[y, 1.35e-16], N[(x / t$95$0), $MachinePrecision], If[LessEqual[y, 4.05e+173], t$95$1, If[LessEqual[y, 5.8e+212], N[(y / t$95$0), $MachinePrecision], N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
t_1 := \left(-z\right) - \frac{z}{\frac{y}{x}}\\
\mathbf{if}\;y \leq -1.25 \cdot 10^{+61}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-16}:\\
\;\;\;\;\frac{x}{t_0}\\
\mathbf{elif}\;y \leq 4.05 \cdot 10^{+173}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{+212}:\\
\;\;\;\;\frac{y}{t_0}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\
\end{array}
\end{array}
if y < -1.25000000000000004e61 or 1.35e-16 < y < 4.05000000000000018e173Initial program 76.2%
Taylor expanded in z around 0 66.2%
mul-1-neg66.2%
associate-/l*53.5%
+-commutative53.5%
associate-/r/77.1%
distribute-rgt-neg-in77.1%
+-commutative77.1%
Simplified77.1%
Taylor expanded in y around 0 77.1%
distribute-rgt-neg-out77.1%
add-sqr-sqrt38.2%
sqrt-unprod25.9%
sqr-neg25.9%
sqrt-unprod1.7%
add-sqr-sqrt3.1%
*-commutative3.1%
distribute-rgt-in3.1%
*-un-lft-identity3.1%
add-sqr-sqrt1.7%
sqrt-unprod21.8%
sqr-neg21.8%
sqrt-unprod31.0%
add-sqr-sqrt59.5%
*-commutative59.5%
clear-num59.5%
un-div-inv59.5%
add-sqr-sqrt28.3%
sqrt-unprod59.1%
sqr-neg59.1%
sqrt-unprod38.5%
add-sqr-sqrt77.1%
Applied egg-rr77.1%
if -1.25000000000000004e61 < y < 1.35e-16Initial program 99.2%
Taylor expanded in x around inf 77.3%
if 4.05000000000000018e173 < y < 5.7999999999999997e212Initial program 100.0%
Taylor expanded in x around 0 100.0%
if 5.7999999999999997e212 < y Initial program 53.2%
Taylor expanded in z around 0 61.1%
mul-1-neg61.1%
associate-/l*40.1%
+-commutative40.1%
associate-/r/86.8%
distribute-rgt-neg-in86.8%
+-commutative86.8%
Simplified86.8%
Taylor expanded in y around 0 86.8%
Taylor expanded in x around 0 86.8%
distribute-lft-out86.8%
associate-/l*86.8%
neg-mul-186.8%
+-commutative86.8%
+-commutative86.8%
associate-/l*86.8%
*-lft-identity86.8%
*-commutative86.8%
associate-/l*74.4%
associate-/r/86.8%
distribute-rgt-in86.8%
distribute-rgt-neg-in86.8%
distribute-neg-in86.8%
metadata-eval86.8%
unsub-neg86.8%
Simplified86.8%
Final simplification78.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.2e-76) (not (<= y 1.8e-25))) (* z (- -1.0 (/ x y))) (+ x y)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.2e-76) || !(y <= 1.8e-25)) {
tmp = z * (-1.0 - (x / y));
} 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 <= (-2.2d-76)) .or. (.not. (y <= 1.8d-25))) then
tmp = z * ((-1.0d0) - (x / y))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -2.2e-76) || !(y <= 1.8e-25)) {
tmp = z * (-1.0 - (x / y));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.2e-76) or not (y <= 1.8e-25): tmp = z * (-1.0 - (x / y)) else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.2e-76) || !(y <= 1.8e-25)) tmp = Float64(z * Float64(-1.0 - Float64(x / y))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2.2e-76) || ~((y <= 1.8e-25))) tmp = z * (-1.0 - (x / y)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.2e-76], N[Not[LessEqual[y, 1.8e-25]], $MachinePrecision]], N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{-76} \lor \neg \left(y \leq 1.8 \cdot 10^{-25}\right):\\
\;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -2.19999999999999999e-76 or 1.8e-25 < y Initial program 77.9%
Taylor expanded in z around 0 62.7%
mul-1-neg62.7%
associate-/l*52.4%
+-commutative52.4%
associate-/r/73.2%
distribute-rgt-neg-in73.2%
+-commutative73.2%
Simplified73.2%
Taylor expanded in y around 0 73.2%
Taylor expanded in x around 0 71.5%
distribute-lft-out71.5%
associate-/l*73.2%
neg-mul-173.2%
+-commutative73.2%
+-commutative73.2%
associate-/l*71.5%
*-lft-identity71.5%
*-commutative71.5%
associate-/l*68.8%
associate-/r/73.2%
distribute-rgt-in73.2%
distribute-rgt-neg-in73.2%
distribute-neg-in73.2%
metadata-eval73.2%
unsub-neg73.2%
Simplified73.2%
if -2.19999999999999999e-76 < y < 1.8e-25Initial program 99.9%
Taylor expanded in z around inf 80.8%
Final simplification76.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.25e+61) (not (<= y 2.05e-13))) (* z (- -1.0 (/ x y))) (/ x (- 1.0 (/ y z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.25e+61) || !(y <= 2.05e-13)) {
tmp = z * (-1.0 - (x / 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.25d+61)) .or. (.not. (y <= 2.05d-13))) then
tmp = z * ((-1.0d0) - (x / 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.25e+61) || !(y <= 2.05e-13)) {
tmp = z * (-1.0 - (x / y));
} else {
tmp = x / (1.0 - (y / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.25e+61) or not (y <= 2.05e-13): tmp = z * (-1.0 - (x / y)) else: tmp = x / (1.0 - (y / z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.25e+61) || !(y <= 2.05e-13)) tmp = Float64(z * Float64(-1.0 - Float64(x / 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.25e+61) || ~((y <= 2.05e-13))) tmp = z * (-1.0 - (x / y)); else tmp = x / (1.0 - (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.25e+61], N[Not[LessEqual[y, 2.05e-13]], $MachinePrecision]], N[(z * N[(-1.0 - N[(x / 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.25 \cdot 10^{+61} \lor \neg \left(y \leq 2.05 \cdot 10^{-13}\right):\\
\;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 - \frac{y}{z}}\\
\end{array}
\end{array}
if y < -1.25000000000000004e61 or 2.0500000000000001e-13 < y Initial program 73.9%
Taylor expanded in z around 0 63.8%
mul-1-neg63.8%
associate-/l*50.5%
+-commutative50.5%
associate-/r/76.6%
distribute-rgt-neg-in76.6%
+-commutative76.6%
Simplified76.6%
Taylor expanded in y around 0 76.6%
Taylor expanded in x around 0 73.8%
distribute-lft-out73.8%
associate-/l*76.6%
neg-mul-176.6%
+-commutative76.6%
+-commutative76.6%
associate-/l*73.8%
*-lft-identity73.8%
*-commutative73.8%
associate-/l*70.5%
associate-/r/76.6%
distribute-rgt-in76.6%
distribute-rgt-neg-in76.6%
distribute-neg-in76.6%
metadata-eval76.6%
unsub-neg76.6%
Simplified76.6%
if -1.25000000000000004e61 < y < 2.0500000000000001e-13Initial program 99.2%
Taylor expanded in x around inf 77.3%
Final simplification77.0%
(FPCore (x y z) :precision binary64 (if (<= y -1.62e+61) (- z) (if (<= y -2.35e-74) (* x (/ (- z) y)) (if (<= y 2.8e-5) (+ x y) (- z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.62e+61) {
tmp = -z;
} else if (y <= -2.35e-74) {
tmp = x * (-z / y);
} else if (y <= 2.8e-5) {
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 <= (-1.62d+61)) then
tmp = -z
else if (y <= (-2.35d-74)) then
tmp = x * (-z / y)
else if (y <= 2.8d-5) 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 <= -1.62e+61) {
tmp = -z;
} else if (y <= -2.35e-74) {
tmp = x * (-z / y);
} else if (y <= 2.8e-5) {
tmp = x + y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.62e+61: tmp = -z elif y <= -2.35e-74: tmp = x * (-z / y) elif y <= 2.8e-5: tmp = x + y else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.62e+61) tmp = Float64(-z); elseif (y <= -2.35e-74) tmp = Float64(x * Float64(Float64(-z) / y)); elseif (y <= 2.8e-5) tmp = Float64(x + y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.62e+61) tmp = -z; elseif (y <= -2.35e-74) tmp = x * (-z / y); elseif (y <= 2.8e-5) tmp = x + y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.62e+61], (-z), If[LessEqual[y, -2.35e-74], N[(x * N[((-z) / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e-5], N[(x + y), $MachinePrecision], (-z)]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.62 \cdot 10^{+61}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -2.35 \cdot 10^{-74}:\\
\;\;\;\;x \cdot \frac{-z}{y}\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-5}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -1.61999999999999996e61 or 2.79999999999999996e-5 < y Initial program 73.4%
Taylor expanded in y around inf 61.6%
mul-1-neg61.6%
Simplified61.6%
if -1.61999999999999996e61 < y < -2.35000000000000005e-74Initial program 95.9%
Taylor expanded in z around 0 58.1%
mul-1-neg58.1%
associate-/l*61.7%
+-commutative61.7%
distribute-neg-frac61.7%
distribute-neg-in61.7%
+-commutative61.7%
sub-neg61.7%
Simplified61.7%
Taylor expanded in y around 0 49.9%
mul-1-neg49.9%
*-commutative49.9%
associate-*r/53.2%
*-commutative53.2%
distribute-rgt-neg-in53.2%
Simplified53.2%
if -2.35000000000000005e-74 < y < 2.79999999999999996e-5Initial program 99.9%
Taylor expanded in z around inf 79.8%
Final simplification68.6%
(FPCore (x y z) :precision binary64 (if (<= y -1.4e+58) (- z) (if (<= y 1.6e-5) (+ x y) (- z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.4e+58) {
tmp = -z;
} else if (y <= 1.6e-5) {
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 <= (-1.4d+58)) then
tmp = -z
else if (y <= 1.6d-5) 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 <= -1.4e+58) {
tmp = -z;
} else if (y <= 1.6e-5) {
tmp = x + y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.4e+58: tmp = -z elif y <= 1.6e-5: tmp = x + y else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.4e+58) tmp = Float64(-z); elseif (y <= 1.6e-5) tmp = Float64(x + y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.4e+58) tmp = -z; elseif (y <= 1.6e-5) tmp = x + y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.4e+58], (-z), If[LessEqual[y, 1.6e-5], N[(x + y), $MachinePrecision], (-z)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{+58}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-5}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -1.3999999999999999e58 or 1.59999999999999993e-5 < y Initial program 73.6%
Taylor expanded in y around inf 61.2%
mul-1-neg61.2%
Simplified61.2%
if -1.3999999999999999e58 < y < 1.59999999999999993e-5Initial program 99.2%
Taylor expanded in z around inf 72.1%
Final simplification66.9%
(FPCore (x y z) :precision binary64 (if (<= y -4.8e+57) (- z) (if (<= y 1e-11) x (- z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -4.8e+57) {
tmp = -z;
} else if (y <= 1e-11) {
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 <= (-4.8d+57)) then
tmp = -z
else if (y <= 1d-11) 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 <= -4.8e+57) {
tmp = -z;
} else if (y <= 1e-11) {
tmp = x;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -4.8e+57: tmp = -z elif y <= 1e-11: tmp = x else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -4.8e+57) tmp = Float64(-z); elseif (y <= 1e-11) tmp = x; else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -4.8e+57) tmp = -z; elseif (y <= 1e-11) tmp = x; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -4.8e+57], (-z), If[LessEqual[y, 1e-11], x, (-z)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+57}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 10^{-11}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -4.80000000000000009e57 or 9.99999999999999939e-12 < y Initial program 74.1%
Taylor expanded in y around inf 61.0%
mul-1-neg61.0%
Simplified61.0%
if -4.80000000000000009e57 < y < 9.99999999999999939e-12Initial program 99.2%
Taylor expanded in y around 0 57.0%
Final simplification58.9%
(FPCore (x y z) :precision binary64 (if (<= y -4.6e+85) y (if (<= y 1.95e-36) x y)))
double code(double x, double y, double z) {
double tmp;
if (y <= -4.6e+85) {
tmp = y;
} else if (y <= 1.95e-36) {
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 <= (-4.6d+85)) then
tmp = y
else if (y <= 1.95d-36) 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 <= -4.6e+85) {
tmp = y;
} else if (y <= 1.95e-36) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -4.6e+85: tmp = y elif y <= 1.95e-36: tmp = x else: tmp = y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -4.6e+85) tmp = y; elseif (y <= 1.95e-36) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -4.6e+85) tmp = y; elseif (y <= 1.95e-36) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -4.6e+85], y, If[LessEqual[y, 1.95e-36], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+85}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 1.95 \cdot 10^{-36}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -4.5999999999999998e85 or 1.95e-36 < y Initial program 74.8%
Taylor expanded in x around 0 63.0%
Taylor expanded in y around 0 23.2%
if -4.5999999999999998e85 < y < 1.95e-36Initial program 98.5%
Taylor expanded in y around 0 56.3%
Final simplification40.3%
(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 31.3%
Final simplification31.3%
(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 2023174
(FPCore (x y z)
:name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, A"
:precision binary64
:herbie-target
(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))))