
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= (+ (/ x y) (/ (+ 2.0 (* (* 2.0 z) (- 1.0 t))) (* z t))) INFINITY) (+ (/ x y) (pow (/ t (/ (fma (* 2.0 z) (- 1.0 t) 2.0) z)) -1.0)) (+ (/ x y) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) + ((2.0 + ((2.0 * z) * (1.0 - t))) / (z * t))) <= ((double) INFINITY)) {
tmp = (x / y) + pow((t / (fma((2.0 * z), (1.0 - t), 2.0) / z)), -1.0);
} else {
tmp = (x / y) + -2.0;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(2.0 * z) * Float64(1.0 - t))) / Float64(z * t))) <= Inf) tmp = Float64(Float64(x / y) + (Float64(t / Float64(fma(Float64(2.0 * z), Float64(1.0 - t), 2.0) / z)) ^ -1.0)); else tmp = Float64(Float64(x / y) + -2.0); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(2.0 * z), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x / y), $MachinePrecision] + N[Power[N[(t / N[(N[(N[(2.0 * z), $MachinePrecision] * N[(1.0 - t), $MachinePrecision] + 2.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} + \frac{2 + \left(2 \cdot z\right) \cdot \left(1 - t\right)}{z \cdot t} \leq \infty:\\
\;\;\;\;\frac{x}{y} + {\left(\frac{t}{\frac{\mathsf{fma}\left(2 \cdot z, 1 - t, 2\right)}{z}}\right)}^{-1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + -2\\
\end{array}
\end{array}
if (+.f64 (/.f64 x y) (/.f64 (+.f64 2 (*.f64 (*.f64 z 2) (-.f64 1 t))) (*.f64 t z))) < +inf.0Initial program 99.8%
clear-num99.8%
inv-pow99.8%
associate-/l*99.9%
+-commutative99.9%
fma-def99.9%
*-commutative99.9%
Applied egg-rr99.9%
if +inf.0 < (+.f64 (/.f64 x y) (/.f64 (+.f64 2 (*.f64 (*.f64 z 2) (-.f64 1 t))) (*.f64 t z))) Initial program 0.0%
Taylor expanded in t around inf 90.0%
Final simplification98.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ (/ x y) (/ (+ 2.0 (* (* 2.0 z) (- 1.0 t))) (* z t))))) (if (<= t_1 INFINITY) t_1 (+ (/ x y) -2.0))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + ((2.0 + ((2.0 * z) * (1.0 - t))) / (z * t));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (x / y) + -2.0;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + ((2.0 + ((2.0 * z) * (1.0 - t))) / (z * t));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (x / y) + -2.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + ((2.0 + ((2.0 * z) * (1.0 - t))) / (z * t)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = (x / y) + -2.0 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(2.0 * z) * Float64(1.0 - t))) / Float64(z * t))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(x / y) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + ((2.0 + ((2.0 * z) * (1.0 - t))) / (z * t)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = (x / y) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(2.0 * z), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2 + \left(2 \cdot z\right) \cdot \left(1 - t\right)}{z \cdot t}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + -2\\
\end{array}
\end{array}
if (+.f64 (/.f64 x y) (/.f64 (+.f64 2 (*.f64 (*.f64 z 2) (-.f64 1 t))) (*.f64 t z))) < +inf.0Initial program 99.8%
if +inf.0 < (+.f64 (/.f64 x y) (/.f64 (+.f64 2 (*.f64 (*.f64 z 2) (-.f64 1 t))) (*.f64 t z))) Initial program 0.0%
Taylor expanded in t around inf 90.0%
Final simplification98.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) -2.0)))
(if (<= z -1.7e+122)
t_1
(if (<= z -8.2e+81)
(* 2.0 (/ (- 1.0 t) t))
(if (<= z -1.95e-71)
t_1
(if (<= z 4.7e-85)
(/ 2.0 (* z t))
(if (or (<= z 2.8e+198) (not (<= z 1.5e+227))) t_1 (/ 2.0 t))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double tmp;
if (z <= -1.7e+122) {
tmp = t_1;
} else if (z <= -8.2e+81) {
tmp = 2.0 * ((1.0 - t) / t);
} else if (z <= -1.95e-71) {
tmp = t_1;
} else if (z <= 4.7e-85) {
tmp = 2.0 / (z * t);
} else if ((z <= 2.8e+198) || !(z <= 1.5e+227)) {
tmp = t_1;
} else {
tmp = 2.0 / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / y) + (-2.0d0)
if (z <= (-1.7d+122)) then
tmp = t_1
else if (z <= (-8.2d+81)) then
tmp = 2.0d0 * ((1.0d0 - t) / t)
else if (z <= (-1.95d-71)) then
tmp = t_1
else if (z <= 4.7d-85) then
tmp = 2.0d0 / (z * t)
else if ((z <= 2.8d+198) .or. (.not. (z <= 1.5d+227))) then
tmp = t_1
else
tmp = 2.0d0 / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double tmp;
if (z <= -1.7e+122) {
tmp = t_1;
} else if (z <= -8.2e+81) {
tmp = 2.0 * ((1.0 - t) / t);
} else if (z <= -1.95e-71) {
tmp = t_1;
} else if (z <= 4.7e-85) {
tmp = 2.0 / (z * t);
} else if ((z <= 2.8e+198) || !(z <= 1.5e+227)) {
tmp = t_1;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + -2.0 tmp = 0 if z <= -1.7e+122: tmp = t_1 elif z <= -8.2e+81: tmp = 2.0 * ((1.0 - t) / t) elif z <= -1.95e-71: tmp = t_1 elif z <= 4.7e-85: tmp = 2.0 / (z * t) elif (z <= 2.8e+198) or not (z <= 1.5e+227): tmp = t_1 else: tmp = 2.0 / t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + -2.0) tmp = 0.0 if (z <= -1.7e+122) tmp = t_1; elseif (z <= -8.2e+81) tmp = Float64(2.0 * Float64(Float64(1.0 - t) / t)); elseif (z <= -1.95e-71) tmp = t_1; elseif (z <= 4.7e-85) tmp = Float64(2.0 / Float64(z * t)); elseif ((z <= 2.8e+198) || !(z <= 1.5e+227)) tmp = t_1; else tmp = Float64(2.0 / t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + -2.0; tmp = 0.0; if (z <= -1.7e+122) tmp = t_1; elseif (z <= -8.2e+81) tmp = 2.0 * ((1.0 - t) / t); elseif (z <= -1.95e-71) tmp = t_1; elseif (z <= 4.7e-85) tmp = 2.0 / (z * t); elseif ((z <= 2.8e+198) || ~((z <= 1.5e+227))) tmp = t_1; else tmp = 2.0 / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[z, -1.7e+122], t$95$1, If[LessEqual[z, -8.2e+81], N[(2.0 * N[(N[(1.0 - t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.95e-71], t$95$1, If[LessEqual[z, 4.7e-85], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 2.8e+198], N[Not[LessEqual[z, 1.5e+227]], $MachinePrecision]], t$95$1, N[(2.0 / t), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+122}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{+81}:\\
\;\;\;\;2 \cdot \frac{1 - t}{t}\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{-85}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+198} \lor \neg \left(z \leq 1.5 \cdot 10^{+227}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if z < -1.7e122 or -8.20000000000000024e81 < z < -1.9500000000000001e-71 or 4.70000000000000009e-85 < z < 2.8e198 or 1.49999999999999993e227 < z Initial program 78.0%
Taylor expanded in t around inf 73.0%
if -1.7e122 < z < -8.20000000000000024e81Initial program 88.5%
+-commutative88.5%
remove-double-neg88.5%
distribute-frac-neg88.5%
unsub-neg88.5%
*-commutative88.5%
associate-*r*88.5%
distribute-rgt1-in88.5%
associate-*r/88.5%
/-rgt-identity88.5%
fma-neg88.5%
/-rgt-identity88.5%
*-commutative88.5%
fma-def88.5%
*-commutative88.5%
distribute-frac-neg88.5%
remove-double-neg88.5%
Simplified88.5%
Taylor expanded in x around 0 77.6%
Taylor expanded in z around inf 89.0%
if -1.9500000000000001e-71 < z < 4.70000000000000009e-85Initial program 94.2%
clear-num94.2%
inv-pow94.2%
associate-/l*94.2%
+-commutative94.2%
fma-def94.2%
*-commutative94.2%
Applied egg-rr94.2%
Taylor expanded in z around 0 75.1%
*-commutative75.1%
Simplified75.1%
if 2.8e198 < z < 1.49999999999999993e227Initial program 85.3%
Taylor expanded in t around 0 85.9%
associate-*r/85.9%
metadata-eval85.9%
Simplified85.9%
Taylor expanded in z around inf 85.9%
Final simplification74.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (/ (/ 2.0 t) z))) (t_2 (+ (/ x y) -2.0)))
(if (<= t -4.9e+66)
t_2
(if (<= t -2.5e-64)
t_1
(if (<= t 4e-24) (/ (+ 2.0 (/ 2.0 z)) t) (if (<= t 8e+114) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + ((2.0 / t) / z);
double t_2 = (x / y) + -2.0;
double tmp;
if (t <= -4.9e+66) {
tmp = t_2;
} else if (t <= -2.5e-64) {
tmp = t_1;
} else if (t <= 4e-24) {
tmp = (2.0 + (2.0 / z)) / t;
} else if (t <= 8e+114) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x / y) + ((2.0d0 / t) / z)
t_2 = (x / y) + (-2.0d0)
if (t <= (-4.9d+66)) then
tmp = t_2
else if (t <= (-2.5d-64)) then
tmp = t_1
else if (t <= 4d-24) then
tmp = (2.0d0 + (2.0d0 / z)) / t
else if (t <= 8d+114) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + ((2.0 / t) / z);
double t_2 = (x / y) + -2.0;
double tmp;
if (t <= -4.9e+66) {
tmp = t_2;
} else if (t <= -2.5e-64) {
tmp = t_1;
} else if (t <= 4e-24) {
tmp = (2.0 + (2.0 / z)) / t;
} else if (t <= 8e+114) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + ((2.0 / t) / z) t_2 = (x / y) + -2.0 tmp = 0 if t <= -4.9e+66: tmp = t_2 elif t <= -2.5e-64: tmp = t_1 elif t <= 4e-24: tmp = (2.0 + (2.0 / z)) / t elif t <= 8e+114: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)) t_2 = Float64(Float64(x / y) + -2.0) tmp = 0.0 if (t <= -4.9e+66) tmp = t_2; elseif (t <= -2.5e-64) tmp = t_1; elseif (t <= 4e-24) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); elseif (t <= 8e+114) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + ((2.0 / t) / z); t_2 = (x / y) + -2.0; tmp = 0.0; if (t <= -4.9e+66) tmp = t_2; elseif (t <= -2.5e-64) tmp = t_1; elseif (t <= 4e-24) tmp = (2.0 + (2.0 / z)) / t; elseif (t <= 8e+114) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[t, -4.9e+66], t$95$2, If[LessEqual[t, -2.5e-64], t$95$1, If[LessEqual[t, 4e-24], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 8e+114], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{\frac{2}{t}}{z}\\
t_2 := \frac{x}{y} + -2\\
\mathbf{if}\;t \leq -4.9 \cdot 10^{+66}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -2.5 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-24}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{elif}\;t \leq 8 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -4.89999999999999975e66 or 8e114 < t Initial program 62.2%
Taylor expanded in t around inf 92.8%
if -4.89999999999999975e66 < t < -2.50000000000000017e-64 or 3.99999999999999969e-24 < t < 8e114Initial program 98.2%
Taylor expanded in z around 0 82.1%
associate-/r*82.0%
Simplified82.0%
if -2.50000000000000017e-64 < t < 3.99999999999999969e-24Initial program 94.9%
Taylor expanded in t around 0 84.0%
associate-*r/84.0%
metadata-eval84.0%
Simplified84.0%
Final simplification86.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) -2.0)))
(if (<= t -2.7e+63)
t_1
(if (<= t -50000000000000.0)
(* 2.0 (+ -1.0 (/ 1.0 (* z t))))
(if (<= t -11.2)
(/ x y)
(if (<= t 4.2e-21) (/ (+ 2.0 (/ 2.0 z)) t) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double tmp;
if (t <= -2.7e+63) {
tmp = t_1;
} else if (t <= -50000000000000.0) {
tmp = 2.0 * (-1.0 + (1.0 / (z * t)));
} else if (t <= -11.2) {
tmp = x / y;
} else if (t <= 4.2e-21) {
tmp = (2.0 + (2.0 / z)) / t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / y) + (-2.0d0)
if (t <= (-2.7d+63)) then
tmp = t_1
else if (t <= (-50000000000000.0d0)) then
tmp = 2.0d0 * ((-1.0d0) + (1.0d0 / (z * t)))
else if (t <= (-11.2d0)) then
tmp = x / y
else if (t <= 4.2d-21) then
tmp = (2.0d0 + (2.0d0 / z)) / t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double tmp;
if (t <= -2.7e+63) {
tmp = t_1;
} else if (t <= -50000000000000.0) {
tmp = 2.0 * (-1.0 + (1.0 / (z * t)));
} else if (t <= -11.2) {
tmp = x / y;
} else if (t <= 4.2e-21) {
tmp = (2.0 + (2.0 / z)) / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + -2.0 tmp = 0 if t <= -2.7e+63: tmp = t_1 elif t <= -50000000000000.0: tmp = 2.0 * (-1.0 + (1.0 / (z * t))) elif t <= -11.2: tmp = x / y elif t <= 4.2e-21: tmp = (2.0 + (2.0 / z)) / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + -2.0) tmp = 0.0 if (t <= -2.7e+63) tmp = t_1; elseif (t <= -50000000000000.0) tmp = Float64(2.0 * Float64(-1.0 + Float64(1.0 / Float64(z * t)))); elseif (t <= -11.2) tmp = Float64(x / y); elseif (t <= 4.2e-21) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + -2.0; tmp = 0.0; if (t <= -2.7e+63) tmp = t_1; elseif (t <= -50000000000000.0) tmp = 2.0 * (-1.0 + (1.0 / (z * t))); elseif (t <= -11.2) tmp = x / y; elseif (t <= 4.2e-21) tmp = (2.0 + (2.0 / z)) / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[t, -2.7e+63], t$95$1, If[LessEqual[t, -50000000000000.0], N[(2.0 * N[(-1.0 + N[(1.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -11.2], N[(x / y), $MachinePrecision], If[LessEqual[t, 4.2e-21], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
\mathbf{if}\;t \leq -2.7 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -50000000000000:\\
\;\;\;\;2 \cdot \left(-1 + \frac{1}{z \cdot t}\right)\\
\mathbf{elif}\;t \leq -11.2:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-21}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.70000000000000017e63 or 4.20000000000000025e-21 < t Initial program 72.2%
Taylor expanded in t around inf 86.8%
if -2.70000000000000017e63 < t < -5e13Initial program 99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
unsub-neg99.8%
*-commutative99.8%
associate-*r*99.8%
distribute-rgt1-in99.8%
associate-*r/99.8%
/-rgt-identity99.8%
fma-neg99.8%
/-rgt-identity99.8%
*-commutative99.8%
fma-def99.8%
*-commutative99.8%
distribute-frac-neg99.8%
remove-double-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 99.8%
Taylor expanded in t around inf 99.8%
associate-*r*99.8%
neg-mul-199.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 99.8%
if -5e13 < t < -11.199999999999999Initial program 100.0%
Taylor expanded in x around inf 100.0%
if -11.199999999999999 < t < 4.20000000000000025e-21Initial program 95.5%
Taylor expanded in t around 0 81.6%
associate-*r/81.6%
metadata-eval81.6%
Simplified81.6%
Final simplification84.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) -2.0)))
(if (<= z -4.1e-71)
t_1
(if (<= z 3.2e-87)
(/ 2.0 (* z t))
(if (or (<= z 3.9e+198) (not (<= z 9.5e+226))) t_1 (/ 2.0 t))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double tmp;
if (z <= -4.1e-71) {
tmp = t_1;
} else if (z <= 3.2e-87) {
tmp = 2.0 / (z * t);
} else if ((z <= 3.9e+198) || !(z <= 9.5e+226)) {
tmp = t_1;
} else {
tmp = 2.0 / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / y) + (-2.0d0)
if (z <= (-4.1d-71)) then
tmp = t_1
else if (z <= 3.2d-87) then
tmp = 2.0d0 / (z * t)
else if ((z <= 3.9d+198) .or. (.not. (z <= 9.5d+226))) then
tmp = t_1
else
tmp = 2.0d0 / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double tmp;
if (z <= -4.1e-71) {
tmp = t_1;
} else if (z <= 3.2e-87) {
tmp = 2.0 / (z * t);
} else if ((z <= 3.9e+198) || !(z <= 9.5e+226)) {
tmp = t_1;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + -2.0 tmp = 0 if z <= -4.1e-71: tmp = t_1 elif z <= 3.2e-87: tmp = 2.0 / (z * t) elif (z <= 3.9e+198) or not (z <= 9.5e+226): tmp = t_1 else: tmp = 2.0 / t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + -2.0) tmp = 0.0 if (z <= -4.1e-71) tmp = t_1; elseif (z <= 3.2e-87) tmp = Float64(2.0 / Float64(z * t)); elseif ((z <= 3.9e+198) || !(z <= 9.5e+226)) tmp = t_1; else tmp = Float64(2.0 / t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + -2.0; tmp = 0.0; if (z <= -4.1e-71) tmp = t_1; elseif (z <= 3.2e-87) tmp = 2.0 / (z * t); elseif ((z <= 3.9e+198) || ~((z <= 9.5e+226))) tmp = t_1; else tmp = 2.0 / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[z, -4.1e-71], t$95$1, If[LessEqual[z, 3.2e-87], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 3.9e+198], N[Not[LessEqual[z, 9.5e+226]], $MachinePrecision]], t$95$1, N[(2.0 / t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
\mathbf{if}\;z \leq -4.1 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-87}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+198} \lor \neg \left(z \leq 9.5 \cdot 10^{+226}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if z < -4.09999999999999993e-71 or 3.19999999999999979e-87 < z < 3.9e198 or 9.50000000000000088e226 < z Initial program 78.6%
Taylor expanded in t around inf 70.9%
if -4.09999999999999993e-71 < z < 3.19999999999999979e-87Initial program 94.2%
clear-num94.2%
inv-pow94.2%
associate-/l*94.2%
+-commutative94.2%
fma-def94.2%
*-commutative94.2%
Applied egg-rr94.2%
Taylor expanded in z around 0 75.1%
*-commutative75.1%
Simplified75.1%
if 3.9e198 < z < 9.50000000000000088e226Initial program 85.3%
Taylor expanded in t around 0 85.9%
associate-*r/85.9%
metadata-eval85.9%
Simplified85.9%
Taylor expanded in z around inf 85.9%
Final simplification72.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.5e-23) (not (<= z 4.9e-8))) (+ (/ x y) (/ (* 2.0 (- 1.0 t)) t)) (+ (/ x y) (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.5e-23) || !(z <= 4.9e-8)) {
tmp = (x / y) + ((2.0 * (1.0 - t)) / t);
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-4.5d-23)) .or. (.not. (z <= 4.9d-8))) then
tmp = (x / y) + ((2.0d0 * (1.0d0 - t)) / t)
else
tmp = (x / y) + ((2.0d0 / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.5e-23) || !(z <= 4.9e-8)) {
tmp = (x / y) + ((2.0 * (1.0 - t)) / t);
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.5e-23) or not (z <= 4.9e-8): tmp = (x / y) + ((2.0 * (1.0 - t)) / t) else: tmp = (x / y) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.5e-23) || !(z <= 4.9e-8)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 * Float64(1.0 - t)) / t)); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4.5e-23) || ~((z <= 4.9e-8))) tmp = (x / y) + ((2.0 * (1.0 - t)) / t); else tmp = (x / y) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.5e-23], N[Not[LessEqual[z, 4.9e-8]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 * N[(1.0 - t), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-23} \lor \neg \left(z \leq 4.9 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2 \cdot \left(1 - t\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if z < -4.49999999999999975e-23 or 4.9000000000000002e-8 < z Initial program 73.1%
Taylor expanded in z around inf 98.5%
associate-*r/98.5%
Simplified98.5%
if -4.49999999999999975e-23 < z < 4.9000000000000002e-8Initial program 95.8%
Taylor expanded in z around 0 84.6%
associate-/r*84.6%
Simplified84.6%
Final simplification91.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -4.9e-23) (not (<= (/ x y) 2.0))) (/ x y) -2.0))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -4.9e-23) || !((x / y) <= 2.0)) {
tmp = x / y;
} else {
tmp = -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-4.9d-23)) .or. (.not. ((x / y) <= 2.0d0))) then
tmp = x / y
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -4.9e-23) || !((x / y) <= 2.0)) {
tmp = x / y;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -4.9e-23) or not ((x / y) <= 2.0): tmp = x / y else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -4.9e-23) || !(Float64(x / y) <= 2.0)) tmp = Float64(x / y); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -4.9e-23) || ~(((x / y) <= 2.0))) tmp = x / y; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -4.9e-23], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], -2.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -4.9 \cdot 10^{-23} \lor \neg \left(\frac{x}{y} \leq 2\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if (/.f64 x y) < -4.8999999999999998e-23 or 2 < (/.f64 x y) Initial program 81.4%
Taylor expanded in x around inf 68.0%
if -4.8999999999999998e-23 < (/.f64 x y) < 2Initial program 87.4%
+-commutative87.4%
remove-double-neg87.4%
distribute-frac-neg87.4%
unsub-neg87.4%
*-commutative87.4%
associate-*r*87.4%
distribute-rgt1-in87.4%
associate-*r/87.3%
/-rgt-identity87.3%
fma-neg87.3%
/-rgt-identity87.3%
*-commutative87.3%
fma-def87.3%
*-commutative87.3%
distribute-frac-neg87.3%
remove-double-neg87.3%
Simplified87.3%
Taylor expanded in x around 0 87.4%
Taylor expanded in t around inf 39.6%
Final simplification54.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -10.0) (not (<= t 4.5e-20))) (+ (/ x y) -2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -10.0) || !(t <= 4.5e-20)) {
tmp = (x / y) + -2.0;
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-10.0d0)) .or. (.not. (t <= 4.5d-20))) then
tmp = (x / y) + (-2.0d0)
else
tmp = (2.0d0 + (2.0d0 / z)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -10.0) || !(t <= 4.5e-20)) {
tmp = (x / y) + -2.0;
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -10.0) or not (t <= 4.5e-20): tmp = (x / y) + -2.0 else: tmp = (2.0 + (2.0 / z)) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -10.0) || !(t <= 4.5e-20)) tmp = Float64(Float64(x / y) + -2.0); else tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -10.0) || ~((t <= 4.5e-20))) tmp = (x / y) + -2.0; else tmp = (2.0 + (2.0 / z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -10.0], N[Not[LessEqual[t, 4.5e-20]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -10 \lor \neg \left(t \leq 4.5 \cdot 10^{-20}\right):\\
\;\;\;\;\frac{x}{y} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -10 or 4.5000000000000001e-20 < t Initial program 74.2%
Taylor expanded in t around inf 84.3%
if -10 < t < 4.5000000000000001e-20Initial program 95.5%
Taylor expanded in t around 0 81.6%
associate-*r/81.6%
metadata-eval81.6%
Simplified81.6%
Final simplification83.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.14e-66) (not (<= t 1.12e-23))) (+ (/ x y) -2.0) (/ 2.0 t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.14e-66) || !(t <= 1.12e-23)) {
tmp = (x / y) + -2.0;
} else {
tmp = 2.0 / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-1.14d-66)) .or. (.not. (t <= 1.12d-23))) then
tmp = (x / y) + (-2.0d0)
else
tmp = 2.0d0 / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.14e-66) || !(t <= 1.12e-23)) {
tmp = (x / y) + -2.0;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.14e-66) or not (t <= 1.12e-23): tmp = (x / y) + -2.0 else: tmp = 2.0 / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.14e-66) || !(t <= 1.12e-23)) tmp = Float64(Float64(x / y) + -2.0); else tmp = Float64(2.0 / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.14e-66) || ~((t <= 1.12e-23))) tmp = (x / y) + -2.0; else tmp = 2.0 / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.14e-66], N[Not[LessEqual[t, 1.12e-23]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision], N[(2.0 / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.14 \cdot 10^{-66} \lor \neg \left(t \leq 1.12 \cdot 10^{-23}\right):\\
\;\;\;\;\frac{x}{y} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if t < -1.14e-66 or 1.1200000000000001e-23 < t Initial program 76.9%
Taylor expanded in t around inf 78.9%
if -1.14e-66 < t < 1.1200000000000001e-23Initial program 94.9%
Taylor expanded in t around 0 84.0%
associate-*r/84.0%
metadata-eval84.0%
Simplified84.0%
Taylor expanded in z around inf 36.4%
Final simplification61.6%
(FPCore (x y z t) :precision binary64 (if (<= t -1.0) -2.0 (if (<= t 4.5e-20) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.0) {
tmp = -2.0;
} else if (t <= 4.5e-20) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.0d0)) then
tmp = -2.0d0
else if (t <= 4.5d-20) then
tmp = 2.0d0 / t
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.0) {
tmp = -2.0;
} else if (t <= 4.5e-20) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.0: tmp = -2.0 elif t <= 4.5e-20: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.0) tmp = -2.0; elseif (t <= 4.5e-20) tmp = Float64(2.0 / t); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.0) tmp = -2.0; elseif (t <= 4.5e-20) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.0], -2.0, If[LessEqual[t, 4.5e-20], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-20}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1 or 4.5000000000000001e-20 < t Initial program 74.4%
+-commutative74.4%
remove-double-neg74.4%
distribute-frac-neg74.4%
unsub-neg74.4%
*-commutative74.4%
associate-*r*74.4%
distribute-rgt1-in74.4%
associate-*r/74.3%
/-rgt-identity74.3%
fma-neg74.3%
/-rgt-identity74.3%
*-commutative74.3%
fma-def74.3%
*-commutative74.3%
distribute-frac-neg74.3%
remove-double-neg74.3%
Simplified74.3%
Taylor expanded in x around 0 40.3%
Taylor expanded in t around inf 35.4%
if -1 < t < 4.5000000000000001e-20Initial program 95.5%
Taylor expanded in t around 0 81.5%
associate-*r/81.5%
metadata-eval81.5%
Simplified81.5%
Taylor expanded in z around inf 34.1%
Final simplification34.8%
(FPCore (x y z t) :precision binary64 -2.0)
double code(double x, double y, double z, double t) {
return -2.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -2.0d0
end function
public static double code(double x, double y, double z, double t) {
return -2.0;
}
def code(x, y, z, t): return -2.0
function code(x, y, z, t) return -2.0 end
function tmp = code(x, y, z, t) tmp = -2.0; end
code[x_, y_, z_, t_] := -2.0
\begin{array}{l}
\\
-2
\end{array}
Initial program 84.2%
+-commutative84.2%
remove-double-neg84.2%
distribute-frac-neg84.2%
unsub-neg84.2%
*-commutative84.2%
associate-*r*84.2%
distribute-rgt1-in84.2%
associate-*r/84.2%
/-rgt-identity84.2%
fma-neg84.2%
/-rgt-identity84.2%
*-commutative84.2%
fma-def84.2%
*-commutative84.2%
distribute-frac-neg84.2%
remove-double-neg84.2%
Simplified84.2%
Taylor expanded in x around 0 59.5%
Taylor expanded in t around inf 20.0%
Final simplification20.0%
(FPCore (x y z t) :precision binary64 (- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y))))
double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((2.0d0 / z) + 2.0d0) / t) - (2.0d0 - (x / y))
end function
public static double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
def code(x, y, z, t): return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(2.0 / z) + 2.0) / t) - Float64(2.0 - Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = (((2.0 / z) + 2.0) / t) - (2.0 - (x / y)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(2.0 / z), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] - N[(2.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{2}{z} + 2}{t} - \left(2 - \frac{x}{y}\right)
\end{array}
herbie shell --seed 2024027
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:herbie-target
(- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))