
(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 12 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 (+ (+ -2.0 (/ x y)) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
return (-2.0 + (x / y)) + ((2.0 + (2.0 / z)) / t);
}
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) + (x / y)) + ((2.0d0 + (2.0d0 / z)) / t)
end function
public static double code(double x, double y, double z, double t) {
return (-2.0 + (x / y)) + ((2.0 + (2.0 / z)) / t);
}
def code(x, y, z, t): return (-2.0 + (x / y)) + ((2.0 + (2.0 / z)) / t)
function code(x, y, z, t) return Float64(Float64(-2.0 + Float64(x / y)) + Float64(Float64(2.0 + Float64(2.0 / z)) / t)) end
function tmp = code(x, y, z, t) tmp = (-2.0 + (x / y)) + ((2.0 + (2.0 / z)) / t); end
code[x_, y_, z_, t_] := N[(N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-2 + \frac{x}{y}\right) + \frac{2 + \frac{2}{z}}{t}
\end{array}
Initial program 88.8%
+-commutative88.8%
remove-double-neg88.8%
distribute-frac-neg88.8%
unsub-neg88.8%
*-commutative88.8%
associate-*r*88.8%
distribute-rgt1-in88.8%
associate-/l*88.8%
fma-neg88.8%
*-commutative88.8%
fma-define88.8%
*-commutative88.8%
distribute-frac-neg88.8%
remove-double-neg88.8%
Simplified88.8%
Taylor expanded in t around inf 99.5%
associate--l+99.5%
+-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
+-commutative99.5%
associate-*r/99.5%
distribute-lft-in99.5%
metadata-eval99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 2.0 (* z t))) (t_2 (+ -2.0 (/ 2.0 t))))
(if (<= (/ x y) -76.0)
(- (/ x y) 2.0)
(if (<= (/ x y) -2.85e-49)
t_2
(if (<= (/ x y) -1.2e-77)
t_1
(if (<= (/ x y) -1.7e-251)
t_2
(if (<= (/ x y) -5e-312)
t_1
(if (<= (/ x y) 8e+23) t_2 (/ x y)))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 / (z * t);
double t_2 = -2.0 + (2.0 / t);
double tmp;
if ((x / y) <= -76.0) {
tmp = (x / y) - 2.0;
} else if ((x / y) <= -2.85e-49) {
tmp = t_2;
} else if ((x / y) <= -1.2e-77) {
tmp = t_1;
} else if ((x / y) <= -1.7e-251) {
tmp = t_2;
} else if ((x / y) <= -5e-312) {
tmp = t_1;
} else if ((x / y) <= 8e+23) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = 2.0d0 / (z * t)
t_2 = (-2.0d0) + (2.0d0 / t)
if ((x / y) <= (-76.0d0)) then
tmp = (x / y) - 2.0d0
else if ((x / y) <= (-2.85d-49)) then
tmp = t_2
else if ((x / y) <= (-1.2d-77)) then
tmp = t_1
else if ((x / y) <= (-1.7d-251)) then
tmp = t_2
else if ((x / y) <= (-5d-312)) then
tmp = t_1
else if ((x / y) <= 8d+23) then
tmp = t_2
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 / (z * t);
double t_2 = -2.0 + (2.0 / t);
double tmp;
if ((x / y) <= -76.0) {
tmp = (x / y) - 2.0;
} else if ((x / y) <= -2.85e-49) {
tmp = t_2;
} else if ((x / y) <= -1.2e-77) {
tmp = t_1;
} else if ((x / y) <= -1.7e-251) {
tmp = t_2;
} else if ((x / y) <= -5e-312) {
tmp = t_1;
} else if ((x / y) <= 8e+23) {
tmp = t_2;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 / (z * t) t_2 = -2.0 + (2.0 / t) tmp = 0 if (x / y) <= -76.0: tmp = (x / y) - 2.0 elif (x / y) <= -2.85e-49: tmp = t_2 elif (x / y) <= -1.2e-77: tmp = t_1 elif (x / y) <= -1.7e-251: tmp = t_2 elif (x / y) <= -5e-312: tmp = t_1 elif (x / y) <= 8e+23: tmp = t_2 else: tmp = x / y return tmp
function code(x, y, z, t) t_1 = Float64(2.0 / Float64(z * t)) t_2 = Float64(-2.0 + Float64(2.0 / t)) tmp = 0.0 if (Float64(x / y) <= -76.0) tmp = Float64(Float64(x / y) - 2.0); elseif (Float64(x / y) <= -2.85e-49) tmp = t_2; elseif (Float64(x / y) <= -1.2e-77) tmp = t_1; elseif (Float64(x / y) <= -1.7e-251) tmp = t_2; elseif (Float64(x / y) <= -5e-312) tmp = t_1; elseif (Float64(x / y) <= 8e+23) tmp = t_2; else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 / (z * t); t_2 = -2.0 + (2.0 / t); tmp = 0.0; if ((x / y) <= -76.0) tmp = (x / y) - 2.0; elseif ((x / y) <= -2.85e-49) tmp = t_2; elseif ((x / y) <= -1.2e-77) tmp = t_1; elseif ((x / y) <= -1.7e-251) tmp = t_2; elseif ((x / y) <= -5e-312) tmp = t_1; elseif ((x / y) <= 8e+23) tmp = t_2; else tmp = x / y; 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[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -76.0], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -2.85e-49], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], -1.2e-77], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -1.7e-251], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], -5e-312], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 8e+23], t$95$2, N[(x / y), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{z \cdot t}\\
t_2 := -2 + \frac{2}{t}\\
\mathbf{if}\;\frac{x}{y} \leq -76:\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{elif}\;\frac{x}{y} \leq -2.85 \cdot 10^{-49}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\frac{x}{y} \leq -1.2 \cdot 10^{-77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq -1.7 \cdot 10^{-251}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{-312}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 8 \cdot 10^{+23}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -76Initial program 88.6%
Taylor expanded in t around inf 74.8%
if -76 < (/.f64 x y) < -2.8500000000000002e-49 or -1.19999999999999995e-77 < (/.f64 x y) < -1.70000000000000008e-251 or -5.0000000000022e-312 < (/.f64 x y) < 7.9999999999999993e23Initial program 88.1%
Taylor expanded in z around inf 71.1%
div-sub71.1%
sub-neg71.1%
*-inverses71.1%
metadata-eval71.1%
distribute-lft-in71.1%
metadata-eval71.1%
associate-*r/71.1%
metadata-eval71.1%
Simplified71.1%
Taylor expanded in x around 0 70.5%
sub-neg70.5%
associate-*r/70.5%
metadata-eval70.5%
metadata-eval70.5%
Simplified70.5%
if -2.8500000000000002e-49 < (/.f64 x y) < -1.19999999999999995e-77 or -1.70000000000000008e-251 < (/.f64 x y) < -5.0000000000022e-312Initial program 92.4%
+-commutative92.4%
remove-double-neg92.4%
distribute-frac-neg92.4%
unsub-neg92.4%
*-commutative92.4%
associate-*r*92.4%
distribute-rgt1-in92.4%
associate-/l*92.4%
fma-neg92.4%
*-commutative92.4%
fma-define92.4%
*-commutative92.4%
distribute-frac-neg92.4%
remove-double-neg92.4%
Simplified92.4%
Taylor expanded in t around inf 99.8%
associate--l+99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 89.4%
if 7.9999999999999993e23 < (/.f64 x y) Initial program 89.7%
Taylor expanded in x around inf 69.0%
Final simplification72.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ 2.0 t))) (t_2 (+ (/ x y) (/ 2.0 t))))
(if (<= (/ x y) -2.0)
t_2
(if (<= (/ x y) -3.8e-251)
t_1
(if (<= (/ x y) -5e-312)
(/ 2.0 (* z t))
(if (<= (/ x y) 0.105) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (2.0 / t);
double t_2 = (x / y) + (2.0 / t);
double tmp;
if ((x / y) <= -2.0) {
tmp = t_2;
} else if ((x / y) <= -3.8e-251) {
tmp = t_1;
} else if ((x / y) <= -5e-312) {
tmp = 2.0 / (z * t);
} else if ((x / y) <= 0.105) {
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) + (2.0d0 / t)
t_2 = (x / y) + (2.0d0 / t)
if ((x / y) <= (-2.0d0)) then
tmp = t_2
else if ((x / y) <= (-3.8d-251)) then
tmp = t_1
else if ((x / y) <= (-5d-312)) then
tmp = 2.0d0 / (z * t)
else if ((x / y) <= 0.105d0) 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 + (2.0 / t);
double t_2 = (x / y) + (2.0 / t);
double tmp;
if ((x / y) <= -2.0) {
tmp = t_2;
} else if ((x / y) <= -3.8e-251) {
tmp = t_1;
} else if ((x / y) <= -5e-312) {
tmp = 2.0 / (z * t);
} else if ((x / y) <= 0.105) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (2.0 / t) t_2 = (x / y) + (2.0 / t) tmp = 0 if (x / y) <= -2.0: tmp = t_2 elif (x / y) <= -3.8e-251: tmp = t_1 elif (x / y) <= -5e-312: tmp = 2.0 / (z * t) elif (x / y) <= 0.105: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(2.0 / t)) t_2 = Float64(Float64(x / y) + Float64(2.0 / t)) tmp = 0.0 if (Float64(x / y) <= -2.0) tmp = t_2; elseif (Float64(x / y) <= -3.8e-251) tmp = t_1; elseif (Float64(x / y) <= -5e-312) tmp = Float64(2.0 / Float64(z * t)); elseif (Float64(x / y) <= 0.105) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + (2.0 / t); t_2 = (x / y) + (2.0 / t); tmp = 0.0; if ((x / y) <= -2.0) tmp = t_2; elseif ((x / y) <= -3.8e-251) tmp = t_1; elseif ((x / y) <= -5e-312) tmp = 2.0 / (z * t); elseif ((x / y) <= 0.105) 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[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -2.0], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], -3.8e-251], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -5e-312], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 0.105], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{2}{t}\\
t_2 := \frac{x}{y} + \frac{2}{t}\\
\mathbf{if}\;\frac{x}{y} \leq -2:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\frac{x}{y} \leq -3.8 \cdot 10^{-251}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{-312}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{elif}\;\frac{x}{y} \leq 0.105:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 x y) < -2 or 0.104999999999999996 < (/.f64 x y) Initial program 89.6%
Taylor expanded in t around 0 98.8%
Taylor expanded in z around inf 77.9%
associate-*r/77.9%
metadata-eval77.9%
Simplified77.9%
if -2 < (/.f64 x y) < -3.7999999999999997e-251 or -5.0000000000022e-312 < (/.f64 x y) < 0.104999999999999996Initial program 88.2%
Taylor expanded in z around inf 68.9%
div-sub68.9%
sub-neg68.9%
*-inverses68.9%
metadata-eval68.9%
distribute-lft-in68.9%
metadata-eval68.9%
associate-*r/68.9%
metadata-eval68.9%
Simplified68.9%
Taylor expanded in x around 0 68.4%
sub-neg68.4%
associate-*r/68.4%
metadata-eval68.4%
metadata-eval68.4%
Simplified68.4%
if -3.7999999999999997e-251 < (/.f64 x y) < -5.0000000000022e-312Initial program 87.1%
+-commutative87.1%
remove-double-neg87.1%
distribute-frac-neg87.1%
unsub-neg87.1%
*-commutative87.1%
associate-*r*87.1%
distribute-rgt1-in87.1%
associate-/l*87.1%
fma-neg87.1%
*-commutative87.1%
fma-define87.1%
*-commutative87.1%
distribute-frac-neg87.1%
remove-double-neg87.1%
Simplified87.1%
Taylor expanded in t around inf 99.6%
associate--l+99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
associate-*r/99.6%
distribute-lft-in99.6%
metadata-eval99.6%
associate-*r/99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 87.5%
Final simplification73.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -5.6e-26)
t_1
(if (<= t 6.5e-53)
(/ (+ 2.0 (/ 2.0 z)) t)
(if (<= t 0.00116)
(+ (/ x y) (/ 2.0 t))
(if (<= t 4.7e+35) (/ 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.6e-26) {
tmp = t_1;
} else if (t <= 6.5e-53) {
tmp = (2.0 + (2.0 / z)) / t;
} else if (t <= 0.00116) {
tmp = (x / y) + (2.0 / t);
} else if (t <= 4.7e+35) {
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.6d-26)) then
tmp = t_1
else if (t <= 6.5d-53) then
tmp = (2.0d0 + (2.0d0 / z)) / t
else if (t <= 0.00116d0) then
tmp = (x / y) + (2.0d0 / t)
else if (t <= 4.7d+35) 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.6e-26) {
tmp = t_1;
} else if (t <= 6.5e-53) {
tmp = (2.0 + (2.0 / z)) / t;
} else if (t <= 0.00116) {
tmp = (x / y) + (2.0 / t);
} else if (t <= 4.7e+35) {
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.6e-26: tmp = t_1 elif t <= 6.5e-53: tmp = (2.0 + (2.0 / z)) / t elif t <= 0.00116: tmp = (x / y) + (2.0 / t) elif t <= 4.7e+35: 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.6e-26) tmp = t_1; elseif (t <= 6.5e-53) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); elseif (t <= 0.00116) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); elseif (t <= 4.7e+35) 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.6e-26) tmp = t_1; elseif (t <= 6.5e-53) tmp = (2.0 + (2.0 / z)) / t; elseif (t <= 0.00116) tmp = (x / y) + (2.0 / t); elseif (t <= 4.7e+35) 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.6e-26], t$95$1, If[LessEqual[t, 6.5e-53], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 0.00116], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.7e+35], 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.6 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-53}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{elif}\;t \leq 0.00116:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{elif}\;t \leq 4.7 \cdot 10^{+35}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.6000000000000002e-26 or 4.70000000000000033e35 < t Initial program 77.9%
Taylor expanded in t around inf 83.0%
if -5.6000000000000002e-26 < t < 6.4999999999999997e-53Initial program 98.8%
Taylor expanded in t around 0 84.4%
associate-*r/84.4%
metadata-eval84.4%
Simplified84.4%
if 6.4999999999999997e-53 < t < 0.00116Initial program 100.0%
Taylor expanded in t around 0 98.0%
Taylor expanded in z around inf 98.0%
associate-*r/98.0%
metadata-eval98.0%
Simplified98.0%
if 0.00116 < t < 4.70000000000000033e35Initial program 99.5%
+-commutative99.5%
remove-double-neg99.5%
distribute-frac-neg99.5%
unsub-neg99.5%
*-commutative99.5%
associate-*r*99.5%
distribute-rgt1-in99.5%
associate-/l*99.7%
fma-neg99.7%
*-commutative99.7%
fma-define99.7%
*-commutative99.7%
distribute-frac-neg99.7%
remove-double-neg99.7%
Simplified99.7%
Taylor expanded in t around inf 99.8%
associate--l+99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 67.7%
Final simplification83.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ 2.0 (/ 2.0 z)) t)))
(if (or (<= (/ x y) -20000000000.0) (not (<= (/ x y) 0.0001)))
(+ (/ x y) t_1)
(+ -2.0 t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 + (2.0 / z)) / t;
double tmp;
if (((x / y) <= -20000000000.0) || !((x / y) <= 0.0001)) {
tmp = (x / y) + t_1;
} else {
tmp = -2.0 + 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 = (2.0d0 + (2.0d0 / z)) / t
if (((x / y) <= (-20000000000.0d0)) .or. (.not. ((x / y) <= 0.0001d0))) then
tmp = (x / y) + t_1
else
tmp = (-2.0d0) + t_1
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) <= -20000000000.0) || !((x / y) <= 0.0001)) {
tmp = (x / y) + t_1;
} else {
tmp = -2.0 + t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 + (2.0 / z)) / t tmp = 0 if ((x / y) <= -20000000000.0) or not ((x / y) <= 0.0001): tmp = (x / y) + t_1 else: tmp = -2.0 + t_1 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) <= -20000000000.0) || !(Float64(x / y) <= 0.0001)) tmp = Float64(Float64(x / y) + t_1); else tmp = Float64(-2.0 + t_1); 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) <= -20000000000.0) || ~(((x / y) <= 0.0001))) tmp = (x / y) + t_1; else tmp = -2.0 + t_1; 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[Or[LessEqual[N[(x / y), $MachinePrecision], -20000000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 0.0001]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + t$95$1), $MachinePrecision], N[(-2.0 + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2 + \frac{2}{z}}{t}\\
\mathbf{if}\;\frac{x}{y} \leq -20000000000 \lor \neg \left(\frac{x}{y} \leq 0.0001\right):\\
\;\;\;\;\frac{x}{y} + t\_1\\
\mathbf{else}:\\
\;\;\;\;-2 + t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -2e10 or 1.00000000000000005e-4 < (/.f64 x y) Initial program 89.6%
Taylor expanded in t around 0 98.8%
Taylor expanded in x around 0 98.8%
+-commutative98.8%
+-commutative98.8%
associate-+l+98.8%
associate-/r*98.9%
associate-*r/98.9%
*-commutative98.9%
associate-/l*98.9%
*-commutative98.9%
distribute-lft-in98.9%
+-commutative98.9%
associate-*l/98.9%
*-lft-identity98.9%
Simplified98.9%
if -2e10 < (/.f64 x y) < 1.00000000000000005e-4Initial program 88.2%
+-commutative88.2%
remove-double-neg88.2%
distribute-frac-neg88.2%
unsub-neg88.2%
*-commutative88.2%
associate-*r*88.2%
distribute-rgt1-in88.2%
associate-/l*88.1%
fma-neg88.1%
*-commutative88.1%
fma-define88.1%
*-commutative88.1%
distribute-frac-neg88.1%
remove-double-neg88.1%
Simplified88.1%
Taylor expanded in t around inf 99.9%
associate--l+99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.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.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
*-commutative99.4%
associate-/r*99.4%
associate-*r/99.4%
*-commutative99.4%
associate-/l*99.3%
distribute-lft-in99.3%
associate-*l/99.4%
*-lft-identity99.4%
Simplified99.4%
Final simplification99.2%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -4e+116) (not (<= (/ x y) 4.7e+22))) (+ (/ x y) (/ 2.0 t)) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -4e+116) || !((x / y) <= 4.7e+22)) {
tmp = (x / y) + (2.0 / t);
} 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) <= (-4d+116)) .or. (.not. ((x / y) <= 4.7d+22))) then
tmp = (x / y) + (2.0d0 / t)
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) <= -4e+116) || !((x / y) <= 4.7e+22)) {
tmp = (x / y) + (2.0 / t);
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -4e+116) or not ((x / y) <= 4.7e+22): tmp = (x / y) + (2.0 / t) 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) <= -4e+116) || !(Float64(x / y) <= 4.7e+22)) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); 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) <= -4e+116) || ~(((x / y) <= 4.7e+22))) tmp = (x / y) + (2.0 / t); 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], -4e+116], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4.7e+22]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $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 -4 \cdot 10^{+116} \lor \neg \left(\frac{x}{y} \leq 4.7 \cdot 10^{+22}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -4.00000000000000006e116 or 4.70000000000000021e22 < (/.f64 x y) Initial program 90.2%
Taylor expanded in t around 0 99.0%
Taylor expanded in z around inf 83.5%
associate-*r/83.5%
metadata-eval83.5%
Simplified83.5%
if -4.00000000000000006e116 < (/.f64 x y) < 4.70000000000000021e22Initial program 87.9%
+-commutative87.9%
remove-double-neg87.9%
distribute-frac-neg87.9%
unsub-neg87.9%
*-commutative87.9%
associate-*r*87.9%
distribute-rgt1-in87.9%
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.9%
associate--l+99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.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 94.3%
sub-neg94.3%
metadata-eval94.3%
+-commutative94.3%
*-commutative94.3%
associate-/r*94.3%
associate-*r/94.3%
*-commutative94.3%
associate-/l*94.3%
distribute-lft-in94.3%
associate-*l/94.4%
*-lft-identity94.4%
Simplified94.4%
Final simplification90.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -13000000.0) (not (<= (/ x y) 7e+23))) (+ (/ x y) (/ 2.0 (* z t))) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -13000000.0) || !((x / y) <= 7e+23)) {
tmp = (x / y) + (2.0 / (z * t));
} 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) <= (-13000000.0d0)) .or. (.not. ((x / y) <= 7d+23))) then
tmp = (x / y) + (2.0d0 / (z * t))
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) <= -13000000.0) || !((x / y) <= 7e+23)) {
tmp = (x / y) + (2.0 / (z * t));
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -13000000.0) or not ((x / y) <= 7e+23): tmp = (x / y) + (2.0 / (z * t)) 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) <= -13000000.0) || !(Float64(x / y) <= 7e+23)) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(z * t))); 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) <= -13000000.0) || ~(((x / y) <= 7e+23))) tmp = (x / y) + (2.0 / (z * t)); 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], -13000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 7e+23]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(z * t), $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 -13000000 \lor \neg \left(\frac{x}{y} \leq 7 \cdot 10^{+23}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.3e7 or 7.0000000000000004e23 < (/.f64 x y) Initial program 89.1%
Taylor expanded in z around 0 91.1%
if -1.3e7 < (/.f64 x y) < 7.0000000000000004e23Initial program 88.6%
+-commutative88.6%
remove-double-neg88.6%
distribute-frac-neg88.6%
unsub-neg88.6%
*-commutative88.6%
associate-*r*88.6%
distribute-rgt1-in88.6%
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.9%
associate--l+99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.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.0%
sub-neg99.0%
metadata-eval99.0%
+-commutative99.0%
*-commutative99.0%
associate-/r*99.0%
associate-*r/99.0%
*-commutative99.0%
associate-/l*99.0%
distribute-lft-in98.9%
associate-*l/99.1%
*-lft-identity99.1%
Simplified99.1%
Final simplification95.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -20000000000.0) (not (<= (/ x y) 5e+23))) (+ (/ 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) <= -20000000000.0) || !((x / y) <= 5e+23)) {
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) <= (-20000000000.0d0)) .or. (.not. ((x / y) <= 5d+23))) 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) <= -20000000000.0) || !((x / y) <= 5e+23)) {
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) <= -20000000000.0) or not ((x / y) <= 5e+23): 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) <= -20000000000.0) || !(Float64(x / y) <= 5e+23)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / 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) <= -20000000000.0) || ~(((x / y) <= 5e+23))) 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], -20000000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 5e+23]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $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 -20000000000 \lor \neg \left(\frac{x}{y} \leq 5 \cdot 10^{+23}\right):\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -2e10 or 4.9999999999999999e23 < (/.f64 x y) Initial program 89.1%
Taylor expanded in z around 0 91.1%
associate-/r*91.1%
Simplified91.1%
if -2e10 < (/.f64 x y) < 4.9999999999999999e23Initial program 88.6%
+-commutative88.6%
remove-double-neg88.6%
distribute-frac-neg88.6%
unsub-neg88.6%
*-commutative88.6%
associate-*r*88.6%
distribute-rgt1-in88.6%
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.9%
associate--l+99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.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.0%
sub-neg99.0%
metadata-eval99.0%
+-commutative99.0%
*-commutative99.0%
associate-/r*99.0%
associate-*r/99.0%
*-commutative99.0%
associate-/l*99.0%
distribute-lft-in98.9%
associate-*l/99.1%
*-lft-identity99.1%
Simplified99.1%
Final simplification95.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -440000000.0) (not (<= (/ x y) 1.18e+24))) (/ x y) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -440000000.0) || !((x / y) <= 1.18e+24)) {
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) <= (-440000000.0d0)) .or. (.not. ((x / y) <= 1.18d+24))) 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) <= -440000000.0) || !((x / y) <= 1.18e+24)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -440000000.0) or not ((x / y) <= 1.18e+24): 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) <= -440000000.0) || !(Float64(x / y) <= 1.18e+24)) 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) <= -440000000.0) || ~(((x / y) <= 1.18e+24))) 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], -440000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1.18e+24]], $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 -440000000 \lor \neg \left(\frac{x}{y} \leq 1.18 \cdot 10^{+24}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -4.4e8 or 1.17999999999999997e24 < (/.f64 x y) Initial program 89.1%
Taylor expanded in x around inf 71.7%
if -4.4e8 < (/.f64 x y) < 1.17999999999999997e24Initial program 88.6%
Taylor expanded in z around inf 64.9%
div-sub64.9%
sub-neg64.9%
*-inverses64.9%
metadata-eval64.9%
distribute-lft-in64.9%
metadata-eval64.9%
associate-*r/64.9%
metadata-eval64.9%
Simplified64.9%
Taylor expanded in x around 0 64.3%
sub-neg64.3%
associate-*r/64.3%
metadata-eval64.3%
metadata-eval64.3%
Simplified64.3%
Final simplification67.8%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -115000.0) (- (/ x y) 2.0) (if (<= (/ x y) 5.2e+23) (+ -2.0 (/ 2.0 t)) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -115000.0) {
tmp = (x / y) - 2.0;
} else if ((x / y) <= 5.2e+23) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-115000.0d0)) then
tmp = (x / y) - 2.0d0
else if ((x / y) <= 5.2d+23) then
tmp = (-2.0d0) + (2.0d0 / t)
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -115000.0) {
tmp = (x / y) - 2.0;
} else if ((x / y) <= 5.2e+23) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -115000.0: tmp = (x / y) - 2.0 elif (x / y) <= 5.2e+23: tmp = -2.0 + (2.0 / t) else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -115000.0) tmp = Float64(Float64(x / y) - 2.0); elseif (Float64(x / y) <= 5.2e+23) tmp = Float64(-2.0 + Float64(2.0 / t)); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -115000.0) tmp = (x / y) - 2.0; elseif ((x / y) <= 5.2e+23) tmp = -2.0 + (2.0 / t); else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -115000.0], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5.2e+23], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -115000:\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{elif}\;\frac{x}{y} \leq 5.2 \cdot 10^{+23}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -115000Initial program 88.6%
Taylor expanded in t around inf 74.8%
if -115000 < (/.f64 x y) < 5.19999999999999983e23Initial program 88.6%
Taylor expanded in z around inf 64.9%
div-sub64.9%
sub-neg64.9%
*-inverses64.9%
metadata-eval64.9%
distribute-lft-in64.9%
metadata-eval64.9%
associate-*r/64.9%
metadata-eval64.9%
Simplified64.9%
Taylor expanded in x around 0 64.3%
sub-neg64.3%
associate-*r/64.3%
metadata-eval64.3%
metadata-eval64.3%
Simplified64.3%
if 5.19999999999999983e23 < (/.f64 x y) Initial program 89.7%
Taylor expanded in x around inf 69.0%
Final simplification67.9%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2200000000.0) (not (<= (/ x y) 5.6e+23))) (/ x y) (/ 2.0 t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2200000000.0) || !((x / y) <= 5.6e+23)) {
tmp = x / y;
} else {
tmp = 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) <= (-2200000000.0d0)) .or. (.not. ((x / y) <= 5.6d+23))) then
tmp = x / y
else
tmp = 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) <= -2200000000.0) || !((x / y) <= 5.6e+23)) {
tmp = x / y;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2200000000.0) or not ((x / y) <= 5.6e+23): tmp = x / y else: tmp = 2.0 / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2200000000.0) || !(Float64(x / y) <= 5.6e+23)) tmp = Float64(x / y); else tmp = Float64(2.0 / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2200000000.0) || ~(((x / y) <= 5.6e+23))) tmp = x / y; else tmp = 2.0 / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2200000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 5.6e+23]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(2.0 / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2200000000 \lor \neg \left(\frac{x}{y} \leq 5.6 \cdot 10^{+23}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -2.2e9 or 5.6e23 < (/.f64 x y) Initial program 89.1%
Taylor expanded in x around inf 71.7%
if -2.2e9 < (/.f64 x y) < 5.6e23Initial program 88.6%
Taylor expanded in t around 0 67.5%
associate-*r/67.5%
metadata-eval67.5%
Simplified67.5%
Taylor expanded in z around inf 33.6%
Final simplification51.6%
(FPCore (x y z t) :precision binary64 (/ 2.0 t))
double code(double x, double y, double z, double t) {
return 2.0 / t;
}
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 / t
end function
public static double code(double x, double y, double z, double t) {
return 2.0 / t;
}
def code(x, y, z, t): return 2.0 / t
function code(x, y, z, t) return Float64(2.0 / t) end
function tmp = code(x, y, z, t) tmp = 2.0 / t; end
code[x_, y_, z_, t_] := N[(2.0 / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{t}
\end{array}
Initial program 88.8%
Taylor expanded in t around 0 49.2%
associate-*r/49.2%
metadata-eval49.2%
Simplified49.2%
Taylor expanded in z around inf 22.2%
Final simplification22.2%
(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 2024082
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:alt
(- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))