
(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 (+ (/ 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(Float64(2.0 / 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[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(\frac{\frac{2}{t}}{z} + \left(\frac{2}{t} + -2\right)\right)
\end{array}
Initial program 84.6%
Taylor expanded in t around 0 99.5%
associate--l+99.5%
associate-*r/99.5%
metadata-eval99.5%
associate-/r*99.5%
metadata-eval99.5%
associate-*r/99.5%
sub-neg99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 2.0 (* t z))) (t_2 (- (/ x y) 2.0)))
(if (<= t -1.7e-6)
t_2
(if (<= t -1.3e-130)
t_1
(if (<= t -1.75e-158)
(/ 2.0 t)
(if (<= t -7.4e-283)
t_1
(if (<= t 6.8e-212)
(/ 2.0 t)
(if (<= t 6500000000.0) 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.7e-6) {
tmp = t_2;
} else if (t <= -1.3e-130) {
tmp = t_1;
} else if (t <= -1.75e-158) {
tmp = 2.0 / t;
} else if (t <= -7.4e-283) {
tmp = t_1;
} else if (t <= 6.8e-212) {
tmp = 2.0 / t;
} else if (t <= 6500000000.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 = 2.0d0 / (t * z)
t_2 = (x / y) - 2.0d0
if (t <= (-1.7d-6)) then
tmp = t_2
else if (t <= (-1.3d-130)) then
tmp = t_1
else if (t <= (-1.75d-158)) then
tmp = 2.0d0 / t
else if (t <= (-7.4d-283)) then
tmp = t_1
else if (t <= 6.8d-212) then
tmp = 2.0d0 / t
else if (t <= 6500000000.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 = 2.0 / (t * z);
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -1.7e-6) {
tmp = t_2;
} else if (t <= -1.3e-130) {
tmp = t_1;
} else if (t <= -1.75e-158) {
tmp = 2.0 / t;
} else if (t <= -7.4e-283) {
tmp = t_1;
} else if (t <= 6.8e-212) {
tmp = 2.0 / t;
} else if (t <= 6500000000.0) {
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.7e-6: tmp = t_2 elif t <= -1.3e-130: tmp = t_1 elif t <= -1.75e-158: tmp = 2.0 / t elif t <= -7.4e-283: tmp = t_1 elif t <= 6.8e-212: tmp = 2.0 / t elif t <= 6500000000.0: 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.7e-6) tmp = t_2; elseif (t <= -1.3e-130) tmp = t_1; elseif (t <= -1.75e-158) tmp = Float64(2.0 / t); elseif (t <= -7.4e-283) tmp = t_1; elseif (t <= 6.8e-212) tmp = Float64(2.0 / t); elseif (t <= 6500000000.0) 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.7e-6) tmp = t_2; elseif (t <= -1.3e-130) tmp = t_1; elseif (t <= -1.75e-158) tmp = 2.0 / t; elseif (t <= -7.4e-283) tmp = t_1; elseif (t <= 6.8e-212) tmp = 2.0 / t; elseif (t <= 6500000000.0) 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.7e-6], t$95$2, If[LessEqual[t, -1.3e-130], t$95$1, If[LessEqual[t, -1.75e-158], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, -7.4e-283], t$95$1, If[LessEqual[t, 6.8e-212], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, 6500000000.0], 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.7 \cdot 10^{-6}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.3 \cdot 10^{-130}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.75 \cdot 10^{-158}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;t \leq -7.4 \cdot 10^{-283}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{-212}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;t \leq 6500000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -1.70000000000000003e-6 or 6.5e9 < t Initial program 70.0%
Taylor expanded in t around inf 86.5%
if -1.70000000000000003e-6 < t < -1.3e-130 or -1.75000000000000006e-158 < t < -7.4000000000000001e-283 or 6.79999999999999995e-212 < t < 6.5e9Initial program 99.8%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
metadata-eval99.9%
associate-*r/99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 61.7%
if -1.3e-130 < t < -1.75000000000000006e-158 or -7.4000000000000001e-283 < t < 6.79999999999999995e-212Initial program 96.8%
Taylor expanded in t around 0 89.1%
associate-*r/89.1%
metadata-eval89.1%
Simplified89.1%
Taylor expanded in z around inf 67.0%
Final simplification74.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 2.0 (* t z))) (t_2 (- (/ x y) 2.0)))
(if (<= t -1.8e-5)
t_2
(if (<= t -2.1e-134)
t_1
(if (<= t -7e-159)
(/ 2.0 t)
(if (<= t -8.5e-286)
t_1
(if (<= t 3.5e-211)
(/ 2.0 t)
(if (<= t 7200000000.0) (/ (/ 2.0 t) z) 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.8e-5) {
tmp = t_2;
} else if (t <= -2.1e-134) {
tmp = t_1;
} else if (t <= -7e-159) {
tmp = 2.0 / t;
} else if (t <= -8.5e-286) {
tmp = t_1;
} else if (t <= 3.5e-211) {
tmp = 2.0 / t;
} else if (t <= 7200000000.0) {
tmp = (2.0 / t) / z;
} 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.8d-5)) then
tmp = t_2
else if (t <= (-2.1d-134)) then
tmp = t_1
else if (t <= (-7d-159)) then
tmp = 2.0d0 / t
else if (t <= (-8.5d-286)) then
tmp = t_1
else if (t <= 3.5d-211) then
tmp = 2.0d0 / t
else if (t <= 7200000000.0d0) then
tmp = (2.0d0 / t) / z
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.8e-5) {
tmp = t_2;
} else if (t <= -2.1e-134) {
tmp = t_1;
} else if (t <= -7e-159) {
tmp = 2.0 / t;
} else if (t <= -8.5e-286) {
tmp = t_1;
} else if (t <= 3.5e-211) {
tmp = 2.0 / t;
} else if (t <= 7200000000.0) {
tmp = (2.0 / t) / z;
} 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.8e-5: tmp = t_2 elif t <= -2.1e-134: tmp = t_1 elif t <= -7e-159: tmp = 2.0 / t elif t <= -8.5e-286: tmp = t_1 elif t <= 3.5e-211: tmp = 2.0 / t elif t <= 7200000000.0: tmp = (2.0 / t) / z 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.8e-5) tmp = t_2; elseif (t <= -2.1e-134) tmp = t_1; elseif (t <= -7e-159) tmp = Float64(2.0 / t); elseif (t <= -8.5e-286) tmp = t_1; elseif (t <= 3.5e-211) tmp = Float64(2.0 / t); elseif (t <= 7200000000.0) tmp = Float64(Float64(2.0 / t) / z); 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.8e-5) tmp = t_2; elseif (t <= -2.1e-134) tmp = t_1; elseif (t <= -7e-159) tmp = 2.0 / t; elseif (t <= -8.5e-286) tmp = t_1; elseif (t <= 3.5e-211) tmp = 2.0 / t; elseif (t <= 7200000000.0) tmp = (2.0 / t) / z; 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.8e-5], t$95$2, If[LessEqual[t, -2.1e-134], t$95$1, If[LessEqual[t, -7e-159], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, -8.5e-286], t$95$1, If[LessEqual[t, 3.5e-211], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, 7200000000.0], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], 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.8 \cdot 10^{-5}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -2.1 \cdot 10^{-134}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -7 \cdot 10^{-159}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;t \leq -8.5 \cdot 10^{-286}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-211}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;t \leq 7200000000:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -1.80000000000000005e-5 or 7.2e9 < t Initial program 70.0%
Taylor expanded in t around inf 86.5%
if -1.80000000000000005e-5 < t < -2.0999999999999999e-134 or -7.00000000000000005e-159 < t < -8.4999999999999998e-286Initial program 99.7%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.8%
metadata-eval99.8%
associate-*r/99.8%
sub-neg99.8%
associate-*r/99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 61.4%
if -2.0999999999999999e-134 < t < -7.00000000000000005e-159 or -8.4999999999999998e-286 < t < 3.5e-211Initial program 96.8%
Taylor expanded in t around 0 89.1%
associate-*r/89.1%
metadata-eval89.1%
Simplified89.1%
Taylor expanded in z around inf 67.0%
if 3.5e-211 < t < 7.2e9Initial program 99.8%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*100.0%
metadata-eval100.0%
associate-*r/100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 81.1%
sub-neg81.1%
associate-*r/81.1%
metadata-eval81.1%
associate-*r/81.1%
metadata-eval81.1%
+-commutative81.1%
metadata-eval81.1%
associate-+r+81.1%
+-commutative81.1%
Simplified81.1%
Taylor expanded in z around 0 62.1%
associate-/l/62.0%
Simplified62.0%
Taylor expanded in z around 0 62.1%
associate-/r*62.2%
Simplified62.2%
Final simplification74.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -4.4e-7)
t_1
(if (<= t -3.8e-134)
(/ (/ 2.0 z) t)
(if (<= t -2e-158)
(/ 2.0 t)
(if (<= t -2.05e-281)
(/ 2.0 (* t z))
(if (<= t 2.5e-203)
(/ 2.0 t)
(if (<= t 7200000000.0) (/ (/ 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 <= -4.4e-7) {
tmp = t_1;
} else if (t <= -3.8e-134) {
tmp = (2.0 / z) / t;
} else if (t <= -2e-158) {
tmp = 2.0 / t;
} else if (t <= -2.05e-281) {
tmp = 2.0 / (t * z);
} else if (t <= 2.5e-203) {
tmp = 2.0 / t;
} else if (t <= 7200000000.0) {
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 <= (-4.4d-7)) then
tmp = t_1
else if (t <= (-3.8d-134)) then
tmp = (2.0d0 / z) / t
else if (t <= (-2d-158)) then
tmp = 2.0d0 / t
else if (t <= (-2.05d-281)) then
tmp = 2.0d0 / (t * z)
else if (t <= 2.5d-203) then
tmp = 2.0d0 / t
else if (t <= 7200000000.0d0) 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 <= -4.4e-7) {
tmp = t_1;
} else if (t <= -3.8e-134) {
tmp = (2.0 / z) / t;
} else if (t <= -2e-158) {
tmp = 2.0 / t;
} else if (t <= -2.05e-281) {
tmp = 2.0 / (t * z);
} else if (t <= 2.5e-203) {
tmp = 2.0 / t;
} else if (t <= 7200000000.0) {
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 <= -4.4e-7: tmp = t_1 elif t <= -3.8e-134: tmp = (2.0 / z) / t elif t <= -2e-158: tmp = 2.0 / t elif t <= -2.05e-281: tmp = 2.0 / (t * z) elif t <= 2.5e-203: tmp = 2.0 / t elif t <= 7200000000.0: 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 <= -4.4e-7) tmp = t_1; elseif (t <= -3.8e-134) tmp = Float64(Float64(2.0 / z) / t); elseif (t <= -2e-158) tmp = Float64(2.0 / t); elseif (t <= -2.05e-281) tmp = Float64(2.0 / Float64(t * z)); elseif (t <= 2.5e-203) tmp = Float64(2.0 / t); elseif (t <= 7200000000.0) tmp = Float64(Float64(2.0 / 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 <= -4.4e-7) tmp = t_1; elseif (t <= -3.8e-134) tmp = (2.0 / z) / t; elseif (t <= -2e-158) tmp = 2.0 / t; elseif (t <= -2.05e-281) tmp = 2.0 / (t * z); elseif (t <= 2.5e-203) tmp = 2.0 / t; elseif (t <= 7200000000.0) 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, -4.4e-7], t$95$1, If[LessEqual[t, -3.8e-134], N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, -2e-158], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, -2.05e-281], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e-203], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, 7200000000.0], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -4.4 \cdot 10^{-7}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -3.8 \cdot 10^{-134}:\\
\;\;\;\;\frac{\frac{2}{z}}{t}\\
\mathbf{elif}\;t \leq -2 \cdot 10^{-158}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;t \leq -2.05 \cdot 10^{-281}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-203}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;t \leq 7200000000:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -4.4000000000000002e-7 or 7.2e9 < t Initial program 70.0%
Taylor expanded in t around inf 86.5%
if -4.4000000000000002e-7 < t < -3.80000000000000003e-134Initial program 99.7%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.8%
metadata-eval99.8%
associate-*r/99.8%
sub-neg99.8%
associate-*r/99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 84.8%
sub-neg84.8%
associate-*r/84.8%
metadata-eval84.8%
associate-*r/84.8%
metadata-eval84.8%
+-commutative84.8%
metadata-eval84.8%
associate-+r+84.8%
+-commutative84.8%
Simplified84.8%
Taylor expanded in z around 0 59.4%
associate-/l/59.5%
Simplified59.5%
if -3.80000000000000003e-134 < t < -2.00000000000000013e-158 or -2.05e-281 < t < 2.5000000000000001e-203Initial program 96.8%
Taylor expanded in t around 0 89.1%
associate-*r/89.1%
metadata-eval89.1%
Simplified89.1%
Taylor expanded in z around inf 67.0%
if -2.00000000000000013e-158 < t < -2.05e-281Initial program 99.8%
Taylor expanded in t around 0 99.8%
associate--l+99.8%
associate-*r/99.8%
metadata-eval99.8%
associate-/r*99.8%
metadata-eval99.8%
associate-*r/99.8%
sub-neg99.8%
associate-*r/99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 63.0%
if 2.5000000000000001e-203 < t < 7.2e9Initial program 99.8%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*100.0%
metadata-eval100.0%
associate-*r/100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 81.1%
sub-neg81.1%
associate-*r/81.1%
metadata-eval81.1%
associate-*r/81.1%
metadata-eval81.1%
+-commutative81.1%
metadata-eval81.1%
associate-+r+81.1%
+-commutative81.1%
Simplified81.1%
Taylor expanded in z around 0 62.1%
associate-/l/62.0%
Simplified62.0%
Taylor expanded in z around 0 62.1%
associate-/r*62.2%
Simplified62.2%
Final simplification74.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -3.05e+26) (not (<= (/ x y) 3500.0))) (/ x y) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -3.05e+26) || !((x / y) <= 3500.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) <= (-3.05d+26)) .or. (.not. ((x / y) <= 3500.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) <= -3.05e+26) || !((x / y) <= 3500.0)) {
tmp = x / y;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -3.05e+26) or not ((x / y) <= 3500.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) <= -3.05e+26) || !(Float64(x / y) <= 3500.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) <= -3.05e+26) || ~(((x / y) <= 3500.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], -3.05e+26], N[Not[LessEqual[N[(x / y), $MachinePrecision], 3500.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 -3.05 \cdot 10^{+26} \lor \neg \left(\frac{x}{y} \leq 3500\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -3.0500000000000001e26 or 3500 < (/.f64 x y) Initial program 82.8%
Taylor expanded in x around inf 64.4%
if -3.0500000000000001e26 < (/.f64 x y) < 3500Initial program 86.1%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
metadata-eval99.9%
associate-*r/99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 98.7%
sub-neg98.7%
associate-*r/98.7%
metadata-eval98.7%
associate-*r/98.7%
metadata-eval98.7%
+-commutative98.7%
metadata-eval98.7%
associate-+r+98.7%
+-commutative98.7%
Simplified98.7%
Taylor expanded in z around inf 59.1%
sub-neg59.1%
associate-*r/59.1%
metadata-eval59.1%
metadata-eval59.1%
+-commutative59.1%
Simplified59.1%
Final simplification61.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -6.8e-15) (not (<= z 7.5e-30))) (+ (/ x y) (+ (/ 2.0 t) -2.0)) (+ (/ x y) (/ 2.0 (* t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.8e-15) || !(z <= 7.5e-30)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + (2.0 / (t * z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-6.8d-15)) .or. (.not. (z <= 7.5d-30))) then
tmp = (x / y) + ((2.0d0 / t) + (-2.0d0))
else
tmp = (x / y) + (2.0d0 / (t * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.8e-15) || !(z <= 7.5e-30)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + (2.0 / (t * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -6.8e-15) or not (z <= 7.5e-30): tmp = (x / y) + ((2.0 / t) + -2.0) else: tmp = (x / y) + (2.0 / (t * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -6.8e-15) || !(z <= 7.5e-30)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); else tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(t * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -6.8e-15) || ~((z <= 7.5e-30))) tmp = (x / y) + ((2.0 / t) + -2.0); else tmp = (x / y) + (2.0 / (t * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -6.8e-15], N[Not[LessEqual[z, 7.5e-30]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{-15} \lor \neg \left(z \leq 7.5 \cdot 10^{-30}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t \cdot z}\\
\end{array}
\end{array}
if z < -6.8000000000000001e-15 or 7.5000000000000006e-30 < z Initial program 73.1%
Taylor expanded in t around 0 100.0%
associate--l+100.0%
associate-*r/100.0%
metadata-eval100.0%
associate-/r*100.0%
metadata-eval100.0%
associate-*r/100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 98.8%
sub-neg98.8%
associate-*r/98.8%
metadata-eval98.8%
+-commutative98.8%
metadata-eval98.8%
associate-+r+98.8%
+-commutative98.8%
Simplified98.8%
if -6.8000000000000001e-15 < z < 7.5000000000000006e-30Initial program 99.0%
Taylor expanded in z around 0 86.6%
Final simplification93.4%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2.0) (not (<= (/ x y) 2.0))) (/ x y) -2.0))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2.0) || !((x / y) <= 2.0)) {
tmp = x / y;
} else {
tmp = -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-2.0d0)) .or. (.not. ((x / y) <= 2.0d0))) then
tmp = x / y
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2.0) || !((x / y) <= 2.0)) {
tmp = x / y;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2.0) or not ((x / y) <= 2.0): tmp = x / y else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2.0) || !(Float64(x / y) <= 2.0)) tmp = Float64(x / y); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2.0) || ~(((x / y) <= 2.0))) tmp = x / y; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], -2.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \lor \neg \left(\frac{x}{y} \leq 2\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if (/.f64 x y) < -2 or 2 < (/.f64 x y) Initial program 83.8%
Taylor expanded in x around inf 61.7%
if -2 < (/.f64 x y) < 2Initial program 85.4%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
metadata-eval99.9%
associate-*r/99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.3%
sub-neg99.3%
associate-*r/99.3%
metadata-eval99.3%
associate-*r/99.3%
metadata-eval99.3%
+-commutative99.3%
metadata-eval99.3%
associate-+r+99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in t around inf 40.2%
Final simplification50.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -0.0031) (not (<= t 7200000000.0))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -0.0031) || !(t <= 7200000000.0)) {
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 <= (-0.0031d0)) .or. (.not. (t <= 7200000000.0d0))) 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 <= -0.0031) || !(t <= 7200000000.0)) {
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 <= -0.0031) or not (t <= 7200000000.0): 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 <= -0.0031) || !(t <= 7200000000.0)) 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 <= -0.0031) || ~((t <= 7200000000.0))) 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, -0.0031], N[Not[LessEqual[t, 7200000000.0]], $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 -0.0031 \lor \neg \left(t \leq 7200000000\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -0.00309999999999999989 or 7.2e9 < t Initial program 69.8%
Taylor expanded in t around inf 87.1%
if -0.00309999999999999989 < t < 7.2e9Initial program 99.0%
Taylor expanded in t around 0 85.7%
associate-*r/85.7%
metadata-eval85.7%
Simplified85.7%
Final simplification86.4%
(FPCore (x y z t) :precision binary64 (if (<= t -0.00064) (- (/ x y) 2.0) (if (<= t 6200000000.0) (/ (+ 2.0 (/ 2.0 z)) t) (/ (+ x (* y -2.0)) y))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -0.00064) {
tmp = (x / y) - 2.0;
} else if (t <= 6200000000.0) {
tmp = (2.0 + (2.0 / z)) / t;
} else {
tmp = (x + (y * -2.0)) / 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 (t <= (-0.00064d0)) then
tmp = (x / y) - 2.0d0
else if (t <= 6200000000.0d0) then
tmp = (2.0d0 + (2.0d0 / z)) / t
else
tmp = (x + (y * (-2.0d0))) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -0.00064) {
tmp = (x / y) - 2.0;
} else if (t <= 6200000000.0) {
tmp = (2.0 + (2.0 / z)) / t;
} else {
tmp = (x + (y * -2.0)) / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -0.00064: tmp = (x / y) - 2.0 elif t <= 6200000000.0: tmp = (2.0 + (2.0 / z)) / t else: tmp = (x + (y * -2.0)) / y return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -0.00064) tmp = Float64(Float64(x / y) - 2.0); elseif (t <= 6200000000.0) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); else tmp = Float64(Float64(x + Float64(y * -2.0)) / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -0.00064) tmp = (x / y) - 2.0; elseif (t <= 6200000000.0) tmp = (2.0 + (2.0 / z)) / t; else tmp = (x + (y * -2.0)) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -0.00064], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], If[LessEqual[t, 6200000000.0], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(N[(x + N[(y * -2.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.00064:\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{elif}\;t \leq 6200000000:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot -2}{y}\\
\end{array}
\end{array}
if t < -6.40000000000000052e-4Initial program 66.1%
Taylor expanded in t around inf 85.1%
if -6.40000000000000052e-4 < t < 6.2e9Initial program 99.0%
Taylor expanded in t around 0 85.7%
associate-*r/85.7%
metadata-eval85.7%
Simplified85.7%
if 6.2e9 < t Initial program 73.7%
div-inv73.6%
fma-def73.6%
*-commutative73.6%
+-commutative73.6%
associate-*l*73.6%
fma-def73.6%
Applied egg-rr73.6%
fma-udef73.6%
div-inv73.7%
associate-/r*79.1%
frac-add51.3%
Applied egg-rr51.3%
Taylor expanded in t around inf 89.2%
*-commutative89.2%
Simplified89.2%
Final simplification86.4%
(FPCore (x y z t) :precision binary64 (if (<= t -1.65e-5) (+ (/ x y) (+ (/ 2.0 t) -2.0)) (if (<= t 6200000000.0) (/ (+ 2.0 (/ 2.0 z)) t) (/ (+ x (* y -2.0)) y))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.65e-5) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else if (t <= 6200000000.0) {
tmp = (2.0 + (2.0 / z)) / t;
} else {
tmp = (x + (y * -2.0)) / 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 (t <= (-1.65d-5)) then
tmp = (x / y) + ((2.0d0 / t) + (-2.0d0))
else if (t <= 6200000000.0d0) then
tmp = (2.0d0 + (2.0d0 / z)) / t
else
tmp = (x + (y * (-2.0d0))) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.65e-5) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else if (t <= 6200000000.0) {
tmp = (2.0 + (2.0 / z)) / t;
} else {
tmp = (x + (y * -2.0)) / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.65e-5: tmp = (x / y) + ((2.0 / t) + -2.0) elif t <= 6200000000.0: tmp = (2.0 + (2.0 / z)) / t else: tmp = (x + (y * -2.0)) / y return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.65e-5) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); elseif (t <= 6200000000.0) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); else tmp = Float64(Float64(x + Float64(y * -2.0)) / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.65e-5) tmp = (x / y) + ((2.0 / t) + -2.0); elseif (t <= 6200000000.0) tmp = (2.0 + (2.0 / z)) / t; else tmp = (x + (y * -2.0)) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.65e-5], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6200000000.0], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(N[(x + N[(y * -2.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{-5}:\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{elif}\;t \leq 6200000000:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot -2}{y}\\
\end{array}
\end{array}
if t < -1.6500000000000001e-5Initial program 66.6%
Taylor expanded in t around 0 100.0%
associate--l+100.0%
associate-*r/100.0%
metadata-eval100.0%
associate-/r*99.9%
metadata-eval99.9%
associate-*r/99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 85.3%
sub-neg85.3%
associate-*r/85.3%
metadata-eval85.3%
+-commutative85.3%
metadata-eval85.3%
associate-+r+85.3%
+-commutative85.3%
Simplified85.3%
if -1.6500000000000001e-5 < t < 6.2e9Initial program 99.0%
Taylor expanded in t around 0 86.0%
associate-*r/86.0%
metadata-eval86.0%
Simplified86.0%
if 6.2e9 < t Initial program 73.7%
div-inv73.6%
fma-def73.6%
*-commutative73.6%
+-commutative73.6%
associate-*l*73.6%
fma-def73.6%
Applied egg-rr73.6%
fma-udef73.6%
div-inv73.7%
associate-/r*79.1%
frac-add51.3%
Applied egg-rr51.3%
Taylor expanded in t around inf 89.2%
*-commutative89.2%
Simplified89.2%
Final simplification86.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -5.2e-20) (not (<= t 5.3e-84))) (- (/ x y) 2.0) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.2e-20) || !(t <= 5.3e-84)) {
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 ((t <= (-5.2d-20)) .or. (.not. (t <= 5.3d-84))) 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 ((t <= -5.2e-20) || !(t <= 5.3e-84)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -5.2e-20) or not (t <= 5.3e-84): tmp = (x / y) - 2.0 else: tmp = (2.0 / t) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -5.2e-20) || !(t <= 5.3e-84)) 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 ((t <= -5.2e-20) || ~((t <= 5.3e-84))) 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[t, -5.2e-20], N[Not[LessEqual[t, 5.3e-84]], $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}\;t \leq -5.2 \cdot 10^{-20} \lor \neg \left(t \leq 5.3 \cdot 10^{-84}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if t < -5.1999999999999999e-20 or 5.3000000000000004e-84 < t Initial program 75.3%
Taylor expanded in t around inf 77.7%
if -5.1999999999999999e-20 < t < 5.3000000000000004e-84Initial program 98.7%
Taylor expanded in t around 0 98.9%
associate--l+98.9%
associate-*r/98.9%
metadata-eval98.9%
associate-/r*98.9%
metadata-eval98.9%
associate-*r/98.9%
sub-neg98.9%
associate-*r/98.9%
metadata-eval98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in x around 0 91.8%
sub-neg91.8%
associate-*r/91.8%
metadata-eval91.8%
associate-*r/91.8%
metadata-eval91.8%
+-commutative91.8%
metadata-eval91.8%
associate-+r+91.8%
+-commutative91.8%
Simplified91.8%
Taylor expanded in z around inf 44.7%
sub-neg44.7%
associate-*r/44.7%
metadata-eval44.7%
metadata-eval44.7%
+-commutative44.7%
Simplified44.7%
Final simplification64.5%
(FPCore (x y z t) :precision binary64 (if (<= t -0.004) -2.0 (if (<= t 9.5e-38) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -0.004) {
tmp = -2.0;
} else if (t <= 9.5e-38) {
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 <= (-0.004d0)) then
tmp = -2.0d0
else if (t <= 9.5d-38) 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 <= -0.004) {
tmp = -2.0;
} else if (t <= 9.5e-38) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -0.004: tmp = -2.0 elif t <= 9.5e-38: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -0.004) tmp = -2.0; elseif (t <= 9.5e-38) 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 <= -0.004) tmp = -2.0; elseif (t <= 9.5e-38) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -0.004], -2.0, If[LessEqual[t, 9.5e-38], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.004:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-38}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -0.0040000000000000001 or 9.5000000000000009e-38 < t Initial program 72.0%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
metadata-eval99.9%
associate-*r/99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 55.8%
sub-neg55.8%
associate-*r/55.8%
metadata-eval55.8%
associate-*r/55.8%
metadata-eval55.8%
+-commutative55.8%
metadata-eval55.8%
associate-+r+55.8%
+-commutative55.8%
Simplified55.8%
Taylor expanded in t around inf 39.1%
if -0.0040000000000000001 < t < 9.5000000000000009e-38Initial program 98.9%
Taylor expanded in t around 0 87.8%
associate-*r/87.8%
metadata-eval87.8%
Simplified87.8%
Taylor expanded in z around inf 39.6%
Final simplification39.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 84.6%
Taylor expanded in t around 0 99.5%
associate--l+99.5%
associate-*r/99.5%
metadata-eval99.5%
associate-/r*99.5%
metadata-eval99.5%
associate-*r/99.5%
sub-neg99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 71.0%
sub-neg71.0%
associate-*r/71.0%
metadata-eval71.0%
associate-*r/71.0%
metadata-eval71.0%
+-commutative71.0%
metadata-eval71.0%
associate-+r+71.0%
+-commutative71.0%
Simplified71.0%
Taylor expanded in t around inf 22.0%
Final simplification22.0%
(FPCore (x y z t) :precision binary64 (- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y))))
double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((2.0d0 / z) + 2.0d0) / t) - (2.0d0 - (x / y))
end function
public static double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
def code(x, y, z, t): return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(2.0 / z) + 2.0) / t) - Float64(2.0 - Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = (((2.0 / z) + 2.0) / t) - (2.0 - (x / y)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(2.0 / z), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] - N[(2.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{2}{z} + 2}{t} - \left(2 - \frac{x}{y}\right)
\end{array}
herbie shell --seed 2023336
(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))))