
(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 13 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 (let* ((t_1 (+ (/ x y) (/ (+ 2.0 (* (- 1.0 t) (* 2.0 z))) (* 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 + ((1.0 - t) * (2.0 * z))) / (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 + ((1.0 - t) * (2.0 * z))) / (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 + ((1.0 - t) * (2.0 * z))) / (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(1.0 - t) * Float64(2.0 * z))) / 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 + ((1.0 - t) * (2.0 * z))) / (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[(1.0 - t), $MachinePrecision] * N[(2.0 * z), $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(1 - t\right) \cdot \left(2 \cdot z\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 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z))) < +inf.0Initial program 99.8%
if +inf.0 < (+.f64 (/.f64 x y) (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z))) Initial program 0.0%
Taylor expanded in t around inf 100.0%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2e+39) (not (<= (/ x y) 8e+87))) (+ (/ x y) (/ (+ 2.0 (* 2.0 z)) (* z t))) (/ (+ (+ 2.0 (/ 2.0 z)) (* t (+ (/ x y) -2.0))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2e+39) || !((x / y) <= 8e+87)) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t));
} else {
tmp = ((2.0 + (2.0 / z)) + (t * ((x / y) + -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 (((x / y) <= (-2d+39)) .or. (.not. ((x / y) <= 8d+87))) then
tmp = (x / y) + ((2.0d0 + (2.0d0 * z)) / (z * t))
else
tmp = ((2.0d0 + (2.0d0 / z)) + (t * ((x / y) + (-2.0d0)))) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2e+39) || !((x / y) <= 8e+87)) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t));
} else {
tmp = ((2.0 + (2.0 / z)) + (t * ((x / y) + -2.0))) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2e+39) or not ((x / y) <= 8e+87): tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t)) else: tmp = ((2.0 + (2.0 / z)) + (t * ((x / y) + -2.0))) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2e+39) || !(Float64(x / y) <= 8e+87)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(2.0 * z)) / Float64(z * t))); else tmp = Float64(Float64(Float64(2.0 + Float64(2.0 / z)) + Float64(t * Float64(Float64(x / y) + -2.0))) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2e+39) || ~(((x / y) <= 8e+87))) tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t)); else tmp = ((2.0 + (2.0 / z)) + (t * ((x / y) + -2.0))) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2e+39], N[Not[LessEqual[N[(x / y), $MachinePrecision], 8e+87]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(2.0 * z), $MachinePrecision]), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] + N[(t * N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+39} \lor \neg \left(\frac{x}{y} \leq 8 \cdot 10^{+87}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2 + 2 \cdot z}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(2 + \frac{2}{z}\right) + t \cdot \left(\frac{x}{y} + -2\right)}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.99999999999999988e39 or 7.9999999999999997e87 < (/.f64 x y) Initial program 86.3%
Taylor expanded in t around 0 99.0%
if -1.99999999999999988e39 < (/.f64 x y) < 7.9999999999999997e87Initial program 89.9%
Taylor expanded in t around 0 99.8%
associate-+r+99.8%
associate-*r/99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2e+14) (not (<= (/ x y) 466.0))) (+ (/ x y) (/ (+ 2.0 (* 2.0 z)) (* z t))) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2e+14) || !((x / y) <= 466.0)) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t));
} else {
tmp = -2.0 + ((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 (((x / y) <= (-2d+14)) .or. (.not. ((x / y) <= 466.0d0))) then
tmp = (x / y) + ((2.0d0 + (2.0d0 * z)) / (z * t))
else
tmp = (-2.0d0) + ((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 (((x / y) <= -2e+14) || !((x / y) <= 466.0)) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t));
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2e+14) or not ((x / y) <= 466.0): tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t)) else: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2e+14) || !(Float64(x / y) <= 466.0)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(2.0 * z)) / Float64(z * t))); else tmp = Float64(-2.0 + 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 (((x / y) <= -2e+14) || ~(((x / y) <= 466.0))) tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t)); else tmp = -2.0 + ((2.0 + (2.0 / z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2e+14], N[Not[LessEqual[N[(x / y), $MachinePrecision], 466.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(2.0 * z), $MachinePrecision]), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+14} \lor \neg \left(\frac{x}{y} \leq 466\right):\\
\;\;\;\;\frac{x}{y} + \frac{2 + 2 \cdot z}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -2e14 or 466 < (/.f64 x y) Initial program 89.2%
Taylor expanded in t around 0 98.7%
if -2e14 < (/.f64 x y) < 466Initial program 87.7%
add-cube-cbrt86.5%
pow386.4%
*-commutative86.4%
Applied egg-rr86.4%
Taylor expanded in x around 0 99.4%
+-commutative99.4%
div-sub99.5%
*-inverses99.5%
*-lft-identity99.5%
*-lft-identity99.5%
sub-neg99.5%
metadata-eval99.5%
distribute-lft-in99.5%
metadata-eval99.5%
metadata-eval99.5%
sub-neg99.5%
associate-*r/99.5%
metadata-eval99.5%
associate--l+99.5%
+-commutative99.5%
associate-+r-99.5%
metadata-eval99.5%
associate-*r/99.5%
associate--l+99.5%
sub-neg99.5%
Simplified99.4%
Final simplification99.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)) (t_2 (+ -2.0 (/ 2.0 t))))
(if (<= z -4.2e+132)
t_2
(if (<= z -1.25e-77)
t_1
(if (<= z 6.5e-31)
(+ -2.0 (/ (/ 2.0 z) t))
(if (<= z 8600000000.0) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double t_2 = -2.0 + (2.0 / t);
double tmp;
if (z <= -4.2e+132) {
tmp = t_2;
} else if (z <= -1.25e-77) {
tmp = t_1;
} else if (z <= 6.5e-31) {
tmp = -2.0 + ((2.0 / z) / t);
} else if (z <= 8600000000.0) {
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_2 = (-2.0d0) + (2.0d0 / t)
if (z <= (-4.2d+132)) then
tmp = t_2
else if (z <= (-1.25d-77)) then
tmp = t_1
else if (z <= 6.5d-31) then
tmp = (-2.0d0) + ((2.0d0 / z) / t)
else if (z <= 8600000000.0d0) 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;
double t_2 = -2.0 + (2.0 / t);
double tmp;
if (z <= -4.2e+132) {
tmp = t_2;
} else if (z <= -1.25e-77) {
tmp = t_1;
} else if (z <= 6.5e-31) {
tmp = -2.0 + ((2.0 / z) / t);
} else if (z <= 8600000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 t_2 = -2.0 + (2.0 / t) tmp = 0 if z <= -4.2e+132: tmp = t_2 elif z <= -1.25e-77: tmp = t_1 elif z <= 6.5e-31: tmp = -2.0 + ((2.0 / z) / t) elif z <= 8600000000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) t_2 = Float64(-2.0 + Float64(2.0 / t)) tmp = 0.0 if (z <= -4.2e+132) tmp = t_2; elseif (z <= -1.25e-77) tmp = t_1; elseif (z <= 6.5e-31) tmp = Float64(-2.0 + Float64(Float64(2.0 / z) / t)); elseif (z <= 8600000000.0) 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_2 = -2.0 + (2.0 / t); tmp = 0.0; if (z <= -4.2e+132) tmp = t_2; elseif (z <= -1.25e-77) tmp = t_1; elseif (z <= 6.5e-31) tmp = -2.0 + ((2.0 / z) / t); elseif (z <= 8600000000.0) 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] - 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e+132], t$95$2, If[LessEqual[z, -1.25e-77], t$95$1, If[LessEqual[z, 6.5e-31], N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8600000000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
t_2 := -2 + \frac{2}{t}\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{+132}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-31}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\mathbf{elif}\;z \leq 8600000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.19999999999999987e132 or 8.6e9 < z Initial program 73.2%
add-cube-cbrt72.4%
pow372.4%
*-commutative72.4%
Applied egg-rr72.4%
Taylor expanded in x around 0 70.9%
+-commutative70.9%
div-sub71.0%
*-inverses71.0%
*-lft-identity71.0%
*-lft-identity71.0%
sub-neg71.0%
metadata-eval71.0%
distribute-lft-in71.0%
metadata-eval71.0%
metadata-eval71.0%
sub-neg71.0%
associate-*r/71.0%
metadata-eval71.0%
associate--l+71.0%
+-commutative71.0%
associate-+r-71.0%
metadata-eval71.0%
associate-*r/71.0%
associate--l+71.0%
sub-neg71.0%
Simplified71.0%
Taylor expanded in z around inf 70.8%
sub-neg70.8%
associate-*r/70.8%
metadata-eval70.8%
metadata-eval70.8%
Simplified70.8%
if -4.19999999999999987e132 < z < -1.24999999999999991e-77 or 6.49999999999999967e-31 < z < 8.6e9Initial program 95.8%
Taylor expanded in t around inf 78.0%
if -1.24999999999999991e-77 < z < 6.49999999999999967e-31Initial program 98.9%
add-cube-cbrt98.0%
pow397.9%
*-commutative97.9%
Applied egg-rr97.9%
Taylor expanded in x around 0 80.0%
+-commutative80.0%
div-sub80.0%
*-inverses80.0%
*-lft-identity80.0%
*-lft-identity80.0%
sub-neg80.0%
metadata-eval80.0%
distribute-lft-in80.0%
metadata-eval80.0%
metadata-eval80.0%
sub-neg80.0%
associate-*r/80.0%
metadata-eval80.0%
associate--l+80.0%
+-commutative80.0%
associate-+r-80.0%
metadata-eval80.0%
associate-*r/80.0%
associate--l+80.0%
sub-neg80.0%
Simplified80.0%
Taylor expanded in z around 0 80.0%
*-commutative80.0%
associate-/r*80.0%
Simplified80.0%
Final simplification76.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)) (t_2 (+ -2.0 (/ 2.0 t))))
(if (<= z -5.2e+129)
t_2
(if (<= z -9.2e-196)
t_1
(if (<= z 1.15e-31) (/ 2.0 (* z t)) (if (<= z 1860000.0) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double t_2 = -2.0 + (2.0 / t);
double tmp;
if (z <= -5.2e+129) {
tmp = t_2;
} else if (z <= -9.2e-196) {
tmp = t_1;
} else if (z <= 1.15e-31) {
tmp = 2.0 / (z * t);
} else if (z <= 1860000.0) {
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_2 = (-2.0d0) + (2.0d0 / t)
if (z <= (-5.2d+129)) then
tmp = t_2
else if (z <= (-9.2d-196)) then
tmp = t_1
else if (z <= 1.15d-31) then
tmp = 2.0d0 / (z * t)
else if (z <= 1860000.0d0) 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;
double t_2 = -2.0 + (2.0 / t);
double tmp;
if (z <= -5.2e+129) {
tmp = t_2;
} else if (z <= -9.2e-196) {
tmp = t_1;
} else if (z <= 1.15e-31) {
tmp = 2.0 / (z * t);
} else if (z <= 1860000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 t_2 = -2.0 + (2.0 / t) tmp = 0 if z <= -5.2e+129: tmp = t_2 elif z <= -9.2e-196: tmp = t_1 elif z <= 1.15e-31: tmp = 2.0 / (z * t) elif z <= 1860000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) t_2 = Float64(-2.0 + Float64(2.0 / t)) tmp = 0.0 if (z <= -5.2e+129) tmp = t_2; elseif (z <= -9.2e-196) tmp = t_1; elseif (z <= 1.15e-31) tmp = Float64(2.0 / Float64(z * t)); elseif (z <= 1860000.0) 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_2 = -2.0 + (2.0 / t); tmp = 0.0; if (z <= -5.2e+129) tmp = t_2; elseif (z <= -9.2e-196) tmp = t_1; elseif (z <= 1.15e-31) tmp = 2.0 / (z * t); elseif (z <= 1860000.0) 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] - 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e+129], t$95$2, If[LessEqual[z, -9.2e-196], t$95$1, If[LessEqual[z, 1.15e-31], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1860000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
t_2 := -2 + \frac{2}{t}\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{+129}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{-196}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-31}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{elif}\;z \leq 1860000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -5.20000000000000024e129 or 1.86e6 < z Initial program 73.2%
add-cube-cbrt72.4%
pow372.4%
*-commutative72.4%
Applied egg-rr72.4%
Taylor expanded in x around 0 70.9%
+-commutative70.9%
div-sub71.0%
*-inverses71.0%
*-lft-identity71.0%
*-lft-identity71.0%
sub-neg71.0%
metadata-eval71.0%
distribute-lft-in71.0%
metadata-eval71.0%
metadata-eval71.0%
sub-neg71.0%
associate-*r/71.0%
metadata-eval71.0%
associate--l+71.0%
+-commutative71.0%
associate-+r-71.0%
metadata-eval71.0%
associate-*r/71.0%
associate--l+71.0%
sub-neg71.0%
Simplified71.0%
Taylor expanded in z around inf 70.8%
sub-neg70.8%
associate-*r/70.8%
metadata-eval70.8%
metadata-eval70.8%
Simplified70.8%
if -5.20000000000000024e129 < z < -9.2000000000000007e-196 or 1.1499999999999999e-31 < z < 1.86e6Initial program 97.2%
Taylor expanded in t around inf 70.4%
if -9.2000000000000007e-196 < z < 1.1499999999999999e-31Initial program 98.6%
Taylor expanded in z around 0 79.4%
Final simplification73.5%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -0.092)
(/ x y)
(if (<= (/ x y) 4.6e-171)
-2.0
(if (<= (/ x y) 1.02e+88) (/ 2.0 t) (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -0.092) {
tmp = x / y;
} else if ((x / y) <= 4.6e-171) {
tmp = -2.0;
} else if ((x / y) <= 1.02e+88) {
tmp = 2.0 / t;
} else {
tmp = x / y;
}
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) <= (-0.092d0)) then
tmp = x / y
else if ((x / y) <= 4.6d-171) then
tmp = -2.0d0
else if ((x / y) <= 1.02d+88) then
tmp = 2.0d0 / t
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -0.092) {
tmp = x / y;
} else if ((x / y) <= 4.6e-171) {
tmp = -2.0;
} else if ((x / y) <= 1.02e+88) {
tmp = 2.0 / t;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -0.092: tmp = x / y elif (x / y) <= 4.6e-171: tmp = -2.0 elif (x / y) <= 1.02e+88: tmp = 2.0 / t else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -0.092) tmp = Float64(x / y); elseif (Float64(x / y) <= 4.6e-171) tmp = -2.0; elseif (Float64(x / y) <= 1.02e+88) tmp = Float64(2.0 / t); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -0.092) tmp = x / y; elseif ((x / y) <= 4.6e-171) tmp = -2.0; elseif ((x / y) <= 1.02e+88) tmp = 2.0 / t; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -0.092], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 4.6e-171], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 1.02e+88], N[(2.0 / t), $MachinePrecision], N[(x / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -0.092:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 4.6 \cdot 10^{-171}:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq 1.02 \cdot 10^{+88}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -0.091999999999999998 or 1.01999999999999998e88 < (/.f64 x y) Initial program 87.2%
Taylor expanded in x around inf 69.9%
if -0.091999999999999998 < (/.f64 x y) < 4.59999999999999956e-171Initial program 88.9%
add-cube-cbrt87.6%
pow387.6%
*-commutative87.6%
Applied egg-rr87.6%
Taylor expanded in x around 0 99.3%
+-commutative99.3%
div-sub99.3%
*-inverses99.3%
*-lft-identity99.3%
*-lft-identity99.3%
sub-neg99.3%
metadata-eval99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
sub-neg99.3%
associate-*r/99.3%
metadata-eval99.3%
associate--l+99.3%
+-commutative99.3%
associate-+r-99.3%
metadata-eval99.3%
associate-*r/99.3%
associate--l+99.3%
sub-neg99.3%
Simplified99.3%
Taylor expanded in t around inf 37.1%
if 4.59999999999999956e-171 < (/.f64 x y) < 1.01999999999999998e88Initial program 90.2%
Taylor expanded in t around 0 82.2%
associate-*r/82.2%
metadata-eval82.2%
Simplified82.2%
Taylor expanded in z around inf 37.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -5e+49) (not (<= (/ x y) 8e+87))) (+ (/ x y) (/ 2.0 t)) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5e+49) || !((x / y) <= 8e+87)) {
tmp = (x / y) + (2.0 / t);
} else {
tmp = -2.0 + ((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 (((x / y) <= (-5d+49)) .or. (.not. ((x / y) <= 8d+87))) then
tmp = (x / y) + (2.0d0 / t)
else
tmp = (-2.0d0) + ((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 (((x / y) <= -5e+49) || !((x / y) <= 8e+87)) {
tmp = (x / y) + (2.0 / t);
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -5e+49) or not ((x / y) <= 8e+87): tmp = (x / y) + (2.0 / t) else: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -5e+49) || !(Float64(x / y) <= 8e+87)) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); else tmp = Float64(-2.0 + 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 (((x / y) <= -5e+49) || ~(((x / y) <= 8e+87))) tmp = (x / y) + (2.0 / t); else tmp = -2.0 + ((2.0 + (2.0 / z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -5e+49], N[Not[LessEqual[N[(x / y), $MachinePrecision], 8e+87]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+49} \lor \neg \left(\frac{x}{y} \leq 8 \cdot 10^{+87}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -5.0000000000000004e49 or 7.9999999999999997e87 < (/.f64 x y) Initial program 86.8%
add-cube-cbrt86.4%
pow386.4%
*-commutative86.4%
Applied egg-rr86.4%
Taylor expanded in t around 0 98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in z around inf 85.1%
associate-*r/85.1%
metadata-eval85.1%
Simplified85.1%
if -5.0000000000000004e49 < (/.f64 x y) < 7.9999999999999997e87Initial program 89.5%
add-cube-cbrt88.3%
pow388.3%
*-commutative88.3%
Applied egg-rr88.3%
Taylor expanded in x around 0 95.2%
+-commutative95.2%
div-sub95.2%
*-inverses95.2%
*-lft-identity95.2%
*-lft-identity95.2%
sub-neg95.2%
metadata-eval95.2%
distribute-lft-in95.2%
metadata-eval95.2%
metadata-eval95.2%
sub-neg95.2%
associate-*r/95.2%
metadata-eval95.2%
associate--l+95.2%
+-commutative95.2%
associate-+r-95.2%
metadata-eval95.2%
associate-*r/95.2%
associate--l+95.2%
sub-neg95.2%
Simplified95.2%
Final simplification91.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -3400000.0) (not (<= (/ x y) 1e+88))) (/ x y) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -3400000.0) || !((x / y) <= 1e+88)) {
tmp = x / y;
} else {
tmp = -2.0 + (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 (((x / y) <= (-3400000.0d0)) .or. (.not. ((x / y) <= 1d+88))) then
tmp = x / y
else
tmp = (-2.0d0) + (2.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -3400000.0) || !((x / y) <= 1e+88)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -3400000.0) or not ((x / y) <= 1e+88): tmp = x / y else: tmp = -2.0 + (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -3400000.0) || !(Float64(x / y) <= 1e+88)) tmp = Float64(x / y); else tmp = Float64(-2.0 + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -3400000.0) || ~(((x / y) <= 1e+88))) tmp = x / y; else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -3400000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1e+88]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -3400000 \lor \neg \left(\frac{x}{y} \leq 10^{+88}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -3.4e6 or 9.99999999999999959e87 < (/.f64 x y) Initial program 87.1%
Taylor expanded in x around inf 70.6%
if -3.4e6 < (/.f64 x y) < 9.99999999999999959e87Initial program 89.5%
add-cube-cbrt88.3%
pow388.2%
*-commutative88.2%
Applied egg-rr88.2%
Taylor expanded in x around 0 97.7%
+-commutative97.7%
div-sub97.7%
*-inverses97.7%
*-lft-identity97.7%
*-lft-identity97.7%
sub-neg97.7%
metadata-eval97.7%
distribute-lft-in97.7%
metadata-eval97.7%
metadata-eval97.7%
sub-neg97.7%
associate-*r/97.7%
metadata-eval97.7%
associate--l+97.7%
+-commutative97.7%
associate-+r-97.7%
metadata-eval97.7%
associate-*r/97.7%
associate--l+97.7%
sub-neg97.7%
Simplified97.7%
Taylor expanded in z around inf 56.7%
sub-neg56.7%
associate-*r/56.7%
metadata-eval56.7%
metadata-eval56.7%
Simplified56.7%
Final simplification62.6%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -1950000.0) (- (/ x y) 2.0) (if (<= (/ x y) 1.05e+88) (+ -2.0 (/ 2.0 t)) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1950000.0) {
tmp = (x / y) - 2.0;
} else if ((x / y) <= 1.05e+88) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = x / y;
}
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) <= (-1950000.0d0)) then
tmp = (x / y) - 2.0d0
else if ((x / y) <= 1.05d+88) then
tmp = (-2.0d0) + (2.0d0 / t)
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1950000.0) {
tmp = (x / y) - 2.0;
} else if ((x / y) <= 1.05e+88) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1950000.0: tmp = (x / y) - 2.0 elif (x / y) <= 1.05e+88: tmp = -2.0 + (2.0 / t) else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1950000.0) tmp = Float64(Float64(x / y) - 2.0); elseif (Float64(x / y) <= 1.05e+88) tmp = Float64(-2.0 + Float64(2.0 / t)); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -1950000.0) tmp = (x / y) - 2.0; elseif ((x / y) <= 1.05e+88) tmp = -2.0 + (2.0 / t); else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1950000.0], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1.05e+88], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1950000:\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{elif}\;\frac{x}{y} \leq 1.05 \cdot 10^{+88}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.95e6Initial program 91.4%
Taylor expanded in t around inf 62.3%
if -1.95e6 < (/.f64 x y) < 1.05e88Initial program 89.5%
add-cube-cbrt88.3%
pow388.2%
*-commutative88.2%
Applied egg-rr88.2%
Taylor expanded in x around 0 97.7%
+-commutative97.7%
div-sub97.7%
*-inverses97.7%
*-lft-identity97.7%
*-lft-identity97.7%
sub-neg97.7%
metadata-eval97.7%
distribute-lft-in97.7%
metadata-eval97.7%
metadata-eval97.7%
sub-neg97.7%
associate-*r/97.7%
metadata-eval97.7%
associate--l+97.7%
+-commutative97.7%
associate-+r-97.7%
metadata-eval97.7%
associate-*r/97.7%
associate--l+97.7%
sub-neg97.7%
Simplified97.7%
Taylor expanded in z around inf 56.7%
sub-neg56.7%
associate-*r/56.7%
metadata-eval56.7%
metadata-eval56.7%
Simplified56.7%
if 1.05e88 < (/.f64 x y) Initial program 82.0%
Taylor expanded in x around inf 80.5%
Final simplification62.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.1e+14) (not (<= t 4.4e-6))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.1e+14) || !(t <= 4.4e-6)) {
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 <= (-1.1d+14)) .or. (.not. (t <= 4.4d-6))) 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 <= -1.1e+14) || !(t <= 4.4e-6)) {
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 <= -1.1e+14) or not (t <= 4.4e-6): 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 <= -1.1e+14) || !(t <= 4.4e-6)) 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 <= -1.1e+14) || ~((t <= 4.4e-6))) 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, -1.1e+14], N[Not[LessEqual[t, 4.4e-6]], $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 -1.1 \cdot 10^{+14} \lor \neg \left(t \leq 4.4 \cdot 10^{-6}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -1.1e14 or 4.4000000000000002e-6 < t Initial program 75.7%
Taylor expanded in t around inf 78.8%
if -1.1e14 < t < 4.4000000000000002e-6Initial program 99.0%
Taylor expanded in t around 0 80.6%
associate-*r/80.6%
metadata-eval80.6%
Simplified80.6%
Final simplification79.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.25e-6) (not (<= z 1.2e-30))) (+ (/ x y) (/ 2.0 t)) (+ -2.0 (/ (/ 2.0 z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.25e-6) || !(z <= 1.2e-30)) {
tmp = (x / y) + (2.0 / t);
} 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 ((z <= (-2.25d-6)) .or. (.not. (z <= 1.2d-30))) then
tmp = (x / y) + (2.0d0 / t)
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 ((z <= -2.25e-6) || !(z <= 1.2e-30)) {
tmp = (x / y) + (2.0 / t);
} else {
tmp = -2.0 + ((2.0 / z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.25e-6) or not (z <= 1.2e-30): tmp = (x / y) + (2.0 / t) else: tmp = -2.0 + ((2.0 / z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.25e-6) || !(z <= 1.2e-30)) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); else tmp = Float64(-2.0 + Float64(Float64(2.0 / z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.25e-6) || ~((z <= 1.2e-30))) tmp = (x / y) + (2.0 / t); else tmp = -2.0 + ((2.0 / z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.25e-6], N[Not[LessEqual[z, 1.2e-30]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{-6} \lor \neg \left(z \leq 1.2 \cdot 10^{-30}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\end{array}
\end{array}
if z < -2.25000000000000006e-6 or 1.19999999999999992e-30 < z Initial program 78.6%
add-cube-cbrt77.8%
pow377.8%
*-commutative77.8%
Applied egg-rr77.8%
Taylor expanded in t around 0 79.0%
*-commutative79.0%
Simplified79.0%
Taylor expanded in z around inf 77.7%
associate-*r/77.7%
metadata-eval77.7%
Simplified77.7%
if -2.25000000000000006e-6 < z < 1.19999999999999992e-30Initial program 99.0%
add-cube-cbrt98.0%
pow398.0%
*-commutative98.0%
Applied egg-rr98.0%
Taylor expanded in x around 0 78.4%
+-commutative78.4%
div-sub78.4%
*-inverses78.4%
*-lft-identity78.4%
*-lft-identity78.4%
sub-neg78.4%
metadata-eval78.4%
distribute-lft-in78.4%
metadata-eval78.4%
metadata-eval78.4%
sub-neg78.4%
associate-*r/78.4%
metadata-eval78.4%
associate--l+78.4%
+-commutative78.4%
associate-+r-78.4%
metadata-eval78.4%
associate-*r/78.4%
associate--l+78.4%
sub-neg78.4%
Simplified78.3%
Taylor expanded in z around 0 78.0%
*-commutative78.0%
associate-/r*78.0%
Simplified78.0%
Final simplification77.8%
(FPCore (x y z t) :precision binary64 (if (<= t -1.0) -2.0 (if (<= t 4.5e-6) (/ 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-6) {
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-6) 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-6) {
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-6: 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-6) 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-6) 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-6], 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^{-6}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1 or 4.50000000000000011e-6 < t Initial program 76.2%
add-cube-cbrt75.3%
pow375.3%
*-commutative75.3%
Applied egg-rr75.3%
Taylor expanded in x around 0 57.1%
+-commutative57.1%
div-sub57.1%
*-inverses57.1%
*-lft-identity57.1%
*-lft-identity57.1%
sub-neg57.1%
metadata-eval57.1%
distribute-lft-in57.1%
metadata-eval57.1%
metadata-eval57.1%
sub-neg57.1%
associate-*r/57.1%
metadata-eval57.1%
associate--l+57.1%
+-commutative57.1%
associate-+r-57.1%
metadata-eval57.1%
associate-*r/57.1%
associate--l+57.1%
sub-neg57.1%
Simplified57.1%
Taylor expanded in t around inf 35.0%
if -1 < t < 4.50000000000000011e-6Initial program 99.0%
Taylor expanded in t around 0 80.3%
associate-*r/80.3%
metadata-eval80.3%
Simplified80.3%
Taylor expanded in z around inf 39.6%
(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 88.5%
add-cube-cbrt87.6%
pow387.6%
*-commutative87.6%
Applied egg-rr87.6%
Taylor expanded in x around 0 70.0%
+-commutative70.0%
div-sub70.0%
*-inverses70.0%
*-lft-identity70.0%
*-lft-identity70.0%
sub-neg70.0%
metadata-eval70.0%
distribute-lft-in70.0%
metadata-eval70.0%
metadata-eval70.0%
sub-neg70.0%
associate-*r/70.0%
metadata-eval70.0%
associate--l+70.0%
+-commutative70.0%
associate-+r-70.0%
metadata-eval70.0%
associate-*r/70.0%
associate--l+70.0%
sub-neg70.0%
Simplified70.0%
Taylor expanded in t around inf 17.5%
(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 2024158
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:alt
(! :herbie-platform default (- (/ (+ (/ 2 z) 2) t) (- 2 (/ x y))))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))