
(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 (/ 2.0 z)) t) -2.0)))
double code(double x, double y, double z, double t) {
return (x / y) + (((2.0 + (2.0 / z)) / 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 + (2.0d0 / z)) / t) + (-2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + (((2.0 + (2.0 / z)) / t) + -2.0);
}
def code(x, y, z, t): return (x / y) + (((2.0 + (2.0 / z)) / t) + -2.0)
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + -2.0)) end
function tmp = code(x, y, z, t) tmp = (x / y) + (((2.0 + (2.0 / z)) / t) + -2.0); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(\frac{2 + \frac{2}{z}}{t} + -2\right)
\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-/l*86.5%
fma-neg86.5%
*-commutative86.5%
fma-define86.5%
*-commutative86.5%
distribute-frac-neg86.5%
remove-double-neg86.5%
Simplified86.5%
Taylor expanded in t around inf 99.5%
sub-neg99.5%
+-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
associate-*r/99.5%
distribute-lft-in99.5%
metadata-eval99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -5.2e-36)
t_1
(if (<= t 2.6e-222)
(/ (/ 2.0 t) z)
(if (<= t 4.6e-120)
(/ 2.0 t)
(if (<= t 9.2e+16) (/ 2.0 (* z t)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -5.2e-36) {
tmp = t_1;
} else if (t <= 2.6e-222) {
tmp = (2.0 / t) / z;
} else if (t <= 4.6e-120) {
tmp = 2.0 / t;
} else if (t <= 9.2e+16) {
tmp = 2.0 / (z * t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / y) - 2.0d0
if (t <= (-5.2d-36)) then
tmp = t_1
else if (t <= 2.6d-222) then
tmp = (2.0d0 / t) / z
else if (t <= 4.6d-120) then
tmp = 2.0d0 / t
else if (t <= 9.2d+16) then
tmp = 2.0d0 / (z * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -5.2e-36) {
tmp = t_1;
} else if (t <= 2.6e-222) {
tmp = (2.0 / t) / z;
} else if (t <= 4.6e-120) {
tmp = 2.0 / t;
} else if (t <= 9.2e+16) {
tmp = 2.0 / (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if t <= -5.2e-36: tmp = t_1 elif t <= 2.6e-222: tmp = (2.0 / t) / z elif t <= 4.6e-120: tmp = 2.0 / t elif t <= 9.2e+16: tmp = 2.0 / (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -5.2e-36) tmp = t_1; elseif (t <= 2.6e-222) tmp = Float64(Float64(2.0 / t) / z); elseif (t <= 4.6e-120) tmp = Float64(2.0 / t); elseif (t <= 9.2e+16) tmp = Float64(2.0 / Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (t <= -5.2e-36) tmp = t_1; elseif (t <= 2.6e-222) tmp = (2.0 / t) / z; elseif (t <= 4.6e-120) tmp = 2.0 / t; elseif (t <= 9.2e+16) tmp = 2.0 / (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -5.2e-36], t$95$1, If[LessEqual[t, 2.6e-222], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 4.6e-120], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, 9.2e+16], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -5.2 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-222}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{-120}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{+16}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.2000000000000001e-36 or 9.2e16 < t Initial program 74.8%
Taylor expanded in t around inf 85.5%
if -5.2000000000000001e-36 < t < 2.5999999999999998e-222Initial program 98.3%
Taylor expanded in t around 0 82.1%
associate-*r/82.1%
metadata-eval82.1%
Simplified82.1%
Taylor expanded in z around 0 70.4%
Taylor expanded in t around 0 70.4%
Taylor expanded in z around 0 57.5%
if 2.5999999999999998e-222 < t < 4.59999999999999973e-120Initial program 99.8%
Taylor expanded in t around 0 88.7%
associate-*r/88.7%
metadata-eval88.7%
Simplified88.7%
Taylor expanded in z around inf 61.4%
if 4.59999999999999973e-120 < t < 9.2e16Initial program 99.8%
Taylor expanded in z around 0 49.2%
Final simplification71.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 2.0 (* z t))) (t_2 (- (/ x y) 2.0)))
(if (<= t -5.4e-38)
t_2
(if (<= t 1.05e-222)
t_1
(if (<= t 3.8e-120) (/ 2.0 t) (if (<= t 4.7e+16) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 / (z * t);
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -5.4e-38) {
tmp = t_2;
} else if (t <= 1.05e-222) {
tmp = t_1;
} else if (t <= 3.8e-120) {
tmp = 2.0 / t;
} else if (t <= 4.7e+16) {
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 / (z * t)
t_2 = (x / y) - 2.0d0
if (t <= (-5.4d-38)) then
tmp = t_2
else if (t <= 1.05d-222) then
tmp = t_1
else if (t <= 3.8d-120) then
tmp = 2.0d0 / t
else if (t <= 4.7d+16) 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 / (z * t);
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -5.4e-38) {
tmp = t_2;
} else if (t <= 1.05e-222) {
tmp = t_1;
} else if (t <= 3.8e-120) {
tmp = 2.0 / t;
} else if (t <= 4.7e+16) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 / (z * t) t_2 = (x / y) - 2.0 tmp = 0 if t <= -5.4e-38: tmp = t_2 elif t <= 1.05e-222: tmp = t_1 elif t <= 3.8e-120: tmp = 2.0 / t elif t <= 4.7e+16: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 / Float64(z * t)) t_2 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -5.4e-38) tmp = t_2; elseif (t <= 1.05e-222) tmp = t_1; elseif (t <= 3.8e-120) tmp = Float64(2.0 / t); elseif (t <= 4.7e+16) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 / (z * t); t_2 = (x / y) - 2.0; tmp = 0.0; if (t <= -5.4e-38) tmp = t_2; elseif (t <= 1.05e-222) tmp = t_1; elseif (t <= 3.8e-120) tmp = 2.0 / t; elseif (t <= 4.7e+16) 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[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -5.4e-38], t$95$2, If[LessEqual[t, 1.05e-222], t$95$1, If[LessEqual[t, 3.8e-120], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, 4.7e+16], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{z \cdot t}\\
t_2 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -5.4 \cdot 10^{-38}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-222}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-120}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;t \leq 4.7 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -5.40000000000000011e-38 or 4.7e16 < t Initial program 74.8%
Taylor expanded in t around inf 85.5%
if -5.40000000000000011e-38 < t < 1.05e-222 or 3.7999999999999997e-120 < t < 4.7e16Initial program 98.7%
Taylor expanded in z around 0 55.2%
if 1.05e-222 < t < 3.7999999999999997e-120Initial program 99.8%
Taylor expanded in t around 0 88.7%
associate-*r/88.7%
metadata-eval88.7%
Simplified88.7%
Taylor expanded in z around inf 61.4%
Final simplification71.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -5e-7) (not (<= (/ x y) 2000.0))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (/ (+ 2.0 (/ 2.0 z)) t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5e-7) || !((x / y) <= 2000.0)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-5d-7)) .or. (.not. ((x / y) <= 2000.0d0))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = ((2.0d0 + (2.0d0 / z)) / t) + (-2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5e-7) || !((x / y) <= 2000.0)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -5e-7) or not ((x / y) <= 2000.0): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = ((2.0 + (2.0 / z)) / t) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -5e-7) || !(Float64(x / y) <= 2000.0)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -5e-7) || ~(((x / y) <= 2000.0))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = ((2.0 + (2.0 / z)) / t) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -5e-7], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2000.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{-7} \lor \neg \left(\frac{x}{y} \leq 2000\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -4.99999999999999977e-7 or 2e3 < (/.f64 x y) Initial program 84.7%
Taylor expanded in z around inf 83.0%
div-sub83.0%
sub-neg83.0%
*-inverses83.0%
metadata-eval83.0%
distribute-lft-in83.0%
associate-*r/83.0%
metadata-eval83.0%
metadata-eval83.0%
Simplified83.0%
if -4.99999999999999977e-7 < (/.f64 x y) < 2e3Initial program 88.3%
+-commutative88.3%
remove-double-neg88.3%
distribute-frac-neg88.3%
unsub-neg88.3%
*-commutative88.3%
associate-*r*88.3%
distribute-rgt1-in88.3%
associate-/l*88.2%
fma-neg88.2%
*-commutative88.2%
fma-define88.2%
*-commutative88.2%
distribute-frac-neg88.2%
remove-double-neg88.2%
Simplified88.2%
Taylor expanded in t around inf 99.8%
sub-neg99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 98.6%
sub-neg98.6%
associate-*r/98.6%
metadata-eval98.6%
associate-/r*98.7%
metadata-eval98.7%
associate-*r/98.7%
associate-*l/98.6%
distribute-rgt-in98.6%
associate-*l/98.6%
*-lft-identity98.6%
metadata-eval98.6%
+-commutative98.6%
Simplified98.6%
Final simplification91.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2e+32) (not (<= (/ x y) 5e+53))) (/ x y) (+ (/ (+ 2.0 (/ 2.0 z)) t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2e+32) || !((x / y) <= 5e+53)) {
tmp = x / y;
} else {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-2d+32)) .or. (.not. ((x / y) <= 5d+53))) then
tmp = x / y
else
tmp = ((2.0d0 + (2.0d0 / z)) / t) + (-2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2e+32) || !((x / y) <= 5e+53)) {
tmp = x / y;
} else {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2e+32) or not ((x / y) <= 5e+53): tmp = x / y else: tmp = ((2.0 + (2.0 / z)) / t) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2e+32) || !(Float64(x / y) <= 5e+53)) tmp = Float64(x / y); else tmp = Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2e+32) || ~(((x / y) <= 5e+53))) tmp = x / y; else tmp = ((2.0 + (2.0 / z)) / t) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2e+32], N[Not[LessEqual[N[(x / y), $MachinePrecision], 5e+53]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+32} \lor \neg \left(\frac{x}{y} \leq 5 \cdot 10^{+53}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -2.00000000000000011e32 or 5.0000000000000004e53 < (/.f64 x y) Initial program 84.4%
Taylor expanded in x around inf 79.4%
if -2.00000000000000011e32 < (/.f64 x y) < 5.0000000000000004e53Initial program 88.0%
+-commutative88.0%
remove-double-neg88.0%
distribute-frac-neg88.0%
unsub-neg88.0%
*-commutative88.0%
associate-*r*88.0%
distribute-rgt1-in88.0%
associate-/l*87.9%
fma-neg87.9%
*-commutative87.9%
fma-define87.9%
*-commutative87.9%
distribute-frac-neg87.9%
remove-double-neg87.9%
Simplified87.9%
Taylor expanded in t around inf 99.8%
sub-neg99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 92.5%
sub-neg92.5%
associate-*r/92.5%
metadata-eval92.5%
associate-/r*92.5%
metadata-eval92.5%
associate-*r/92.5%
associate-*l/92.4%
distribute-rgt-in92.4%
associate-*l/92.5%
*-lft-identity92.5%
metadata-eval92.5%
+-commutative92.5%
Simplified92.5%
Final simplification87.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -7.8) (not (<= z 1.0))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (/ x y) (+ -2.0 (/ 2.0 (* z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.8) || !(z <= 1.0)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + (-2.0 + (2.0 / (z * t)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-7.8d0)) .or. (.not. (z <= 1.0d0))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = (x / y) + ((-2.0d0) + (2.0d0 / (z * t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.8) || !(z <= 1.0)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + (-2.0 + (2.0 / (z * t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -7.8) or not (z <= 1.0): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = (x / y) + (-2.0 + (2.0 / (z * t))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -7.8) || !(z <= 1.0)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -7.8) || ~((z <= 1.0))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = (x / y) + (-2.0 + (2.0 / (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7.8], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{z \cdot t}\right)\\
\end{array}
\end{array}
if z < -7.79999999999999982 or 1 < z Initial program 73.3%
Taylor expanded in z around inf 98.5%
div-sub98.5%
sub-neg98.5%
*-inverses98.5%
metadata-eval98.5%
distribute-lft-in98.5%
associate-*r/98.5%
metadata-eval98.5%
metadata-eval98.5%
Simplified98.5%
if -7.79999999999999982 < z < 1Initial program 99.1%
Taylor expanded in t around inf 98.8%
*-commutative98.8%
associate-*r*98.8%
Simplified98.8%
Taylor expanded in t around inf 98.8%
sub-neg98.8%
associate-*r/98.8%
metadata-eval98.8%
metadata-eval98.8%
Simplified98.8%
Final simplification98.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -9.4e-8) (not (<= (/ x y) 9000.0))) (- (/ x y) 2.0) (+ -2.0 (/ (/ 2.0 z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -9.4e-8) || !((x / y) <= 9000.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 (((x / y) <= (-9.4d-8)) .or. (.not. ((x / y) <= 9000.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 (((x / y) <= -9.4e-8) || !((x / y) <= 9000.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 ((x / y) <= -9.4e-8) or not ((x / y) <= 9000.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 ((Float64(x / y) <= -9.4e-8) || !(Float64(x / y) <= 9000.0)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(-2.0 + Float64(Float64(2.0 / z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -9.4e-8) || ~(((x / y) <= 9000.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[N[(x / y), $MachinePrecision], -9.4e-8], N[Not[LessEqual[N[(x / y), $MachinePrecision], 9000.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -9.4 \cdot 10^{-8} \lor \neg \left(\frac{x}{y} \leq 9000\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -9.3999999999999995e-8 or 9e3 < (/.f64 x y) Initial program 84.7%
Taylor expanded in t around inf 73.5%
if -9.3999999999999995e-8 < (/.f64 x y) < 9e3Initial program 88.3%
+-commutative88.3%
remove-double-neg88.3%
distribute-frac-neg88.3%
unsub-neg88.3%
*-commutative88.3%
associate-*r*88.3%
distribute-rgt1-in88.3%
associate-/l*88.2%
fma-neg88.2%
*-commutative88.2%
fma-define88.2%
*-commutative88.2%
distribute-frac-neg88.2%
remove-double-neg88.2%
Simplified88.2%
Taylor expanded in t around inf 99.8%
sub-neg99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 98.6%
sub-neg98.6%
associate-*r/98.6%
metadata-eval98.6%
associate-/r*98.7%
metadata-eval98.7%
associate-*r/98.7%
associate-*l/98.6%
distribute-rgt-in98.6%
associate-*l/98.6%
*-lft-identity98.6%
metadata-eval98.6%
+-commutative98.6%
Simplified98.6%
Taylor expanded in z around 0 76.0%
Final simplification74.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -5.5e-7) (not (<= (/ x y) 1.18e-5))) (- (/ x y) 2.0) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5.5e-7) || !((x / y) <= 1.18e-5)) {
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) <= (-5.5d-7)) .or. (.not. ((x / y) <= 1.18d-5))) 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) <= -5.5e-7) || !((x / y) <= 1.18e-5)) {
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) <= -5.5e-7) or not ((x / y) <= 1.18e-5): 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) <= -5.5e-7) || !(Float64(x / y) <= 1.18e-5)) 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) <= -5.5e-7) || ~(((x / y) <= 1.18e-5))) 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], -5.5e-7], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1.18e-5]], $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 -5.5 \cdot 10^{-7} \lor \neg \left(\frac{x}{y} \leq 1.18 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -5.5000000000000003e-7 or 1.18000000000000005e-5 < (/.f64 x y) Initial program 84.3%
Taylor expanded in t around inf 72.6%
if -5.5000000000000003e-7 < (/.f64 x y) < 1.18000000000000005e-5Initial program 88.9%
+-commutative88.9%
remove-double-neg88.9%
distribute-frac-neg88.9%
unsub-neg88.9%
*-commutative88.9%
associate-*r*88.9%
distribute-rgt1-in88.9%
associate-/l*88.7%
fma-neg88.7%
*-commutative88.7%
fma-define88.7%
*-commutative88.7%
distribute-frac-neg88.7%
remove-double-neg88.7%
Simplified88.7%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
distribute-lft-in99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
metadata-eval99.9%
associate-*r/99.9%
associate-*l/99.8%
distribute-rgt-in99.8%
associate-*l/99.9%
*-lft-identity99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 59.5%
sub-neg59.5%
associate-*r/59.5%
metadata-eval59.5%
metadata-eval59.5%
Simplified59.5%
Final simplification66.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1.7e+30) (not (<= (/ x y) 98000.0))) (/ x y) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.7e+30) || !((x / y) <= 98000.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) <= (-1.7d+30)) .or. (.not. ((x / y) <= 98000.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) <= -1.7e+30) || !((x / y) <= 98000.0)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1.7e+30) or not ((x / y) <= 98000.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) <= -1.7e+30) || !(Float64(x / y) <= 98000.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) <= -1.7e+30) || ~(((x / y) <= 98000.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], -1.7e+30], N[Not[LessEqual[N[(x / y), $MachinePrecision], 98000.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 -1.7 \cdot 10^{+30} \lor \neg \left(\frac{x}{y} \leq 98000\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.7000000000000001e30 or 98000 < (/.f64 x y) Initial program 84.3%
Taylor expanded in x around inf 75.4%
if -1.7000000000000001e30 < (/.f64 x y) < 98000Initial program 88.5%
+-commutative88.5%
remove-double-neg88.5%
distribute-frac-neg88.5%
unsub-neg88.5%
*-commutative88.5%
associate-*r*88.5%
distribute-rgt1-in88.5%
associate-/l*88.3%
fma-neg88.3%
*-commutative88.3%
fma-define88.3%
*-commutative88.3%
distribute-frac-neg88.3%
remove-double-neg88.3%
Simplified88.3%
Taylor expanded in t around inf 99.8%
sub-neg99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 96.0%
sub-neg96.0%
associate-*r/96.0%
metadata-eval96.0%
associate-/r*96.1%
metadata-eval96.1%
associate-*r/96.1%
associate-*l/96.0%
distribute-rgt-in96.0%
associate-*l/96.0%
*-lft-identity96.0%
metadata-eval96.0%
+-commutative96.0%
Simplified96.0%
Taylor expanded in z around inf 56.8%
sub-neg56.8%
associate-*r/56.8%
metadata-eval56.8%
metadata-eval56.8%
Simplified56.8%
Final simplification65.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -6.8e-41) (not (<= t 9.2e+16))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -6.8e-41) || !(t <= 9.2e+16)) {
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 <= (-6.8d-41)) .or. (.not. (t <= 9.2d+16))) 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 <= -6.8e-41) || !(t <= 9.2e+16)) {
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 <= -6.8e-41) or not (t <= 9.2e+16): 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 <= -6.8e-41) || !(t <= 9.2e+16)) 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 <= -6.8e-41) || ~((t <= 9.2e+16))) 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, -6.8e-41], N[Not[LessEqual[t, 9.2e+16]], $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 -6.8 \cdot 10^{-41} \lor \neg \left(t \leq 9.2 \cdot 10^{+16}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -6.7999999999999997e-41 or 9.2e16 < t Initial program 75.2%
Taylor expanded in t around inf 85.0%
if -6.7999999999999997e-41 < t < 9.2e16Initial program 98.9%
Taylor expanded in t around 0 82.0%
associate-*r/82.0%
metadata-eval82.0%
Simplified82.0%
Final simplification83.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -17.5) (not (<= (/ x y) 1800.0))) (/ x y) -2.0))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -17.5) || !((x / y) <= 1800.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) <= (-17.5d0)) .or. (.not. ((x / y) <= 1800.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) <= -17.5) || !((x / y) <= 1800.0)) {
tmp = x / y;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -17.5) or not ((x / y) <= 1800.0): tmp = x / y else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -17.5) || !(Float64(x / y) <= 1800.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) <= -17.5) || ~(((x / y) <= 1800.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], -17.5], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1800.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], -2.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -17.5 \lor \neg \left(\frac{x}{y} \leq 1800\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if (/.f64 x y) < -17.5 or 1800 < (/.f64 x y) Initial program 84.2%
Taylor expanded in x around inf 73.4%
if -17.5 < (/.f64 x y) < 1800Initial program 88.7%
+-commutative88.7%
remove-double-neg88.7%
distribute-frac-neg88.7%
unsub-neg88.7%
*-commutative88.7%
associate-*r*88.7%
distribute-rgt1-in88.7%
associate-/l*88.5%
fma-neg88.5%
*-commutative88.5%
fma-define88.5%
*-commutative88.5%
distribute-frac-neg88.5%
remove-double-neg88.5%
Simplified88.5%
Taylor expanded in t around inf 99.8%
sub-neg99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 97.2%
sub-neg97.2%
associate-*r/97.2%
metadata-eval97.2%
associate-/r*97.2%
metadata-eval97.2%
associate-*r/97.2%
associate-*l/97.1%
distribute-rgt-in97.1%
associate-*l/97.2%
*-lft-identity97.2%
metadata-eval97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in t around inf 36.3%
Final simplification53.8%
(FPCore (x y z t) :precision binary64 (if (<= t -1e-41) (- (/ x y) 2.0) (if (<= t 4.4e+16) (/ (+ 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 <= -1e-41) {
tmp = (x / y) - 2.0;
} else if (t <= 4.4e+16) {
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 <= (-1d-41)) then
tmp = (x / y) - 2.0d0
else if (t <= 4.4d+16) 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 <= -1e-41) {
tmp = (x / y) - 2.0;
} else if (t <= 4.4e+16) {
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 <= -1e-41: tmp = (x / y) - 2.0 elif t <= 4.4e+16: 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 <= -1e-41) tmp = Float64(Float64(x / y) - 2.0); elseif (t <= 4.4e+16) 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 <= -1e-41) tmp = (x / y) - 2.0; elseif (t <= 4.4e+16) 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, -1e-41], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], If[LessEqual[t, 4.4e+16], 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 \cdot 10^{-41}:\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{+16}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot -2}{y}\\
\end{array}
\end{array}
if t < -1.00000000000000001e-41Initial program 80.3%
Taylor expanded in t around inf 83.9%
if -1.00000000000000001e-41 < t < 4.4e16Initial program 98.9%
Taylor expanded in t around 0 82.0%
associate-*r/82.0%
metadata-eval82.0%
Simplified82.0%
if 4.4e16 < t Initial program 69.3%
Taylor expanded in t around inf 86.2%
Taylor expanded in y around 0 86.2%
+-commutative86.2%
*-commutative86.2%
Simplified86.2%
Final simplification83.6%
(FPCore (x y z t) :precision binary64 (if (<= t -1.0) -2.0 (if (<= t 32000000.0) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.0) {
tmp = -2.0;
} else if (t <= 32000000.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.0d0)) then
tmp = -2.0d0
else if (t <= 32000000.0d0) then
tmp = 2.0d0 / t
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.0) {
tmp = -2.0;
} else if (t <= 32000000.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.0: tmp = -2.0 elif t <= 32000000.0: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.0) tmp = -2.0; elseif (t <= 32000000.0) tmp = Float64(2.0 / t); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.0) tmp = -2.0; elseif (t <= 32000000.0) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.0], -2.0, If[LessEqual[t, 32000000.0], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 32000000:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1 or 3.2e7 < t Initial program 73.6%
+-commutative73.6%
remove-double-neg73.6%
distribute-frac-neg73.6%
unsub-neg73.6%
*-commutative73.6%
associate-*r*73.6%
distribute-rgt1-in73.6%
associate-/l*73.5%
fma-neg73.5%
*-commutative73.5%
fma-define73.5%
*-commutative73.5%
distribute-frac-neg73.5%
remove-double-neg73.5%
Simplified73.5%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
distribute-lft-in99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 51.0%
sub-neg51.0%
associate-*r/51.0%
metadata-eval51.0%
associate-/r*51.0%
metadata-eval51.0%
associate-*r/51.0%
associate-*l/50.9%
distribute-rgt-in50.9%
associate-*l/51.0%
*-lft-identity51.0%
metadata-eval51.0%
+-commutative51.0%
Simplified51.0%
Taylor expanded in t around inf 39.4%
if -1 < t < 3.2e7Initial program 99.0%
Taylor expanded in t around 0 78.9%
associate-*r/78.9%
metadata-eval78.9%
Simplified78.9%
Taylor expanded in z around inf 32.6%
(FPCore (x y z t) :precision binary64 -2.0)
double code(double x, double y, double z, double t) {
return -2.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -2.0d0
end function
public static double code(double x, double y, double z, double t) {
return -2.0;
}
def code(x, y, z, t): return -2.0
function code(x, y, z, t) return -2.0 end
function tmp = code(x, y, z, t) tmp = -2.0; end
code[x_, y_, z_, t_] := -2.0
\begin{array}{l}
\\
-2
\end{array}
Initial program 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-/l*86.5%
fma-neg86.5%
*-commutative86.5%
fma-define86.5%
*-commutative86.5%
distribute-frac-neg86.5%
remove-double-neg86.5%
Simplified86.5%
Taylor expanded in t around inf 99.5%
sub-neg99.5%
+-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
associate-*r/99.5%
distribute-lft-in99.5%
metadata-eval99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 65.7%
sub-neg65.7%
associate-*r/65.7%
metadata-eval65.7%
associate-/r*65.8%
metadata-eval65.8%
associate-*r/65.8%
associate-*l/65.7%
distribute-rgt-in65.7%
associate-*l/65.8%
*-lft-identity65.8%
metadata-eval65.8%
+-commutative65.8%
Simplified65.8%
Taylor expanded in t around inf 20.5%
(FPCore (x y z t) :precision binary64 (- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y))))
double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((2.0d0 / z) + 2.0d0) / t) - (2.0d0 - (x / y))
end function
public static double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
def code(x, y, z, t): return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(2.0 / z) + 2.0) / t) - Float64(2.0 - Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = (((2.0 / z) + 2.0) / t) - (2.0 - (x / y)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(2.0 / z), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] - N[(2.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{2}{z} + 2}{t} - \left(2 - \frac{x}{y}\right)
\end{array}
herbie shell --seed 2024146
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:alt
(! :herbie-platform default (- (/ (+ (/ 2 z) 2) t) (- 2 (/ x y))))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))