
(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 11 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 (* (/ 1.0 t) (+ 2.0 (/ 2.0 z))))))
double code(double x, double y, double z, double t) {
return (x / y) + (-2.0 + ((1.0 / t) * (2.0 + (2.0 / 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) + ((1.0d0 / t) * (2.0d0 + (2.0d0 / z))))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + (-2.0 + ((1.0 / t) * (2.0 + (2.0 / z))));
}
def code(x, y, z, t): return (x / y) + (-2.0 + ((1.0 / t) * (2.0 + (2.0 / z))))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(-2.0 + Float64(Float64(1.0 / t) * Float64(2.0 + Float64(2.0 / z))))) end
function tmp = code(x, y, z, t) tmp = (x / y) + (-2.0 + ((1.0 / t) * (2.0 + (2.0 / z)))); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(N[(1.0 / t), $MachinePrecision] * N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(-2 + \frac{1}{t} \cdot \left(2 + \frac{2}{z}\right)\right)
\end{array}
Initial program 86.6%
Taylor expanded in t around 0 98.7%
sub-neg98.7%
metadata-eval98.7%
associate-*r/98.7%
+-commutative98.7%
associate-*r/98.7%
metadata-eval98.7%
metadata-eval98.7%
+-commutative98.7%
associate-/l/98.7%
metadata-eval98.7%
associate-*r/98.7%
*-rgt-identity98.7%
associate-*r/98.7%
distribute-rgt-out98.7%
associate-*r/98.7%
metadata-eval98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ 2.0 (/ 2.0 z)) t)))
(if (<= (/ x y) -3.8e+73)
(/ x y)
(if (<= (/ x y) 1e-13)
(+ -2.0 t_1)
(if (<= (/ x y) 3.7e+126)
(+ (/ x y) -2.0)
(if (<= (/ x y) 1.32e+156) t_1 (/ x y)))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 + (2.0 / z)) / t;
double tmp;
if ((x / y) <= -3.8e+73) {
tmp = x / y;
} else if ((x / y) <= 1e-13) {
tmp = -2.0 + t_1;
} else if ((x / y) <= 3.7e+126) {
tmp = (x / y) + -2.0;
} else if ((x / y) <= 1.32e+156) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (2.0d0 + (2.0d0 / z)) / t
if ((x / y) <= (-3.8d+73)) then
tmp = x / y
else if ((x / y) <= 1d-13) then
tmp = (-2.0d0) + t_1
else if ((x / y) <= 3.7d+126) then
tmp = (x / y) + (-2.0d0)
else if ((x / y) <= 1.32d+156) then
tmp = t_1
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (2.0 + (2.0 / z)) / t;
double tmp;
if ((x / y) <= -3.8e+73) {
tmp = x / y;
} else if ((x / y) <= 1e-13) {
tmp = -2.0 + t_1;
} else if ((x / y) <= 3.7e+126) {
tmp = (x / y) + -2.0;
} else if ((x / y) <= 1.32e+156) {
tmp = t_1;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 + (2.0 / z)) / t tmp = 0 if (x / y) <= -3.8e+73: tmp = x / y elif (x / y) <= 1e-13: tmp = -2.0 + t_1 elif (x / y) <= 3.7e+126: tmp = (x / y) + -2.0 elif (x / y) <= 1.32e+156: tmp = t_1 else: tmp = x / y return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 + Float64(2.0 / z)) / t) tmp = 0.0 if (Float64(x / y) <= -3.8e+73) tmp = Float64(x / y); elseif (Float64(x / y) <= 1e-13) tmp = Float64(-2.0 + t_1); elseif (Float64(x / y) <= 3.7e+126) tmp = Float64(Float64(x / y) + -2.0); elseif (Float64(x / y) <= 1.32e+156) tmp = t_1; else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 + (2.0 / z)) / t; tmp = 0.0; if ((x / y) <= -3.8e+73) tmp = x / y; elseif ((x / y) <= 1e-13) tmp = -2.0 + t_1; elseif ((x / y) <= 3.7e+126) tmp = (x / y) + -2.0; elseif ((x / y) <= 1.32e+156) tmp = t_1; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -3.8e+73], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1e-13], N[(-2.0 + t$95$1), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 3.7e+126], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1.32e+156], t$95$1, N[(x / y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2 + \frac{2}{z}}{t}\\
\mathbf{if}\;\frac{x}{y} \leq -3.8 \cdot 10^{+73}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 10^{-13}:\\
\;\;\;\;-2 + t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 3.7 \cdot 10^{+126}:\\
\;\;\;\;\frac{x}{y} + -2\\
\mathbf{elif}\;\frac{x}{y} \leq 1.32 \cdot 10^{+156}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -3.80000000000000022e73 or 1.3199999999999999e156 < (/.f64 x y) Initial program 82.3%
Taylor expanded in x around inf 85.0%
if -3.80000000000000022e73 < (/.f64 x y) < 1e-13Initial program 88.2%
Taylor expanded in t around 0 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
associate-/l/99.9%
metadata-eval99.9%
associate-*r/99.9%
*-rgt-identity99.9%
associate-*r/99.9%
distribute-rgt-out99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 95.6%
sub-neg95.6%
associate-/r*95.6%
associate-*r/95.6%
associate-*l/95.5%
distribute-rgt-in95.6%
associate-*l/95.6%
associate-*r/95.6%
*-lft-identity95.6%
metadata-eval95.6%
+-commutative95.6%
Simplified95.6%
if 1e-13 < (/.f64 x y) < 3.6999999999999998e126Initial program 87.9%
Taylor expanded in t around inf 66.9%
if 3.6999999999999998e126 < (/.f64 x y) < 1.3199999999999999e156Initial program 99.6%
Taylor expanded in t around 0 87.7%
associate-*r/87.7%
metadata-eval87.7%
Simplified87.7%
Final simplification89.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) -2.0)) (t_2 (+ -2.0 (/ 2.0 t))))
(if (<= z -1.05e+145)
t_2
(if (<= z -2.7e-162)
t_1
(if (<= z 8.2e+26)
(/ 2.0 (* t z))
(if (or (<= z 5.5e+215) (not (<= z 7.6e+283))) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double t_2 = -2.0 + (2.0 / t);
double tmp;
if (z <= -1.05e+145) {
tmp = t_2;
} else if (z <= -2.7e-162) {
tmp = t_1;
} else if (z <= 8.2e+26) {
tmp = 2.0 / (t * z);
} else if ((z <= 5.5e+215) || !(z <= 7.6e+283)) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x / y) + (-2.0d0)
t_2 = (-2.0d0) + (2.0d0 / t)
if (z <= (-1.05d+145)) then
tmp = t_2
else if (z <= (-2.7d-162)) then
tmp = t_1
else if (z <= 8.2d+26) then
tmp = 2.0d0 / (t * z)
else if ((z <= 5.5d+215) .or. (.not. (z <= 7.6d+283))) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double t_2 = -2.0 + (2.0 / t);
double tmp;
if (z <= -1.05e+145) {
tmp = t_2;
} else if (z <= -2.7e-162) {
tmp = t_1;
} else if (z <= 8.2e+26) {
tmp = 2.0 / (t * z);
} else if ((z <= 5.5e+215) || !(z <= 7.6e+283)) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + -2.0 t_2 = -2.0 + (2.0 / t) tmp = 0 if z <= -1.05e+145: tmp = t_2 elif z <= -2.7e-162: tmp = t_1 elif z <= 8.2e+26: tmp = 2.0 / (t * z) elif (z <= 5.5e+215) or not (z <= 7.6e+283): tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + -2.0) t_2 = Float64(-2.0 + Float64(2.0 / t)) tmp = 0.0 if (z <= -1.05e+145) tmp = t_2; elseif (z <= -2.7e-162) tmp = t_1; elseif (z <= 8.2e+26) tmp = Float64(2.0 / Float64(t * z)); elseif ((z <= 5.5e+215) || !(z <= 7.6e+283)) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + -2.0; t_2 = -2.0 + (2.0 / t); tmp = 0.0; if (z <= -1.05e+145) tmp = t_2; elseif (z <= -2.7e-162) tmp = t_1; elseif (z <= 8.2e+26) tmp = 2.0 / (t * z); elseif ((z <= 5.5e+215) || ~((z <= 7.6e+283))) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e+145], t$95$2, If[LessEqual[z, -2.7e-162], t$95$1, If[LessEqual[z, 8.2e+26], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 5.5e+215], N[Not[LessEqual[z, 7.6e+283]], $MachinePrecision]], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
t_2 := -2 + \frac{2}{t}\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{+145}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-162}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+26}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+215} \lor \neg \left(z \leq 7.6 \cdot 10^{+283}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.04999999999999995e145 or 5.5e215 < z < 7.6000000000000004e283Initial program 58.0%
Taylor expanded in t around 0 100.0%
sub-neg100.0%
metadata-eval100.0%
associate-*r/100.0%
+-commutative100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
associate-/l/100.0%
metadata-eval100.0%
associate-*r/100.0%
*-rgt-identity100.0%
associate-*r/100.0%
distribute-rgt-out100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 79.0%
sub-neg79.0%
associate-/r*79.0%
associate-*r/79.0%
associate-*l/79.0%
distribute-rgt-in79.0%
associate-*l/79.0%
associate-*r/79.0%
*-lft-identity79.0%
metadata-eval79.0%
+-commutative79.0%
Simplified79.0%
*-un-lft-identity79.0%
associate-*l/79.0%
Applied egg-rr79.0%
Taylor expanded in z around inf 79.0%
if -1.04999999999999995e145 < z < -2.69999999999999984e-162 or 8.19999999999999967e26 < z < 5.5e215 or 7.6000000000000004e283 < z Initial program 88.8%
Taylor expanded in t around inf 76.3%
if -2.69999999999999984e-162 < z < 8.19999999999999967e26Initial program 96.7%
Taylor expanded in t around 0 96.7%
sub-neg96.7%
metadata-eval96.7%
associate-*r/96.7%
+-commutative96.7%
associate-*r/96.7%
metadata-eval96.7%
metadata-eval96.7%
+-commutative96.7%
associate-/l/96.7%
metadata-eval96.7%
associate-*r/96.7%
*-rgt-identity96.7%
associate-*r/96.7%
distribute-rgt-out96.7%
associate-*r/96.7%
metadata-eval96.7%
Simplified96.7%
Taylor expanded in z around 0 69.3%
Final simplification74.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) -2.0)) (t_2 (+ -2.0 (/ 2.0 t))))
(if (<= z -7e+144)
t_2
(if (<= z -1.25e-161)
t_1
(if (<= z 8.2e+26)
(/ (/ 2.0 z) t)
(if (or (<= z 5.5e+215) (not (<= z 2.5e+284))) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double t_2 = -2.0 + (2.0 / t);
double tmp;
if (z <= -7e+144) {
tmp = t_2;
} else if (z <= -1.25e-161) {
tmp = t_1;
} else if (z <= 8.2e+26) {
tmp = (2.0 / z) / t;
} else if ((z <= 5.5e+215) || !(z <= 2.5e+284)) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x / y) + (-2.0d0)
t_2 = (-2.0d0) + (2.0d0 / t)
if (z <= (-7d+144)) then
tmp = t_2
else if (z <= (-1.25d-161)) then
tmp = t_1
else if (z <= 8.2d+26) then
tmp = (2.0d0 / z) / t
else if ((z <= 5.5d+215) .or. (.not. (z <= 2.5d+284))) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double t_2 = -2.0 + (2.0 / t);
double tmp;
if (z <= -7e+144) {
tmp = t_2;
} else if (z <= -1.25e-161) {
tmp = t_1;
} else if (z <= 8.2e+26) {
tmp = (2.0 / z) / t;
} else if ((z <= 5.5e+215) || !(z <= 2.5e+284)) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + -2.0 t_2 = -2.0 + (2.0 / t) tmp = 0 if z <= -7e+144: tmp = t_2 elif z <= -1.25e-161: tmp = t_1 elif z <= 8.2e+26: tmp = (2.0 / z) / t elif (z <= 5.5e+215) or not (z <= 2.5e+284): tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + -2.0) t_2 = Float64(-2.0 + Float64(2.0 / t)) tmp = 0.0 if (z <= -7e+144) tmp = t_2; elseif (z <= -1.25e-161) tmp = t_1; elseif (z <= 8.2e+26) tmp = Float64(Float64(2.0 / z) / t); elseif ((z <= 5.5e+215) || !(z <= 2.5e+284)) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + -2.0; t_2 = -2.0 + (2.0 / t); tmp = 0.0; if (z <= -7e+144) tmp = t_2; elseif (z <= -1.25e-161) tmp = t_1; elseif (z <= 8.2e+26) tmp = (2.0 / z) / t; elseif ((z <= 5.5e+215) || ~((z <= 2.5e+284))) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7e+144], t$95$2, If[LessEqual[z, -1.25e-161], t$95$1, If[LessEqual[z, 8.2e+26], N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[z, 5.5e+215], N[Not[LessEqual[z, 2.5e+284]], $MachinePrecision]], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
t_2 := -2 + \frac{2}{t}\\
\mathbf{if}\;z \leq -7 \cdot 10^{+144}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-161}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+26}:\\
\;\;\;\;\frac{\frac{2}{z}}{t}\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+215} \lor \neg \left(z \leq 2.5 \cdot 10^{+284}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -6.9999999999999996e144 or 5.5e215 < z < 2.5e284Initial program 58.0%
Taylor expanded in t around 0 100.0%
sub-neg100.0%
metadata-eval100.0%
associate-*r/100.0%
+-commutative100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
associate-/l/100.0%
metadata-eval100.0%
associate-*r/100.0%
*-rgt-identity100.0%
associate-*r/100.0%
distribute-rgt-out100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 79.0%
sub-neg79.0%
associate-/r*79.0%
associate-*r/79.0%
associate-*l/79.0%
distribute-rgt-in79.0%
associate-*l/79.0%
associate-*r/79.0%
*-lft-identity79.0%
metadata-eval79.0%
+-commutative79.0%
Simplified79.0%
*-un-lft-identity79.0%
associate-*l/79.0%
Applied egg-rr79.0%
Taylor expanded in z around inf 79.0%
if -6.9999999999999996e144 < z < -1.25e-161 or 8.19999999999999967e26 < z < 5.5e215 or 2.5e284 < z Initial program 88.8%
Taylor expanded in t around inf 76.3%
if -1.25e-161 < z < 8.19999999999999967e26Initial program 96.7%
+-commutative96.7%
remove-double-neg96.7%
distribute-frac-neg96.7%
unsub-neg96.7%
*-commutative96.7%
associate-*r*96.7%
distribute-rgt1-in96.7%
associate-*r/96.7%
/-rgt-identity96.7%
fma-neg96.7%
/-rgt-identity96.7%
*-commutative96.7%
fma-def96.7%
*-commutative96.7%
distribute-frac-neg96.7%
remove-double-neg96.7%
Simplified96.7%
Taylor expanded in x around 0 77.5%
Taylor expanded in z around 0 69.3%
associate-/r*69.3%
Simplified69.3%
Taylor expanded in t around 0 69.3%
associate-/l/69.3%
Simplified69.3%
Final simplification74.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -4200000000000.0) (not (<= (/ x y) 245.0))) (+ (/ x y) (/ 2.0 (* t z))) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -4200000000000.0) || !((x / y) <= 245.0)) {
tmp = (x / y) + (2.0 / (t * z));
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-4200000000000.0d0)) .or. (.not. ((x / y) <= 245.0d0))) then
tmp = (x / y) + (2.0d0 / (t * z))
else
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -4200000000000.0) || !((x / y) <= 245.0)) {
tmp = (x / y) + (2.0 / (t * z));
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -4200000000000.0) or not ((x / y) <= 245.0): tmp = (x / y) + (2.0 / (t * z)) else: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -4200000000000.0) || !(Float64(x / y) <= 245.0)) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(t * z))); else tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -4200000000000.0) || ~(((x / y) <= 245.0))) tmp = (x / y) + (2.0 / (t * z)); else tmp = -2.0 + ((2.0 + (2.0 / z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -4200000000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 245.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -4200000000000 \lor \neg \left(\frac{x}{y} \leq 245\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -4.2e12 or 245 < (/.f64 x y) Initial program 86.9%
Taylor expanded in z around 0 90.6%
if -4.2e12 < (/.f64 x y) < 245Initial program 86.3%
Taylor expanded in t around 0 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
associate-/l/99.9%
metadata-eval99.9%
associate-*r/99.9%
*-rgt-identity99.9%
associate-*r/99.9%
distribute-rgt-out99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 98.8%
sub-neg98.8%
associate-/r*98.8%
associate-*r/98.8%
associate-*l/98.8%
distribute-rgt-in98.8%
associate-*l/98.8%
associate-*r/98.8%
*-lft-identity98.8%
metadata-eval98.8%
+-commutative98.8%
Simplified98.8%
Final simplification94.7%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -4200000000000.0)
(+ (/ x y) (/ 2.0 (* t z)))
(if (<= (/ x y) 3550.0)
(+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))
(+ (/ x y) (/ (/ 2.0 t) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -4200000000000.0) {
tmp = (x / y) + (2.0 / (t * z));
} else if ((x / y) <= 3550.0) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-4200000000000.0d0)) then
tmp = (x / y) + (2.0d0 / (t * z))
else if ((x / y) <= 3550.0d0) then
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
else
tmp = (x / y) + ((2.0d0 / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -4200000000000.0) {
tmp = (x / y) + (2.0 / (t * z));
} else if ((x / y) <= 3550.0) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -4200000000000.0: tmp = (x / y) + (2.0 / (t * z)) elif (x / y) <= 3550.0: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) else: tmp = (x / y) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -4200000000000.0) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(t * z))); elseif (Float64(x / y) <= 3550.0) tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -4200000000000.0) tmp = (x / y) + (2.0 / (t * z)); elseif ((x / y) <= 3550.0) tmp = -2.0 + ((2.0 + (2.0 / z)) / t); else tmp = (x / y) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -4200000000000.0], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 3550.0], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -4200000000000:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t \cdot z}\\
\mathbf{elif}\;\frac{x}{y} \leq 3550:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if (/.f64 x y) < -4.2e12Initial program 81.4%
Taylor expanded in z around 0 88.9%
if -4.2e12 < (/.f64 x y) < 3550Initial program 86.3%
Taylor expanded in t around 0 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
associate-/l/99.9%
metadata-eval99.9%
associate-*r/99.9%
*-rgt-identity99.9%
associate-*r/99.9%
distribute-rgt-out99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 98.8%
sub-neg98.8%
associate-/r*98.8%
associate-*r/98.8%
associate-*l/98.8%
distribute-rgt-in98.8%
associate-*l/98.8%
associate-*r/98.8%
*-lft-identity98.8%
metadata-eval98.8%
+-commutative98.8%
Simplified98.8%
if 3550 < (/.f64 x y) Initial program 90.7%
Taylor expanded in z around 0 91.9%
associate-/r*91.9%
Simplified91.9%
Final simplification94.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -14000000000000.0) (not (<= (/ x y) 15500.0))) (/ x y) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -14000000000000.0) || !((x / y) <= 15500.0)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-14000000000000.0d0)) .or. (.not. ((x / y) <= 15500.0d0))) then
tmp = x / y
else
tmp = (-2.0d0) + (2.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -14000000000000.0) || !((x / y) <= 15500.0)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -14000000000000.0) or not ((x / y) <= 15500.0): tmp = x / y else: tmp = -2.0 + (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -14000000000000.0) || !(Float64(x / y) <= 15500.0)) tmp = Float64(x / y); else tmp = Float64(-2.0 + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -14000000000000.0) || ~(((x / y) <= 15500.0))) tmp = x / y; else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -14000000000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 15500.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -14000000000000 \lor \neg \left(\frac{x}{y} \leq 15500\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.4e13 or 15500 < (/.f64 x y) Initial program 86.9%
Taylor expanded in x around inf 70.8%
if -1.4e13 < (/.f64 x y) < 15500Initial program 86.3%
Taylor expanded in t around 0 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
associate-/l/99.9%
metadata-eval99.9%
associate-*r/99.9%
*-rgt-identity99.9%
associate-*r/99.9%
distribute-rgt-out99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 98.8%
sub-neg98.8%
associate-/r*98.8%
associate-*r/98.8%
associate-*l/98.8%
distribute-rgt-in98.8%
associate-*l/98.8%
associate-*r/98.8%
*-lft-identity98.8%
metadata-eval98.8%
+-commutative98.8%
Simplified98.8%
*-un-lft-identity98.8%
associate-*l/98.8%
Applied egg-rr98.8%
Taylor expanded in z around inf 60.8%
Final simplification65.9%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -3100000000000.0) (not (<= (/ x y) 1e-13))) (+ (/ x y) -2.0) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -3100000000000.0) || !((x / y) <= 1e-13)) {
tmp = (x / y) + -2.0;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-3100000000000.0d0)) .or. (.not. ((x / y) <= 1d-13))) then
tmp = (x / y) + (-2.0d0)
else
tmp = (-2.0d0) + (2.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -3100000000000.0) || !((x / y) <= 1e-13)) {
tmp = (x / y) + -2.0;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -3100000000000.0) or not ((x / y) <= 1e-13): tmp = (x / y) + -2.0 else: tmp = -2.0 + (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -3100000000000.0) || !(Float64(x / y) <= 1e-13)) tmp = Float64(Float64(x / y) + -2.0); else tmp = Float64(-2.0 + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -3100000000000.0) || ~(((x / y) <= 1e-13))) tmp = (x / y) + -2.0; else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -3100000000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1e-13]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -3100000000000 \lor \neg \left(\frac{x}{y} \leq 10^{-13}\right):\\
\;\;\;\;\frac{x}{y} + -2\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -3.1e12 or 1e-13 < (/.f64 x y) Initial program 86.4%
Taylor expanded in t around inf 72.4%
if -3.1e12 < (/.f64 x y) < 1e-13Initial program 86.8%
Taylor expanded in t around 0 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
associate-/l/99.9%
metadata-eval99.9%
associate-*r/99.9%
*-rgt-identity99.9%
associate-*r/99.9%
distribute-rgt-out99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.5%
sub-neg99.5%
associate-/r*99.5%
associate-*r/99.5%
associate-*l/99.5%
distribute-rgt-in99.5%
associate-*l/99.5%
associate-*r/99.5%
*-lft-identity99.5%
metadata-eval99.5%
+-commutative99.5%
Simplified99.5%
*-un-lft-identity99.5%
associate-*l/99.5%
Applied egg-rr99.5%
Taylor expanded in z around inf 60.6%
Final simplification66.8%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -46000.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) <= -46000.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) <= (-46000.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) <= -46000.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) <= -46000.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) <= -46000.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) <= -46000.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], -46000.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 -46000 \lor \neg \left(\frac{x}{y} \leq 2\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if (/.f64 x y) < -46000 or 2 < (/.f64 x y) Initial program 87.0%
Taylor expanded in x around inf 69.8%
if -46000 < (/.f64 x y) < 2Initial program 86.1%
+-commutative86.1%
remove-double-neg86.1%
distribute-frac-neg86.1%
unsub-neg86.1%
*-commutative86.1%
associate-*r*86.1%
distribute-rgt1-in86.1%
associate-*r/86.0%
/-rgt-identity86.0%
fma-neg86.0%
/-rgt-identity86.0%
*-commutative86.0%
fma-def86.0%
*-commutative86.0%
distribute-frac-neg86.0%
remove-double-neg86.0%
Simplified86.0%
Taylor expanded in x around 0 85.2%
Taylor expanded in t around inf 39.0%
Final simplification54.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.5e-21) (not (<= t 0.0013))) (+ (/ x y) -2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.5e-21) || !(t <= 0.0013)) {
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 <= (-4.5d-21)) .or. (.not. (t <= 0.0013d0))) 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 <= -4.5e-21) || !(t <= 0.0013)) {
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 <= -4.5e-21) or not (t <= 0.0013): 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 <= -4.5e-21) || !(t <= 0.0013)) 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 <= -4.5e-21) || ~((t <= 0.0013))) 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, -4.5e-21], N[Not[LessEqual[t, 0.0013]], $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 -4.5 \cdot 10^{-21} \lor \neg \left(t \leq 0.0013\right):\\
\;\;\;\;\frac{x}{y} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -4.49999999999999968e-21 or 0.0012999999999999999 < t Initial program 78.2%
Taylor expanded in t around inf 82.3%
if -4.49999999999999968e-21 < t < 0.0012999999999999999Initial program 97.2%
Taylor expanded in t around 0 82.2%
associate-*r/82.2%
metadata-eval82.2%
Simplified82.2%
Final simplification82.2%
(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 86.6%
+-commutative86.6%
remove-double-neg86.6%
distribute-frac-neg86.6%
unsub-neg86.6%
*-commutative86.6%
associate-*r*86.6%
distribute-rgt1-in86.6%
associate-*r/86.5%
/-rgt-identity86.5%
fma-neg86.5%
/-rgt-identity86.5%
*-commutative86.5%
fma-def86.5%
*-commutative86.5%
distribute-frac-neg86.5%
remove-double-neg86.5%
Simplified86.5%
Taylor expanded in x around 0 58.5%
Taylor expanded in t around inf 20.1%
Final simplification20.1%
(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 2024031
(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))))