
(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 14 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 (or (<= (/ x y) -2e+95) (not (<= (/ x y) 1000000000000.0))) (+ (/ 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+95) || !((x / y) <= 1000000000000.0)) {
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+95)) .or. (.not. ((x / y) <= 1000000000000.0d0))) 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+95) || !((x / y) <= 1000000000000.0)) {
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+95) or not ((x / y) <= 1000000000000.0): 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+95) || !(Float64(x / y) <= 1000000000000.0)) 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+95) || ~(((x / y) <= 1000000000000.0))) 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+95], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1000000000000.0]], $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^{+95} \lor \neg \left(\frac{x}{y} \leq 1000000000000\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) < -2.00000000000000004e95 or 1e12 < (/.f64 x y) Initial program 80.9%
Taylor expanded in t around 0 97.3%
if -2.00000000000000004e95 < (/.f64 x y) < 1e12Initial program 86.2%
Taylor expanded in t around 0 99.9%
associate-+r+99.9%
associate-*r/99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification98.7%
(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 (+ (/ 2.0 t) (+ (/ 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 = (2.0 / t) + ((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 = (2.0 / t) + ((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 = (2.0 / t) + ((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(2.0 / t) + 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 = (2.0 / t) + ((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[(2.0 / t), $MachinePrecision] + N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]), $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{2}{t} + \left(\frac{x}{y} + -2\right)\\
\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 z around inf 92.7%
div-sub92.7%
sub-neg92.7%
*-inverses92.7%
metadata-eval92.7%
Simplified92.7%
Taylor expanded in x around 0 92.7%
sub-neg92.7%
metadata-eval92.7%
distribute-lft-in92.7%
metadata-eval92.7%
associate-+r+92.7%
+-commutative92.7%
associate-*r/92.7%
metadata-eval92.7%
Simplified92.7%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -200.0)
(/ x y)
(if (<= (/ x y) 1e-242)
-2.0
(if (<= (/ x y) 2000000000.0) (/ 2.0 t) (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -200.0) {
tmp = x / y;
} else if ((x / y) <= 1e-242) {
tmp = -2.0;
} else if ((x / y) <= 2000000000.0) {
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) <= (-200.0d0)) then
tmp = x / y
else if ((x / y) <= 1d-242) then
tmp = -2.0d0
else if ((x / y) <= 2000000000.0d0) 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) <= -200.0) {
tmp = x / y;
} else if ((x / y) <= 1e-242) {
tmp = -2.0;
} else if ((x / y) <= 2000000000.0) {
tmp = 2.0 / t;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -200.0: tmp = x / y elif (x / y) <= 1e-242: tmp = -2.0 elif (x / y) <= 2000000000.0: tmp = 2.0 / t else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -200.0) tmp = Float64(x / y); elseif (Float64(x / y) <= 1e-242) tmp = -2.0; elseif (Float64(x / y) <= 2000000000.0) 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) <= -200.0) tmp = x / y; elseif ((x / y) <= 1e-242) tmp = -2.0; elseif ((x / y) <= 2000000000.0) tmp = 2.0 / t; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -200.0], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1e-242], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 2000000000.0], N[(2.0 / t), $MachinePrecision], N[(x / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -200:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 10^{-242}:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq 2000000000:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -200 or 2e9 < (/.f64 x y) Initial program 79.9%
Taylor expanded in x around inf 73.2%
if -200 < (/.f64 x y) < 1e-242Initial program 86.5%
Taylor expanded in z around inf 65.7%
div-sub65.7%
sub-neg65.7%
*-inverses65.7%
metadata-eval65.7%
Simplified65.7%
Taylor expanded in x around 0 64.5%
sub-neg64.5%
metadata-eval64.5%
distribute-lft-in64.5%
metadata-eval64.5%
associate-*r/64.5%
metadata-eval64.5%
Simplified64.5%
Taylor expanded in t around inf 42.2%
if 1e-242 < (/.f64 x y) < 2e9Initial program 91.4%
Taylor expanded in z around inf 52.0%
div-sub52.1%
sub-neg52.1%
*-inverses52.1%
metadata-eval52.1%
Simplified52.1%
Taylor expanded in t around 0 35.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.2e+14) (not (<= t 1.0))) (+ (/ x y) (- -2.0 (/ -2.0 (* z t)))) (+ (/ x y) (/ (+ 2.0 (* 2.0 z)) (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.2e+14) || !(t <= 1.0)) {
tmp = (x / y) + (-2.0 - (-2.0 / (z * t)));
} else {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (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 <= (-3.2d+14)) .or. (.not. (t <= 1.0d0))) then
tmp = (x / y) + ((-2.0d0) - ((-2.0d0) / (z * t)))
else
tmp = (x / y) + ((2.0d0 + (2.0d0 * z)) / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.2e+14) || !(t <= 1.0)) {
tmp = (x / y) + (-2.0 - (-2.0 / (z * t)));
} else {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.2e+14) or not (t <= 1.0): tmp = (x / y) + (-2.0 - (-2.0 / (z * t))) else: tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.2e+14) || !(t <= 1.0)) tmp = Float64(Float64(x / y) + Float64(-2.0 - Float64(-2.0 / Float64(z * t)))); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(2.0 * z)) / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -3.2e+14) || ~((t <= 1.0))) tmp = (x / y) + (-2.0 - (-2.0 / (z * t))); else tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.2e+14], N[Not[LessEqual[t, 1.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 - N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(2.0 * z), $MachinePrecision]), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+14} \lor \neg \left(t \leq 1\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 - \frac{-2}{z \cdot t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{2 + 2 \cdot z}{z \cdot t}\\
\end{array}
\end{array}
if t < -3.2e14 or 1 < t Initial program 71.6%
Taylor expanded in t around 0 80.2%
associate-+r+80.2%
associate-*r/80.2%
metadata-eval80.2%
sub-neg80.2%
metadata-eval80.2%
Simplified80.2%
Taylor expanded in z around 0 90.7%
Taylor expanded in t around inf 90.2%
Taylor expanded in z around inf 99.4%
sub-neg99.4%
+-commutative99.4%
associate-*r/99.4%
metadata-eval99.4%
*-commutative99.4%
metadata-eval99.4%
associate-+l+99.4%
+-commutative99.4%
associate-/r*99.4%
remove-double-neg99.4%
distribute-neg-frac299.4%
unsub-neg99.4%
distribute-frac-neg299.4%
distribute-neg-frac99.4%
distribute-neg-frac99.4%
metadata-eval99.4%
associate-/l/99.4%
Simplified99.4%
if -3.2e14 < t < 1Initial program 97.3%
Taylor expanded in t around 0 96.8%
Final simplification98.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -1.15e-55)
t_1
(if (<= t 2.5e-225)
(/ (/ 2.0 t) z)
(if (<= t 1.0) (+ (/ x y) (/ 2.0 t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -1.15e-55) {
tmp = t_1;
} else if (t <= 2.5e-225) {
tmp = (2.0 / t) / z;
} else if (t <= 1.0) {
tmp = (x / y) + (2.0 / 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 <= (-1.15d-55)) then
tmp = t_1
else if (t <= 2.5d-225) then
tmp = (2.0d0 / t) / z
else if (t <= 1.0d0) then
tmp = (x / y) + (2.0d0 / 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 <= -1.15e-55) {
tmp = t_1;
} else if (t <= 2.5e-225) {
tmp = (2.0 / t) / z;
} else if (t <= 1.0) {
tmp = (x / y) + (2.0 / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if t <= -1.15e-55: tmp = t_1 elif t <= 2.5e-225: tmp = (2.0 / t) / z elif t <= 1.0: tmp = (x / y) + (2.0 / 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 <= -1.15e-55) tmp = t_1; elseif (t <= 2.5e-225) tmp = Float64(Float64(2.0 / t) / z); elseif (t <= 1.0) tmp = Float64(Float64(x / y) + Float64(2.0 / 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 <= -1.15e-55) tmp = t_1; elseif (t <= 2.5e-225) tmp = (2.0 / t) / z; elseif (t <= 1.0) tmp = (x / y) + (2.0 / 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, -1.15e-55], t$95$1, If[LessEqual[t, 2.5e-225], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 1.0], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -1.15 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-225}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{elif}\;t \leq 1:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.15000000000000006e-55 or 1 < t Initial program 74.1%
Taylor expanded in t around inf 85.2%
if -1.15000000000000006e-55 < t < 2.5e-225Initial program 95.2%
Taylor expanded in t around 0 95.3%
associate-+r+95.3%
associate-*r/95.3%
metadata-eval95.3%
sub-neg95.3%
metadata-eval95.3%
Simplified95.3%
Taylor expanded in z around 0 71.3%
Taylor expanded in z around 0 58.1%
associate-/r*58.2%
Simplified58.2%
if 2.5e-225 < t < 1Initial program 99.6%
Taylor expanded in z around inf 66.9%
div-sub67.0%
sub-neg67.0%
*-inverses67.0%
metadata-eval67.0%
Simplified67.0%
Taylor expanded in y around 0 47.6%
*-commutative47.6%
*-inverses47.6%
div-sub47.5%
associate-*r*47.5%
*-commutative47.5%
div-sub47.6%
*-inverses47.6%
sub-neg47.6%
metadata-eval47.6%
distribute-lft-in47.6%
associate-*r/47.6%
metadata-eval47.6%
metadata-eval47.6%
Simplified47.6%
Taylor expanded in t around 0 46.5%
associate-*r/46.5%
associate-*l/46.5%
*-commutative46.5%
Simplified46.5%
Taylor expanded in x around 0 65.7%
associate-*r/65.7%
metadata-eval65.7%
+-commutative65.7%
Simplified65.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -29000000000.0) (not (<= z 8.2e-21))) (+ (/ 2.0 t) (+ (/ x y) -2.0)) (+ (/ x y) (- -2.0 (/ -2.0 (* z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -29000000000.0) || !(z <= 8.2e-21)) {
tmp = (2.0 / t) + ((x / y) + -2.0);
} else {
tmp = (x / y) + (-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 <= (-29000000000.0d0)) .or. (.not. (z <= 8.2d-21))) then
tmp = (2.0d0 / t) + ((x / y) + (-2.0d0))
else
tmp = (x / y) + ((-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 <= -29000000000.0) || !(z <= 8.2e-21)) {
tmp = (2.0 / t) + ((x / y) + -2.0);
} else {
tmp = (x / y) + (-2.0 - (-2.0 / (z * t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -29000000000.0) or not (z <= 8.2e-21): tmp = (2.0 / t) + ((x / y) + -2.0) else: tmp = (x / y) + (-2.0 - (-2.0 / (z * t))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -29000000000.0) || !(z <= 8.2e-21)) tmp = Float64(Float64(2.0 / t) + Float64(Float64(x / y) + -2.0)); else tmp = Float64(Float64(x / y) + Float64(-2.0 - Float64(-2.0 / Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -29000000000.0) || ~((z <= 8.2e-21))) tmp = (2.0 / t) + ((x / y) + -2.0); else tmp = (x / y) + (-2.0 - (-2.0 / (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -29000000000.0], N[Not[LessEqual[z, 8.2e-21]], $MachinePrecision]], N[(N[(2.0 / t), $MachinePrecision] + N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(-2.0 - N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -29000000000 \lor \neg \left(z \leq 8.2 \cdot 10^{-21}\right):\\
\;\;\;\;\frac{2}{t} + \left(\frac{x}{y} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \left(-2 - \frac{-2}{z \cdot t}\right)\\
\end{array}
\end{array}
if z < -2.9e10 or 8.19999999999999988e-21 < z Initial program 72.5%
Taylor expanded in z around inf 99.5%
div-sub99.5%
sub-neg99.5%
*-inverses99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 99.5%
sub-neg99.5%
metadata-eval99.5%
distribute-lft-in99.5%
metadata-eval99.5%
associate-+r+99.5%
+-commutative99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
if -2.9e10 < z < 8.19999999999999988e-21Initial program 97.2%
Taylor expanded in t around 0 87.6%
associate-+r+87.6%
associate-*r/87.6%
metadata-eval87.6%
sub-neg87.6%
metadata-eval87.6%
Simplified87.6%
Taylor expanded in z around 0 97.3%
Taylor expanded in t around inf 96.1%
Taylor expanded in z around inf 96.0%
sub-neg96.0%
+-commutative96.0%
associate-*r/96.0%
metadata-eval96.0%
*-commutative96.0%
metadata-eval96.0%
associate-+l+96.0%
+-commutative96.0%
associate-/r*96.0%
remove-double-neg96.0%
distribute-neg-frac296.0%
unsub-neg96.0%
distribute-frac-neg296.0%
distribute-neg-frac96.0%
distribute-neg-frac96.0%
metadata-eval96.0%
associate-/l/96.0%
Simplified96.0%
Final simplification97.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -2.1e-55)
t_1
(if (<= t 4.8e-225)
(/ (/ 2.0 t) z)
(if (<= t 65.0) (+ (/ 2.0 t) -2.0) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -2.1e-55) {
tmp = t_1;
} else if (t <= 4.8e-225) {
tmp = (2.0 / t) / z;
} else if (t <= 65.0) {
tmp = (2.0 / t) + -2.0;
} 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.1d-55)) then
tmp = t_1
else if (t <= 4.8d-225) then
tmp = (2.0d0 / t) / z
else if (t <= 65.0d0) then
tmp = (2.0d0 / t) + (-2.0d0)
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.1e-55) {
tmp = t_1;
} else if (t <= 4.8e-225) {
tmp = (2.0 / t) / z;
} else if (t <= 65.0) {
tmp = (2.0 / t) + -2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if t <= -2.1e-55: tmp = t_1 elif t <= 4.8e-225: tmp = (2.0 / t) / z elif t <= 65.0: tmp = (2.0 / t) + -2.0 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.1e-55) tmp = t_1; elseif (t <= 4.8e-225) tmp = Float64(Float64(2.0 / t) / z); elseif (t <= 65.0) tmp = Float64(Float64(2.0 / t) + -2.0); 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.1e-55) tmp = t_1; elseif (t <= 4.8e-225) tmp = (2.0 / t) / z; elseif (t <= 65.0) tmp = (2.0 / t) + -2.0; 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.1e-55], t$95$1, If[LessEqual[t, 4.8e-225], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 65.0], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-225}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{elif}\;t \leq 65:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.1000000000000002e-55 or 65 < t Initial program 73.9%
Taylor expanded in t around inf 85.6%
if -2.1000000000000002e-55 < t < 4.79999999999999992e-225Initial program 95.2%
Taylor expanded in t around 0 95.3%
associate-+r+95.3%
associate-*r/95.3%
metadata-eval95.3%
sub-neg95.3%
metadata-eval95.3%
Simplified95.3%
Taylor expanded in z around 0 71.3%
Taylor expanded in z around 0 58.1%
associate-/r*58.2%
Simplified58.2%
if 4.79999999999999992e-225 < t < 65Initial program 99.6%
Taylor expanded in z around inf 67.7%
div-sub67.7%
sub-neg67.7%
*-inverses67.7%
metadata-eval67.7%
Simplified67.7%
Taylor expanded in x around 0 48.4%
sub-neg48.4%
metadata-eval48.4%
distribute-lft-in48.4%
metadata-eval48.4%
associate-*r/48.4%
metadata-eval48.4%
Simplified48.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -2.4e-60)
t_1
(if (<= t 1.1e-221)
(/ 2.0 (* z t))
(if (<= t 65.0) (+ (/ 2.0 t) -2.0) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -2.4e-60) {
tmp = t_1;
} else if (t <= 1.1e-221) {
tmp = 2.0 / (z * t);
} else if (t <= 65.0) {
tmp = (2.0 / t) + -2.0;
} 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.4d-60)) then
tmp = t_1
else if (t <= 1.1d-221) then
tmp = 2.0d0 / (z * t)
else if (t <= 65.0d0) then
tmp = (2.0d0 / t) + (-2.0d0)
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.4e-60) {
tmp = t_1;
} else if (t <= 1.1e-221) {
tmp = 2.0 / (z * t);
} else if (t <= 65.0) {
tmp = (2.0 / t) + -2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if t <= -2.4e-60: tmp = t_1 elif t <= 1.1e-221: tmp = 2.0 / (z * t) elif t <= 65.0: tmp = (2.0 / t) + -2.0 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.4e-60) tmp = t_1; elseif (t <= 1.1e-221) tmp = Float64(2.0 / Float64(z * t)); elseif (t <= 65.0) tmp = Float64(Float64(2.0 / t) + -2.0); 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.4e-60) tmp = t_1; elseif (t <= 1.1e-221) tmp = 2.0 / (z * t); elseif (t <= 65.0) tmp = (2.0 / t) + -2.0; 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.4e-60], t$95$1, If[LessEqual[t, 1.1e-221], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 65.0], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -2.4 \cdot 10^{-60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{-221}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{elif}\;t \leq 65:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.40000000000000009e-60 or 65 < t Initial program 73.9%
Taylor expanded in t around inf 85.6%
if -2.40000000000000009e-60 < t < 1.10000000000000001e-221Initial program 95.2%
Taylor expanded in z around 0 58.1%
if 1.10000000000000001e-221 < t < 65Initial program 99.6%
Taylor expanded in z around inf 67.7%
div-sub67.7%
sub-neg67.7%
*-inverses67.7%
metadata-eval67.7%
Simplified67.7%
Taylor expanded in x around 0 48.4%
sub-neg48.4%
metadata-eval48.4%
distribute-lft-in48.4%
metadata-eval48.4%
associate-*r/48.4%
metadata-eval48.4%
Simplified48.4%
Final simplification72.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.45e-61) (not (<= t 3.9e-57))) (+ (/ 2.0 t) (+ (/ 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.45e-61) || !(t <= 3.9e-57)) {
tmp = (2.0 / t) + ((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.45d-61)) .or. (.not. (t <= 3.9d-57))) then
tmp = (2.0d0 / t) + ((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.45e-61) || !(t <= 3.9e-57)) {
tmp = (2.0 / t) + ((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.45e-61) or not (t <= 3.9e-57): tmp = (2.0 / t) + ((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.45e-61) || !(t <= 3.9e-57)) tmp = Float64(Float64(2.0 / t) + 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.45e-61) || ~((t <= 3.9e-57))) tmp = (2.0 / t) + ((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.45e-61], N[Not[LessEqual[t, 3.9e-57]], $MachinePrecision]], N[(N[(2.0 / t), $MachinePrecision] + N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{-61} \lor \neg \left(t \leq 3.9 \cdot 10^{-57}\right):\\
\;\;\;\;\frac{2}{t} + \left(\frac{x}{y} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -1.45e-61 or 3.90000000000000006e-57 < t Initial program 75.7%
Taylor expanded in z around inf 87.1%
div-sub87.2%
sub-neg87.2%
*-inverses87.2%
metadata-eval87.2%
Simplified87.2%
Taylor expanded in x around 0 87.2%
sub-neg87.2%
metadata-eval87.2%
distribute-lft-in87.2%
metadata-eval87.2%
associate-+r+87.2%
+-commutative87.2%
associate-*r/87.2%
metadata-eval87.2%
Simplified87.2%
if -1.45e-61 < t < 3.90000000000000006e-57Initial program 96.7%
Taylor expanded in t around 0 89.1%
associate-*r/89.1%
metadata-eval89.1%
Simplified89.1%
Final simplification87.9%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2e-31) (not (<= (/ x y) 2000000000.0))) (- (/ x y) 2.0) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2e-31) || !((x / y) <= 2000000000.0)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 / t) + -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) <= (-2d-31)) .or. (.not. ((x / y) <= 2000000000.0d0))) then
tmp = (x / y) - 2.0d0
else
tmp = (2.0d0 / t) + (-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) <= -2e-31) || !((x / y) <= 2000000000.0)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2e-31) or not ((x / y) <= 2000000000.0): tmp = (x / y) - 2.0 else: tmp = (2.0 / t) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2e-31) || !(Float64(x / y) <= 2000000000.0)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(Float64(2.0 / t) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2e-31) || ~(((x / y) <= 2000000000.0))) tmp = (x / y) - 2.0; else tmp = (2.0 / t) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2e-31], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2000000000.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{-31} \lor \neg \left(\frac{x}{y} \leq 2000000000\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -2e-31 or 2e9 < (/.f64 x y) Initial program 79.3%
Taylor expanded in t around inf 74.9%
if -2e-31 < (/.f64 x y) < 2e9Initial program 88.9%
Taylor expanded in z around inf 60.7%
div-sub60.7%
sub-neg60.7%
*-inverses60.7%
metadata-eval60.7%
Simplified60.7%
Taylor expanded in x around 0 60.7%
sub-neg60.7%
metadata-eval60.7%
distribute-lft-in60.7%
metadata-eval60.7%
associate-*r/60.7%
metadata-eval60.7%
Simplified60.7%
Final simplification68.2%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -5e+43) (not (<= (/ x y) 2000000000.0))) (/ x y) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5e+43) || !((x / y) <= 2000000000.0)) {
tmp = x / y;
} else {
tmp = (2.0 / t) + -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) <= (-5d+43)) .or. (.not. ((x / y) <= 2000000000.0d0))) then
tmp = x / y
else
tmp = (2.0d0 / t) + (-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) <= -5e+43) || !((x / y) <= 2000000000.0)) {
tmp = x / y;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -5e+43) or not ((x / y) <= 2000000000.0): tmp = x / y else: tmp = (2.0 / t) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -5e+43) || !(Float64(x / y) <= 2000000000.0)) tmp = Float64(x / y); else tmp = Float64(Float64(2.0 / t) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -5e+43) || ~(((x / y) <= 2000000000.0))) tmp = x / y; else tmp = (2.0 / t) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -5e+43], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2000000000.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+43} \lor \neg \left(\frac{x}{y} \leq 2000000000\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -5.0000000000000004e43 or 2e9 < (/.f64 x y) Initial program 80.5%
Taylor expanded in x around inf 75.7%
if -5.0000000000000004e43 < (/.f64 x y) < 2e9Initial program 86.9%
Taylor expanded in z around inf 62.8%
div-sub62.8%
sub-neg62.8%
*-inverses62.8%
metadata-eval62.8%
Simplified62.8%
Taylor expanded in x around 0 59.9%
sub-neg59.9%
metadata-eval59.9%
distribute-lft-in59.9%
metadata-eval59.9%
associate-*r/59.9%
metadata-eval59.9%
Simplified59.9%
Final simplification67.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2e-55) (not (<= t 0.0048))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2e-55) || !(t <= 0.0048)) {
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 <= (-2d-55)) .or. (.not. (t <= 0.0048d0))) 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 <= -2e-55) || !(t <= 0.0048)) {
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 <= -2e-55) or not (t <= 0.0048): 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 <= -2e-55) || !(t <= 0.0048)) 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 <= -2e-55) || ~((t <= 0.0048))) 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, -2e-55], N[Not[LessEqual[t, 0.0048]], $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 -2 \cdot 10^{-55} \lor \neg \left(t \leq 0.0048\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -1.99999999999999999e-55 or 0.00479999999999999958 < t Initial program 74.1%
Taylor expanded in t around inf 85.2%
if -1.99999999999999999e-55 < t < 0.00479999999999999958Initial program 97.0%
Taylor expanded in t around 0 86.1%
associate-*r/86.1%
metadata-eval86.1%
Simplified86.1%
Final simplification85.5%
(FPCore (x y z t) :precision binary64 (if (<= t -3.2e+14) -2.0 (if (<= t 1.4e-5) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.2e+14) {
tmp = -2.0;
} else if (t <= 1.4e-5) {
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 <= (-3.2d+14)) then
tmp = -2.0d0
else if (t <= 1.4d-5) 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 <= -3.2e+14) {
tmp = -2.0;
} else if (t <= 1.4e-5) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.2e+14: tmp = -2.0 elif t <= 1.4e-5: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.2e+14) tmp = -2.0; elseif (t <= 1.4e-5) 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 <= -3.2e+14) tmp = -2.0; elseif (t <= 1.4e-5) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.2e+14], -2.0, If[LessEqual[t, 1.4e-5], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+14}:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-5}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -3.2e14 or 1.39999999999999998e-5 < t Initial program 71.6%
Taylor expanded in z around inf 87.8%
div-sub87.8%
sub-neg87.8%
*-inverses87.8%
metadata-eval87.8%
Simplified87.8%
Taylor expanded in x around 0 34.2%
sub-neg34.2%
metadata-eval34.2%
distribute-lft-in34.2%
metadata-eval34.2%
associate-*r/34.2%
metadata-eval34.2%
Simplified34.2%
Taylor expanded in t around inf 33.6%
if -3.2e14 < t < 1.39999999999999998e-5Initial program 97.3%
Taylor expanded in z around inf 56.1%
div-sub56.1%
sub-neg56.1%
*-inverses56.1%
metadata-eval56.1%
Simplified56.1%
Taylor expanded in t around 0 36.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 83.8%
Taylor expanded in z around inf 72.7%
div-sub72.7%
sub-neg72.7%
*-inverses72.7%
metadata-eval72.7%
Simplified72.7%
Taylor expanded in x around 0 35.6%
sub-neg35.6%
metadata-eval35.6%
distribute-lft-in35.6%
metadata-eval35.6%
associate-*r/35.6%
metadata-eval35.6%
Simplified35.6%
Taylor expanded in t around inf 18.8%
(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 2024180
(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))))