
(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 (+ (/ x y) (+ (/ 2.0 (* t z)) (- (/ 2.0 t) 2.0))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 / (t * z)) + ((2.0 / t) - 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 = (x / y) + ((2.0d0 / (t * z)) + ((2.0d0 / t) - 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 / (t * z)) + ((2.0 / t) - 2.0));
}
def code(x, y, z, t): return (x / y) + ((2.0 / (t * z)) + ((2.0 / t) - 2.0))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 / Float64(t * z)) + Float64(Float64(2.0 / t) - 2.0))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 / (t * z)) + ((2.0 / t) - 2.0)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(\frac{2}{t \cdot z} + \left(\frac{2}{t} - 2\right)\right)
\end{array}
Initial program 90.9%
Taylor expanded in t around 0 98.7%
associate--l+98.7%
associate-*r/98.7%
metadata-eval98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -11500000.0)
(/ x y)
(if (<= (/ x y) -1.25e-172)
-2.0
(if (<= (/ x y) -1e-310)
(/ 2.0 t)
(if (<= (/ x y) 5.2e-46) -2.0 (/ x y))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -11500000.0) {
tmp = x / y;
} else if ((x / y) <= -1.25e-172) {
tmp = -2.0;
} else if ((x / y) <= -1e-310) {
tmp = 2.0 / t;
} else if ((x / y) <= 5.2e-46) {
tmp = -2.0;
} 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) <= (-11500000.0d0)) then
tmp = x / y
else if ((x / y) <= (-1.25d-172)) then
tmp = -2.0d0
else if ((x / y) <= (-1d-310)) then
tmp = 2.0d0 / t
else if ((x / y) <= 5.2d-46) then
tmp = -2.0d0
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) <= -11500000.0) {
tmp = x / y;
} else if ((x / y) <= -1.25e-172) {
tmp = -2.0;
} else if ((x / y) <= -1e-310) {
tmp = 2.0 / t;
} else if ((x / y) <= 5.2e-46) {
tmp = -2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -11500000.0: tmp = x / y elif (x / y) <= -1.25e-172: tmp = -2.0 elif (x / y) <= -1e-310: tmp = 2.0 / t elif (x / y) <= 5.2e-46: tmp = -2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -11500000.0) tmp = Float64(x / y); elseif (Float64(x / y) <= -1.25e-172) tmp = -2.0; elseif (Float64(x / y) <= -1e-310) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 5.2e-46) tmp = -2.0; else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -11500000.0) tmp = x / y; elseif ((x / y) <= -1.25e-172) tmp = -2.0; elseif ((x / y) <= -1e-310) tmp = 2.0 / t; elseif ((x / y) <= 5.2e-46) tmp = -2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -11500000.0], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -1.25e-172], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], -1e-310], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5.2e-46], -2.0, N[(x / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -11500000:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -1.25 \cdot 10^{-172}:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 5.2 \cdot 10^{-46}:\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.15e7 or 5.2000000000000004e-46 < (/.f64 x y) Initial program 91.2%
Taylor expanded in x around inf 65.4%
if -1.15e7 < (/.f64 x y) < -1.25e-172 or -9.999999999999969e-311 < (/.f64 x y) < 5.2000000000000004e-46Initial program 89.3%
Taylor expanded in z around inf 72.3%
+-commutative72.3%
associate-*r/72.3%
Simplified72.3%
Taylor expanded in x around 0 71.0%
associate-*r/71.0%
associate-*l/71.0%
Simplified71.0%
Taylor expanded in t around inf 47.0%
if -1.25e-172 < (/.f64 x y) < -9.999999999999969e-311Initial program 99.9%
Taylor expanded in t around 0 88.8%
associate-*r/88.8%
metadata-eval88.8%
Simplified88.8%
Taylor expanded in z around inf 42.4%
Final simplification55.9%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -100000000000.0) (not (<= (/ x y) 5e+26))) (+ (/ x y) (/ (/ 2.0 z) t)) (+ (/ (/ 2.0 t) z) (+ (/ 2.0 t) -2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -100000000000.0) || !((x / y) <= 5e+26)) {
tmp = (x / y) + ((2.0 / z) / t);
} else {
tmp = ((2.0 / t) / z) + ((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) <= (-100000000000.0d0)) .or. (.not. ((x / y) <= 5d+26))) then
tmp = (x / y) + ((2.0d0 / z) / t)
else
tmp = ((2.0d0 / t) / z) + ((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) <= -100000000000.0) || !((x / y) <= 5e+26)) {
tmp = (x / y) + ((2.0 / z) / t);
} else {
tmp = ((2.0 / t) / z) + ((2.0 / t) + -2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -100000000000.0) or not ((x / y) <= 5e+26): tmp = (x / y) + ((2.0 / z) / t) else: tmp = ((2.0 / t) / z) + ((2.0 / t) + -2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -100000000000.0) || !(Float64(x / y) <= 5e+26)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / z) / t)); else tmp = Float64(Float64(Float64(2.0 / t) / z) + 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) <= -100000000000.0) || ~(((x / y) <= 5e+26))) tmp = (x / y) + ((2.0 / z) / t); else tmp = ((2.0 / t) / z) + ((2.0 / t) + -2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -100000000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 5e+26]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -100000000000 \lor \neg \left(\frac{x}{y} \leq 5 \cdot 10^{+26}\right):\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{t}}{z} + \left(\frac{2}{t} + -2\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -1e11 or 5.0000000000000001e26 < (/.f64 x y) Initial program 90.6%
Taylor expanded in z around 0 90.5%
Taylor expanded in x around 0 90.5%
+-commutative90.5%
associate-*r/90.5%
metadata-eval90.5%
*-commutative90.5%
associate-/r*90.6%
Simplified90.6%
if -1e11 < (/.f64 x y) < 5.0000000000000001e26Initial program 91.1%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 98.9%
associate-*r/98.9%
metadata-eval98.9%
+-commutative98.9%
associate--l+98.9%
associate-/r*98.9%
sub-neg98.9%
associate-*r/98.9%
metadata-eval98.9%
metadata-eval98.9%
Simplified98.9%
Final simplification95.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (/ 2.0 (* t z)))) (t_2 (+ (/ x y) (+ (/ 2.0 t) -2.0))))
(if (<= z -680.0)
t_2
(if (<= z -1.25e-130)
t_1
(if (<= z -1.5e-157) (- (/ x y) 2.0) (if (<= z 4.4e-67) 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 / t) + -2.0);
double tmp;
if (z <= -680.0) {
tmp = t_2;
} else if (z <= -1.25e-130) {
tmp = t_1;
} else if (z <= -1.5e-157) {
tmp = (x / y) - 2.0;
} else if (z <= 4.4e-67) {
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 / t) + (-2.0d0))
if (z <= (-680.0d0)) then
tmp = t_2
else if (z <= (-1.25d-130)) then
tmp = t_1
else if (z <= (-1.5d-157)) then
tmp = (x / y) - 2.0d0
else if (z <= 4.4d-67) 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 / t) + -2.0);
double tmp;
if (z <= -680.0) {
tmp = t_2;
} else if (z <= -1.25e-130) {
tmp = t_1;
} else if (z <= -1.5e-157) {
tmp = (x / y) - 2.0;
} else if (z <= 4.4e-67) {
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 / t) + -2.0) tmp = 0 if z <= -680.0: tmp = t_2 elif z <= -1.25e-130: tmp = t_1 elif z <= -1.5e-157: tmp = (x / y) - 2.0 elif z <= 4.4e-67: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(2.0 / Float64(t * z))) t_2 = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)) tmp = 0.0 if (z <= -680.0) tmp = t_2; elseif (z <= -1.25e-130) tmp = t_1; elseif (z <= -1.5e-157) tmp = Float64(Float64(x / y) - 2.0); elseif (z <= 4.4e-67) 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 / t) + -2.0); tmp = 0.0; if (z <= -680.0) tmp = t_2; elseif (z <= -1.25e-130) tmp = t_1; elseif (z <= -1.5e-157) tmp = (x / y) - 2.0; elseif (z <= 4.4e-67) 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[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -680.0], t$95$2, If[LessEqual[z, -1.25e-130], t$95$1, If[LessEqual[z, -1.5e-157], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], If[LessEqual[z, 4.4e-67], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2}{t \cdot z}\\
t_2 := \frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{if}\;z \leq -680:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-130}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-157}:\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-67}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -680 or 4.4000000000000002e-67 < z Initial program 85.3%
Taylor expanded in t around 0 100.0%
associate--l+100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 95.0%
associate--l+95.0%
sub-neg95.0%
associate-*r/95.0%
metadata-eval95.0%
metadata-eval95.0%
Simplified95.0%
if -680 < z < -1.2499999999999999e-130 or -1.5e-157 < z < 4.4000000000000002e-67Initial program 97.0%
Taylor expanded in z around 0 85.7%
if -1.2499999999999999e-130 < z < -1.5e-157Initial program 100.0%
Taylor expanded in t around inf 84.0%
Final simplification90.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (+ (/ 2.0 t) -2.0))))
(if (<= z -680.0)
t_1
(if (<= z -1.25e-130)
(+ (/ x y) (/ (/ 2.0 z) t))
(if (<= z -1.5e-157)
(- (/ x y) 2.0)
(if (<= z 4e-67) (+ (/ x y) (/ 2.0 (* t z))) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + ((2.0 / t) + -2.0);
double tmp;
if (z <= -680.0) {
tmp = t_1;
} else if (z <= -1.25e-130) {
tmp = (x / y) + ((2.0 / z) / t);
} else if (z <= -1.5e-157) {
tmp = (x / y) - 2.0;
} else if (z <= 4e-67) {
tmp = (x / y) + (2.0 / (t * z));
} 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 / t) + (-2.0d0))
if (z <= (-680.0d0)) then
tmp = t_1
else if (z <= (-1.25d-130)) then
tmp = (x / y) + ((2.0d0 / z) / t)
else if (z <= (-1.5d-157)) then
tmp = (x / y) - 2.0d0
else if (z <= 4d-67) then
tmp = (x / y) + (2.0d0 / (t * z))
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 / t) + -2.0);
double tmp;
if (z <= -680.0) {
tmp = t_1;
} else if (z <= -1.25e-130) {
tmp = (x / y) + ((2.0 / z) / t);
} else if (z <= -1.5e-157) {
tmp = (x / y) - 2.0;
} else if (z <= 4e-67) {
tmp = (x / y) + (2.0 / (t * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + ((2.0 / t) + -2.0) tmp = 0 if z <= -680.0: tmp = t_1 elif z <= -1.25e-130: tmp = (x / y) + ((2.0 / z) / t) elif z <= -1.5e-157: tmp = (x / y) - 2.0 elif z <= 4e-67: tmp = (x / y) + (2.0 / (t * z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)) tmp = 0.0 if (z <= -680.0) tmp = t_1; elseif (z <= -1.25e-130) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / z) / t)); elseif (z <= -1.5e-157) tmp = Float64(Float64(x / y) - 2.0); elseif (z <= 4e-67) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(t * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + ((2.0 / t) + -2.0); tmp = 0.0; if (z <= -680.0) tmp = t_1; elseif (z <= -1.25e-130) tmp = (x / y) + ((2.0 / z) / t); elseif (z <= -1.5e-157) tmp = (x / y) - 2.0; elseif (z <= 4e-67) tmp = (x / y) + (2.0 / (t * z)); else tmp = t_1; 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] + -2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -680.0], t$95$1, If[LessEqual[z, -1.25e-130], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.5e-157], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], If[LessEqual[z, 4e-67], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{if}\;z \leq -680:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-130}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{z}}{t}\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-157}:\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-67}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -680 or 3.99999999999999977e-67 < z Initial program 85.3%
Taylor expanded in t around 0 100.0%
associate--l+100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 95.0%
associate--l+95.0%
sub-neg95.0%
associate-*r/95.0%
metadata-eval95.0%
metadata-eval95.0%
Simplified95.0%
if -680 < z < -1.2499999999999999e-130Initial program 99.7%
Taylor expanded in z around 0 82.9%
Taylor expanded in x around 0 82.9%
+-commutative82.9%
associate-*r/82.9%
metadata-eval82.9%
*-commutative82.9%
associate-/r*82.9%
Simplified82.9%
if -1.2499999999999999e-130 < z < -1.5e-157Initial program 100.0%
Taylor expanded in t around inf 84.0%
if -1.5e-157 < z < 3.99999999999999977e-67Initial program 95.9%
Taylor expanded in z around 0 86.8%
Final simplification90.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 2.0 (* t z))) (t_2 (- (/ x y) 2.0)))
(if (<= t -1.4e-29)
t_2
(if (<= t -8e-295)
t_1
(if (<= t 5e-140) (/ 2.0 t) (if (<= t 1.1e-53) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 / (t * z);
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -1.4e-29) {
tmp = t_2;
} else if (t <= -8e-295) {
tmp = t_1;
} else if (t <= 5e-140) {
tmp = 2.0 / t;
} else if (t <= 1.1e-53) {
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 = 2.0d0 / (t * z)
t_2 = (x / y) - 2.0d0
if (t <= (-1.4d-29)) then
tmp = t_2
else if (t <= (-8d-295)) then
tmp = t_1
else if (t <= 5d-140) then
tmp = 2.0d0 / t
else if (t <= 1.1d-53) 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 = 2.0 / (t * z);
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -1.4e-29) {
tmp = t_2;
} else if (t <= -8e-295) {
tmp = t_1;
} else if (t <= 5e-140) {
tmp = 2.0 / t;
} else if (t <= 1.1e-53) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 / (t * z) t_2 = (x / y) - 2.0 tmp = 0 if t <= -1.4e-29: tmp = t_2 elif t <= -8e-295: tmp = t_1 elif t <= 5e-140: tmp = 2.0 / t elif t <= 1.1e-53: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 / Float64(t * z)) t_2 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -1.4e-29) tmp = t_2; elseif (t <= -8e-295) tmp = t_1; elseif (t <= 5e-140) tmp = Float64(2.0 / t); elseif (t <= 1.1e-53) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 / (t * z); t_2 = (x / y) - 2.0; tmp = 0.0; if (t <= -1.4e-29) tmp = t_2; elseif (t <= -8e-295) tmp = t_1; elseif (t <= 5e-140) tmp = 2.0 / t; elseif (t <= 1.1e-53) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -1.4e-29], t$95$2, If[LessEqual[t, -8e-295], t$95$1, If[LessEqual[t, 5e-140], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, 1.1e-53], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{t \cdot z}\\
t_2 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -1.4 \cdot 10^{-29}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -8 \cdot 10^{-295}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-140}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{-53}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -1.4000000000000001e-29 or 1.10000000000000009e-53 < t Initial program 85.8%
Taylor expanded in t around inf 82.9%
if -1.4000000000000001e-29 < t < -8.00000000000000048e-295 or 5.00000000000000015e-140 < t < 1.10000000000000009e-53Initial program 99.7%
Taylor expanded in t around 0 99.8%
associate--l+99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 57.8%
if -8.00000000000000048e-295 < t < 5.00000000000000015e-140Initial program 93.6%
Taylor expanded in t around 0 87.7%
associate-*r/87.7%
metadata-eval87.7%
Simplified87.7%
Taylor expanded in z around inf 50.7%
Final simplification70.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -1.05e-26)
t_1
(if (<= t -2.1e-295)
(/ (/ 2.0 t) z)
(if (<= t 3.9e-141)
(/ 2.0 t)
(if (<= t 1.4e-53) (/ 2.0 (* t z)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -1.05e-26) {
tmp = t_1;
} else if (t <= -2.1e-295) {
tmp = (2.0 / t) / z;
} else if (t <= 3.9e-141) {
tmp = 2.0 / t;
} else if (t <= 1.4e-53) {
tmp = 2.0 / (t * z);
} 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.05d-26)) then
tmp = t_1
else if (t <= (-2.1d-295)) then
tmp = (2.0d0 / t) / z
else if (t <= 3.9d-141) then
tmp = 2.0d0 / t
else if (t <= 1.4d-53) then
tmp = 2.0d0 / (t * z)
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.05e-26) {
tmp = t_1;
} else if (t <= -2.1e-295) {
tmp = (2.0 / t) / z;
} else if (t <= 3.9e-141) {
tmp = 2.0 / t;
} else if (t <= 1.4e-53) {
tmp = 2.0 / (t * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if t <= -1.05e-26: tmp = t_1 elif t <= -2.1e-295: tmp = (2.0 / t) / z elif t <= 3.9e-141: tmp = 2.0 / t elif t <= 1.4e-53: tmp = 2.0 / (t * z) 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.05e-26) tmp = t_1; elseif (t <= -2.1e-295) tmp = Float64(Float64(2.0 / t) / z); elseif (t <= 3.9e-141) tmp = Float64(2.0 / t); elseif (t <= 1.4e-53) tmp = Float64(2.0 / Float64(t * z)); 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.05e-26) tmp = t_1; elseif (t <= -2.1e-295) tmp = (2.0 / t) / z; elseif (t <= 3.9e-141) tmp = 2.0 / t; elseif (t <= 1.4e-53) tmp = 2.0 / (t * z); 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.05e-26], t$95$1, If[LessEqual[t, -2.1e-295], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 3.9e-141], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, 1.4e-53], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -1.05 \cdot 10^{-26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -2.1 \cdot 10^{-295}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{-141}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-53}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.05000000000000004e-26 or 1.39999999999999993e-53 < t Initial program 85.8%
Taylor expanded in t around inf 82.9%
if -1.05000000000000004e-26 < t < -2.09999999999999993e-295Initial program 99.7%
Taylor expanded in t around 0 99.8%
associate--l+99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 57.3%
associate-/r*57.3%
Simplified57.3%
if -2.09999999999999993e-295 < t < 3.8999999999999997e-141Initial program 93.6%
Taylor expanded in t around 0 87.7%
associate-*r/87.7%
metadata-eval87.7%
Simplified87.7%
Taylor expanded in z around inf 50.7%
if 3.8999999999999997e-141 < t < 1.39999999999999993e-53Initial program 99.8%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 59.0%
Final simplification70.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -0.00014) (not (<= (/ x y) 5.5e+26))) (- (/ x y) 2.0) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -0.00014) || !((x / y) <= 5.5e+26)) {
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) <= (-0.00014d0)) .or. (.not. ((x / y) <= 5.5d+26))) 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) <= -0.00014) || !((x / y) <= 5.5e+26)) {
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) <= -0.00014) or not ((x / y) <= 5.5e+26): 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) <= -0.00014) || !(Float64(x / y) <= 5.5e+26)) 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) <= -0.00014) || ~(((x / y) <= 5.5e+26))) 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], -0.00014], N[Not[LessEqual[N[(x / y), $MachinePrecision], 5.5e+26]], $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 -0.00014 \lor \neg \left(\frac{x}{y} \leq 5.5 \cdot 10^{+26}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -1.3999999999999999e-4 or 5.4999999999999997e26 < (/.f64 x y) Initial program 90.8%
Taylor expanded in t around inf 70.4%
if -1.3999999999999999e-4 < (/.f64 x y) < 5.4999999999999997e26Initial program 90.9%
Taylor expanded in z around inf 65.9%
+-commutative65.9%
associate-*r/65.9%
Simplified65.9%
Taylor expanded in x around 0 65.9%
associate-*r/65.9%
associate-*l/65.8%
Simplified65.8%
Taylor expanded in t around 0 65.9%
sub-neg65.9%
associate-*r/65.9%
metadata-eval65.9%
metadata-eval65.9%
Simplified65.9%
Final simplification68.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -260000000.0) (not (<= t 7.5e-30))) (- (/ x y) 2.0) (+ (/ 2.0 t) (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -260000000.0) || !(t <= 7.5e-30)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 / t) + ((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 ((t <= (-260000000.0d0)) .or. (.not. (t <= 7.5d-30))) then
tmp = (x / y) - 2.0d0
else
tmp = (2.0d0 / t) + ((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 ((t <= -260000000.0) || !(t <= 7.5e-30)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 / t) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -260000000.0) or not (t <= 7.5e-30): tmp = (x / y) - 2.0 else: tmp = (2.0 / t) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -260000000.0) || !(t <= 7.5e-30)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(Float64(2.0 / t) + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -260000000.0) || ~((t <= 7.5e-30))) tmp = (x / y) - 2.0; else tmp = (2.0 / t) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -260000000.0], N[Not[LessEqual[t, 7.5e-30]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -260000000 \lor \neg \left(t \leq 7.5 \cdot 10^{-30}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if t < -2.6e8 or 7.5000000000000006e-30 < t Initial program 84.9%
Taylor expanded in t around inf 85.4%
if -2.6e8 < t < 7.5000000000000006e-30Initial program 97.3%
Taylor expanded in t around 0 81.1%
associate-*r/81.1%
metadata-eval81.1%
Simplified81.1%
Taylor expanded in z around 0 81.1%
associate-*r/81.1%
metadata-eval81.1%
+-commutative81.1%
associate-*r/81.1%
metadata-eval81.1%
associate-/r*81.1%
Simplified81.1%
Final simplification83.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.2e-28) (not (<= t 5.6e-30))) (+ (/ x y) (+ (/ 2.0 t) -2.0)) (+ (/ 2.0 t) (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.2e-28) || !(t <= 5.6e-30)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (2.0 / t) + ((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 ((t <= (-3.2d-28)) .or. (.not. (t <= 5.6d-30))) then
tmp = (x / y) + ((2.0d0 / t) + (-2.0d0))
else
tmp = (2.0d0 / t) + ((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 ((t <= -3.2e-28) || !(t <= 5.6e-30)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (2.0 / t) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.2e-28) or not (t <= 5.6e-30): tmp = (x / y) + ((2.0 / t) + -2.0) else: tmp = (2.0 / t) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.2e-28) || !(t <= 5.6e-30)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); else tmp = Float64(Float64(2.0 / t) + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -3.2e-28) || ~((t <= 5.6e-30))) tmp = (x / y) + ((2.0 / t) + -2.0); else tmp = (2.0 / t) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.2e-28], N[Not[LessEqual[t, 5.6e-30]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{-28} \lor \neg \left(t \leq 5.6 \cdot 10^{-30}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if t < -3.19999999999999982e-28 or 5.59999999999999977e-30 < t Initial program 85.6%
Taylor expanded in t around 0 100.0%
associate--l+100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 87.4%
associate--l+87.4%
sub-neg87.4%
associate-*r/87.4%
metadata-eval87.4%
metadata-eval87.4%
Simplified87.4%
if -3.19999999999999982e-28 < t < 5.59999999999999977e-30Initial program 97.2%
Taylor expanded in t around 0 82.0%
associate-*r/82.0%
metadata-eval82.0%
Simplified82.0%
Taylor expanded in z around 0 82.0%
associate-*r/82.0%
metadata-eval82.0%
+-commutative82.0%
associate-*r/82.0%
metadata-eval82.0%
associate-/r*82.0%
Simplified82.0%
Final simplification84.9%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -106000000.0) (/ x y) (if (<= (/ x y) 3.1e+26) (+ (/ 2.0 t) -2.0) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -106000000.0) {
tmp = x / y;
} else if ((x / y) <= 3.1e+26) {
tmp = (2.0 / t) + -2.0;
} 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) <= (-106000000.0d0)) then
tmp = x / y
else if ((x / y) <= 3.1d+26) then
tmp = (2.0d0 / t) + (-2.0d0)
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) <= -106000000.0) {
tmp = x / y;
} else if ((x / y) <= 3.1e+26) {
tmp = (2.0 / t) + -2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -106000000.0: tmp = x / y elif (x / y) <= 3.1e+26: tmp = (2.0 / t) + -2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -106000000.0) tmp = Float64(x / y); elseif (Float64(x / y) <= 3.1e+26) tmp = Float64(Float64(2.0 / t) + -2.0); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -106000000.0) tmp = x / y; elseif ((x / y) <= 3.1e+26) tmp = (2.0 / t) + -2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -106000000.0], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 3.1e+26], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -106000000:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 3.1 \cdot 10^{+26}:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.06e8 or 3.1e26 < (/.f64 x y) Initial program 90.6%
Taylor expanded in x around inf 70.1%
if -1.06e8 < (/.f64 x y) < 3.1e26Initial program 91.1%
Taylor expanded in z around inf 66.7%
+-commutative66.7%
associate-*r/66.7%
Simplified66.7%
Taylor expanded in x around 0 65.6%
associate-*r/65.6%
associate-*l/65.6%
Simplified65.6%
Taylor expanded in t around 0 65.6%
sub-neg65.6%
associate-*r/65.6%
metadata-eval65.6%
metadata-eval65.6%
Simplified65.6%
Final simplification67.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -132000000.0) (not (<= t 5.8e-54))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -132000000.0) || !(t <= 5.8e-54)) {
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 <= (-132000000.0d0)) .or. (.not. (t <= 5.8d-54))) 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 <= -132000000.0) || !(t <= 5.8e-54)) {
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 <= -132000000.0) or not (t <= 5.8e-54): 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 <= -132000000.0) || !(t <= 5.8e-54)) 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 <= -132000000.0) || ~((t <= 5.8e-54))) 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, -132000000.0], N[Not[LessEqual[t, 5.8e-54]], $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 -132000000 \lor \neg \left(t \leq 5.8 \cdot 10^{-54}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -1.32e8 or 5.80000000000000029e-54 < t Initial program 85.1%
Taylor expanded in t around inf 84.9%
if -1.32e8 < t < 5.80000000000000029e-54Initial program 97.3%
Taylor expanded in t around 0 81.6%
associate-*r/81.6%
metadata-eval81.6%
Simplified81.6%
Final simplification83.3%
(FPCore (x y z t) :precision binary64 (if (<= t -9.5e-7) -2.0 (if (<= t 0.023) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -9.5e-7) {
tmp = -2.0;
} else if (t <= 0.023) {
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 <= (-9.5d-7)) then
tmp = -2.0d0
else if (t <= 0.023d0) 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 <= -9.5e-7) {
tmp = -2.0;
} else if (t <= 0.023) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -9.5e-7: tmp = -2.0 elif t <= 0.023: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -9.5e-7) tmp = -2.0; elseif (t <= 0.023) 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 <= -9.5e-7) tmp = -2.0; elseif (t <= 0.023) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -9.5e-7], -2.0, If[LessEqual[t, 0.023], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{-7}:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 0.023:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -9.5000000000000001e-7 or 0.023 < t Initial program 84.6%
Taylor expanded in z around inf 86.5%
+-commutative86.5%
associate-*r/86.5%
Simplified86.5%
Taylor expanded in x around 0 43.7%
associate-*r/43.7%
associate-*l/43.6%
Simplified43.6%
Taylor expanded in t around inf 42.7%
if -9.5000000000000001e-7 < t < 0.023Initial program 97.4%
Taylor expanded in t around 0 78.6%
associate-*r/78.6%
metadata-eval78.6%
Simplified78.6%
Taylor expanded in z around inf 34.0%
Final simplification38.4%
(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 90.9%
Taylor expanded in z around inf 71.3%
+-commutative71.3%
associate-*r/71.3%
Simplified71.3%
Taylor expanded in x around 0 39.4%
associate-*r/39.4%
associate-*l/39.3%
Simplified39.3%
Taylor expanded in t around inf 22.8%
Final simplification22.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 2023268
(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))))