
(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 85.4%
+-commutative85.4%
remove-double-neg85.4%
distribute-frac-neg85.4%
unsub-neg85.4%
*-commutative85.4%
associate-*r*85.4%
distribute-rgt1-in85.4%
associate-/l*85.3%
fma-neg85.3%
*-commutative85.3%
fma-define85.3%
*-commutative85.3%
distribute-frac-neg85.3%
remove-double-neg85.3%
Simplified85.3%
Taylor expanded in t around inf 99.2%
associate--l+99.2%
+-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
+-commutative99.2%
associate-*r/99.2%
distribute-lft-in99.2%
metadata-eval99.2%
associate-*r/99.2%
metadata-eval99.2%
Simplified99.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ (/ 2.0 z) t))) (t_2 (+ -2.0 (/ 2.0 t))))
(if (<= (/ x y) -5.2e+51)
(/ x y)
(if (<= (/ x y) -4.8e-47)
t_2
(if (<= (/ x y) -4.1e-218)
t_1
(if (<= (/ x y) -2e-321)
t_2
(if (<= (/ x y) 420.0) t_1 (- (/ x y) 2.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + ((2.0 / z) / t);
double t_2 = -2.0 + (2.0 / t);
double tmp;
if ((x / y) <= -5.2e+51) {
tmp = x / y;
} else if ((x / y) <= -4.8e-47) {
tmp = t_2;
} else if ((x / y) <= -4.1e-218) {
tmp = t_1;
} else if ((x / y) <= -2e-321) {
tmp = t_2;
} else if ((x / y) <= 420.0) {
tmp = t_1;
} else {
tmp = (x / y) - 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-2.0d0) + ((2.0d0 / z) / t)
t_2 = (-2.0d0) + (2.0d0 / t)
if ((x / y) <= (-5.2d+51)) then
tmp = x / y
else if ((x / y) <= (-4.8d-47)) then
tmp = t_2
else if ((x / y) <= (-4.1d-218)) then
tmp = t_1
else if ((x / y) <= (-2d-321)) then
tmp = t_2
else if ((x / y) <= 420.0d0) then
tmp = t_1
else
tmp = (x / y) - 2.0d0
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 t_2 = -2.0 + (2.0 / t);
double tmp;
if ((x / y) <= -5.2e+51) {
tmp = x / y;
} else if ((x / y) <= -4.8e-47) {
tmp = t_2;
} else if ((x / y) <= -4.1e-218) {
tmp = t_1;
} else if ((x / y) <= -2e-321) {
tmp = t_2;
} else if ((x / y) <= 420.0) {
tmp = t_1;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + ((2.0 / z) / t) t_2 = -2.0 + (2.0 / t) tmp = 0 if (x / y) <= -5.2e+51: tmp = x / y elif (x / y) <= -4.8e-47: tmp = t_2 elif (x / y) <= -4.1e-218: tmp = t_1 elif (x / y) <= -2e-321: tmp = t_2 elif (x / y) <= 420.0: tmp = t_1 else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(Float64(2.0 / z) / t)) t_2 = Float64(-2.0 + Float64(2.0 / t)) tmp = 0.0 if (Float64(x / y) <= -5.2e+51) tmp = Float64(x / y); elseif (Float64(x / y) <= -4.8e-47) tmp = t_2; elseif (Float64(x / y) <= -4.1e-218) tmp = t_1; elseif (Float64(x / y) <= -2e-321) tmp = t_2; elseif (Float64(x / y) <= 420.0) tmp = t_1; else tmp = Float64(Float64(x / y) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + ((2.0 / z) / t); t_2 = -2.0 + (2.0 / t); tmp = 0.0; if ((x / y) <= -5.2e+51) tmp = x / y; elseif ((x / y) <= -4.8e-47) tmp = t_2; elseif ((x / y) <= -4.1e-218) tmp = t_1; elseif ((x / y) <= -2e-321) tmp = t_2; elseif ((x / y) <= 420.0) tmp = t_1; else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -5.2e+51], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -4.8e-47], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], -4.1e-218], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -2e-321], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], 420.0], t$95$1, N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{\frac{2}{z}}{t}\\
t_2 := -2 + \frac{2}{t}\\
\mathbf{if}\;\frac{x}{y} \leq -5.2 \cdot 10^{+51}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -4.8 \cdot 10^{-47}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\frac{x}{y} \leq -4.1 \cdot 10^{-218}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq -2 \cdot 10^{-321}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\frac{x}{y} \leq 420:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -5.2000000000000002e51Initial program 86.4%
Taylor expanded in x around inf 78.7%
if -5.2000000000000002e51 < (/.f64 x y) < -4.7999999999999999e-47 or -4.0999999999999998e-218 < (/.f64 x y) < -2.00097e-321Initial program 83.4%
Taylor expanded in z around inf 82.1%
div-sub82.1%
sub-neg82.1%
*-inverses82.1%
metadata-eval82.1%
distribute-lft-in82.1%
associate-*r/82.1%
metadata-eval82.1%
metadata-eval82.1%
Simplified82.1%
Taylor expanded in x around 0 70.7%
sub-neg70.7%
associate-*r/70.7%
metadata-eval70.7%
metadata-eval70.7%
Simplified70.7%
if -4.7999999999999999e-47 < (/.f64 x y) < -4.0999999999999998e-218 or -2.00097e-321 < (/.f64 x y) < 420Initial program 87.0%
+-commutative87.0%
remove-double-neg87.0%
distribute-frac-neg87.0%
unsub-neg87.0%
*-commutative87.0%
associate-*r*87.0%
distribute-rgt1-in87.0%
associate-/l*86.9%
fma-neg86.9%
*-commutative86.9%
fma-define86.9%
*-commutative86.9%
distribute-frac-neg86.9%
remove-double-neg86.9%
Simplified86.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 99.2%
sub-neg99.2%
metadata-eval99.2%
+-commutative99.2%
*-commutative99.2%
associate-/r*99.2%
associate-*r/99.2%
associate-*l/99.2%
*-commutative99.2%
distribute-lft-in99.2%
associate-*l/99.2%
*-lft-identity99.2%
Simplified99.2%
Taylor expanded in z around 0 75.2%
if 420 < (/.f64 x y) Initial program 82.6%
Taylor expanded in t around inf 71.3%
Final simplification74.4%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -5e+51)
(/ x y)
(if (<= (/ x y) 5.8e-76)
(+ -2.0 (/ 2.0 t))
(if (<= (/ x y) 4800.0) (/ (/ 2.0 t) z) (- (/ x y) 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e+51) {
tmp = x / y;
} else if ((x / y) <= 5.8e-76) {
tmp = -2.0 + (2.0 / t);
} else if ((x / y) <= 4800.0) {
tmp = (2.0 / t) / z;
} else {
tmp = (x / y) - 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+51)) then
tmp = x / y
else if ((x / y) <= 5.8d-76) then
tmp = (-2.0d0) + (2.0d0 / t)
else if ((x / y) <= 4800.0d0) then
tmp = (2.0d0 / t) / z
else
tmp = (x / y) - 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+51) {
tmp = x / y;
} else if ((x / y) <= 5.8e-76) {
tmp = -2.0 + (2.0 / t);
} else if ((x / y) <= 4800.0) {
tmp = (2.0 / t) / z;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5e+51: tmp = x / y elif (x / y) <= 5.8e-76: tmp = -2.0 + (2.0 / t) elif (x / y) <= 4800.0: tmp = (2.0 / t) / z else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5e+51) tmp = Float64(x / y); elseif (Float64(x / y) <= 5.8e-76) tmp = Float64(-2.0 + Float64(2.0 / t)); elseif (Float64(x / y) <= 4800.0) tmp = Float64(Float64(2.0 / t) / z); else tmp = Float64(Float64(x / y) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -5e+51) tmp = x / y; elseif ((x / y) <= 5.8e-76) tmp = -2.0 + (2.0 / t); elseif ((x / y) <= 4800.0) tmp = (2.0 / t) / z; else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5e+51], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5.8e-76], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 4800.0], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+51}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 5.8 \cdot 10^{-76}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 4800:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -5e51Initial program 86.4%
Taylor expanded in x around inf 78.7%
if -5e51 < (/.f64 x y) < 5.8000000000000003e-76Initial program 85.1%
Taylor expanded in z around inf 69.2%
div-sub69.2%
sub-neg69.2%
*-inverses69.2%
metadata-eval69.2%
distribute-lft-in69.2%
associate-*r/69.2%
metadata-eval69.2%
metadata-eval69.2%
Simplified69.2%
Taylor expanded in x around 0 66.0%
sub-neg66.0%
associate-*r/66.0%
metadata-eval66.0%
metadata-eval66.0%
Simplified66.0%
if 5.8000000000000003e-76 < (/.f64 x y) < 4800Initial program 93.8%
+-commutative93.8%
remove-double-neg93.8%
distribute-frac-neg93.8%
unsub-neg93.8%
*-commutative93.8%
associate-*r*93.8%
distribute-rgt1-in93.8%
associate-/l*93.9%
fma-neg93.9%
*-commutative93.9%
fma-define93.9%
*-commutative93.9%
distribute-frac-neg93.9%
remove-double-neg93.9%
Simplified93.9%
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 65.3%
associate-/r*65.4%
Simplified65.4%
if 4800 < (/.f64 x y) Initial program 82.6%
Taylor expanded in t around inf 71.3%
Final simplification69.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -0.19) (not (<= (/ x y) 92000.0))) (+ (/ x y) (+ -2.0 (/ 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) <= -0.19) || !((x / y) <= 92000.0)) {
tmp = (x / y) + (-2.0 + (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) <= (-0.19d0)) .or. (.not. ((x / y) <= 92000.0d0))) then
tmp = (x / y) + ((-2.0d0) + (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) <= -0.19) || !((x / y) <= 92000.0)) {
tmp = (x / y) + (-2.0 + (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) <= -0.19) or not ((x / y) <= 92000.0): tmp = (x / y) + (-2.0 + (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) <= -0.19) || !(Float64(x / y) <= 92000.0)) tmp = Float64(Float64(x / y) + Float64(-2.0 + 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) <= -0.19) || ~(((x / y) <= 92000.0))) tmp = (x / y) + (-2.0 + (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], -0.19], N[Not[LessEqual[N[(x / y), $MachinePrecision], 92000.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / 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 -0.19 \lor \neg \left(\frac{x}{y} \leq 92000\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -0.19 or 92000 < (/.f64 x y) Initial program 83.6%
Taylor expanded in z around inf 85.1%
div-sub85.1%
sub-neg85.1%
*-inverses85.1%
metadata-eval85.1%
distribute-lft-in85.1%
associate-*r/85.1%
metadata-eval85.1%
metadata-eval85.1%
Simplified85.1%
if -0.19 < (/.f64 x y) < 92000Initial program 87.0%
+-commutative87.0%
remove-double-neg87.0%
distribute-frac-neg87.0%
unsub-neg87.0%
*-commutative87.0%
associate-*r*87.0%
distribute-rgt1-in87.0%
associate-/l*86.9%
fma-neg86.9%
*-commutative86.9%
fma-define86.9%
*-commutative86.9%
distribute-frac-neg86.9%
remove-double-neg86.9%
Simplified86.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 98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
*-commutative98.8%
associate-/r*98.9%
associate-*r/98.2%
associate-*l/98.9%
*-commutative98.9%
distribute-lft-in98.9%
associate-*l/98.9%
*-lft-identity98.9%
Simplified98.9%
Final simplification92.3%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -1e+52)
(/ x y)
(if (<= (/ x y) 2150000000.0)
(+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))
(- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1e+52) {
tmp = x / y;
} else if ((x / y) <= 2150000000.0) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x / y) - 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) <= (-1d+52)) then
tmp = x / y
else if ((x / y) <= 2150000000.0d0) then
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
else
tmp = (x / y) - 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) <= -1e+52) {
tmp = x / y;
} else if ((x / y) <= 2150000000.0) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1e+52: tmp = x / y elif (x / y) <= 2150000000.0: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1e+52) tmp = Float64(x / y); elseif (Float64(x / y) <= 2150000000.0) tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); else tmp = Float64(Float64(x / y) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -1e+52) tmp = x / y; elseif ((x / y) <= 2150000000.0) tmp = -2.0 + ((2.0 + (2.0 / z)) / t); else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1e+52], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2150000000.0], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+52}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 2150000000:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -9.9999999999999999e51Initial program 86.4%
Taylor expanded in x around inf 78.7%
if -9.9999999999999999e51 < (/.f64 x y) < 2.15e9Initial program 86.2%
+-commutative86.2%
remove-double-neg86.2%
distribute-frac-neg86.2%
unsub-neg86.2%
*-commutative86.2%
associate-*r*86.2%
distribute-rgt1-in86.2%
associate-/l*86.1%
fma-neg86.1%
*-commutative86.1%
fma-define86.1%
*-commutative86.1%
distribute-frac-neg86.1%
remove-double-neg86.1%
Simplified86.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 96.1%
sub-neg96.1%
metadata-eval96.1%
+-commutative96.1%
*-commutative96.1%
associate-/r*96.2%
associate-*r/95.5%
associate-*l/96.1%
*-commutative96.1%
distribute-lft-in96.1%
associate-*l/96.1%
*-lft-identity96.1%
Simplified96.1%
if 2.15e9 < (/.f64 x y) Initial program 82.3%
Taylor expanded in t around inf 72.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 4.4e+28))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (+ -2.0 (/ x y)) (/ (/ 2.0 z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 4.4e+28)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (-2.0 + (x / y)) + ((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 <= (-1.0d0)) .or. (.not. (z <= 4.4d+28))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = ((-2.0d0) + (x / y)) + ((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 <= -1.0) || !(z <= 4.4e+28)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (-2.0 + (x / y)) + ((2.0 / z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 4.4e+28): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = (-2.0 + (x / y)) + ((2.0 / z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 4.4e+28)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(-2.0 + Float64(x / y)) + Float64(Float64(2.0 / z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.0) || ~((z <= 4.4e+28))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = (-2.0 + (x / y)) + ((2.0 / z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 4.4e+28]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 4.4 \cdot 10^{+28}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-2 + \frac{x}{y}\right) + \frac{\frac{2}{z}}{t}\\
\end{array}
\end{array}
if z < -1 or 4.39999999999999973e28 < z Initial program 74.3%
Taylor expanded in z around inf 100.0%
div-sub100.0%
sub-neg100.0%
*-inverses100.0%
metadata-eval100.0%
distribute-lft-in100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
if -1 < z < 4.39999999999999973e28Initial program 98.1%
+-commutative98.1%
remove-double-neg98.1%
distribute-frac-neg98.1%
unsub-neg98.1%
*-commutative98.1%
associate-*r*98.1%
distribute-rgt1-in98.1%
associate-/l*98.1%
fma-neg98.1%
*-commutative98.1%
fma-define98.1%
*-commutative98.1%
distribute-frac-neg98.1%
remove-double-neg98.1%
Simplified98.1%
Taylor expanded in t around inf 98.2%
associate--l+98.2%
+-commutative98.2%
sub-neg98.2%
metadata-eval98.2%
+-commutative98.2%
associate-*r/98.2%
distribute-lft-in98.2%
metadata-eval98.2%
associate-*r/98.2%
metadata-eval98.2%
Simplified98.2%
Taylor expanded in z around 0 96.6%
Final simplification98.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.2e-23) (not (<= z 0.013))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (/ x y) (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.2e-23) || !(z <= 0.013)) {
tmp = (x / y) + (-2.0 + (2.0 / 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 ((z <= (-2.2d-23)) .or. (.not. (z <= 0.013d0))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / 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 ((z <= -2.2e-23) || !(z <= 0.013)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.2e-23) or not (z <= 0.013): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = (x / y) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.2e-23) || !(z <= 0.013)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / 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 ((z <= -2.2e-23) || ~((z <= 0.013))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = (x / y) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.2e-23], N[Not[LessEqual[z, 0.013]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-23} \lor \neg \left(z \leq 0.013\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if z < -2.1999999999999999e-23 or 0.0129999999999999994 < z Initial program 76.0%
Taylor expanded in z around inf 98.6%
div-sub98.6%
sub-neg98.6%
*-inverses98.6%
metadata-eval98.6%
distribute-lft-in98.6%
associate-*r/98.6%
metadata-eval98.6%
metadata-eval98.6%
Simplified98.6%
if -2.1999999999999999e-23 < z < 0.0129999999999999994Initial program 98.0%
Taylor expanded in z around 0 85.9%
associate-/r*86.1%
Simplified86.1%
Final simplification93.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1.95e+52) (not (<= (/ x y) 400000.0))) (/ x y) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.95e+52) || !((x / y) <= 400000.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.95d+52)) .or. (.not. ((x / y) <= 400000.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.95e+52) || !((x / y) <= 400000.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.95e+52) or not ((x / y) <= 400000.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.95e+52) || !(Float64(x / y) <= 400000.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.95e+52) || ~(((x / y) <= 400000.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.95e+52], N[Not[LessEqual[N[(x / y), $MachinePrecision], 400000.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.95 \cdot 10^{+52} \lor \neg \left(\frac{x}{y} \leq 400000\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.95e52 or 4e5 < (/.f64 x y) Initial program 84.3%
Taylor expanded in x around inf 74.9%
if -1.95e52 < (/.f64 x y) < 4e5Initial program 86.2%
Taylor expanded in z around inf 65.3%
div-sub65.3%
sub-neg65.3%
*-inverses65.3%
metadata-eval65.3%
distribute-lft-in65.3%
associate-*r/65.3%
metadata-eval65.3%
metadata-eval65.3%
Simplified65.3%
Taylor expanded in x around 0 62.5%
sub-neg62.5%
associate-*r/62.5%
metadata-eval62.5%
metadata-eval62.5%
Simplified62.5%
Final simplification67.8%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -5e+51) (/ x y) (if (<= (/ x y) 32500000.0) (+ -2.0 (/ 2.0 t)) (- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e+51) {
tmp = x / y;
} else if ((x / y) <= 32500000.0) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = (x / y) - 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+51)) then
tmp = x / y
else if ((x / y) <= 32500000.0d0) then
tmp = (-2.0d0) + (2.0d0 / t)
else
tmp = (x / y) - 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+51) {
tmp = x / y;
} else if ((x / y) <= 32500000.0) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5e+51: tmp = x / y elif (x / y) <= 32500000.0: tmp = -2.0 + (2.0 / t) else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5e+51) tmp = Float64(x / y); elseif (Float64(x / y) <= 32500000.0) tmp = Float64(-2.0 + Float64(2.0 / t)); else tmp = Float64(Float64(x / y) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -5e+51) tmp = x / y; elseif ((x / y) <= 32500000.0) tmp = -2.0 + (2.0 / t); else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5e+51], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 32500000.0], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+51}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 32500000:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -5e51Initial program 86.4%
Taylor expanded in x around inf 78.7%
if -5e51 < (/.f64 x y) < 3.25e7Initial program 86.2%
Taylor expanded in z around inf 65.3%
div-sub65.3%
sub-neg65.3%
*-inverses65.3%
metadata-eval65.3%
distribute-lft-in65.3%
associate-*r/65.3%
metadata-eval65.3%
metadata-eval65.3%
Simplified65.3%
Taylor expanded in x around 0 62.5%
sub-neg62.5%
associate-*r/62.5%
metadata-eval62.5%
metadata-eval62.5%
Simplified62.5%
if 3.25e7 < (/.f64 x y) Initial program 82.3%
Taylor expanded in t around inf 72.6%
Final simplification68.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -6.2e-36) (not (<= t 1.5e-98))) (- (/ 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.2e-36) || !(t <= 1.5e-98)) {
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.2d-36)) .or. (.not. (t <= 1.5d-98))) 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.2e-36) || !(t <= 1.5e-98)) {
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.2e-36) or not (t <= 1.5e-98): 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.2e-36) || !(t <= 1.5e-98)) 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.2e-36) || ~((t <= 1.5e-98))) 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.2e-36], N[Not[LessEqual[t, 1.5e-98]], $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.2 \cdot 10^{-36} \lor \neg \left(t \leq 1.5 \cdot 10^{-98}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -6.1999999999999997e-36 or 1.5e-98 < t Initial program 76.2%
Taylor expanded in t around inf 81.5%
if -6.1999999999999997e-36 < t < 1.5e-98Initial program 97.9%
Taylor expanded in t around 0 91.1%
associate-*r/91.1%
metadata-eval91.1%
Simplified91.1%
Final simplification85.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -5e+51) (not (<= (/ x y) 3300000.0))) (/ x y) (/ 2.0 t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5e+51) || !((x / y) <= 3300000.0)) {
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) <= (-5d+51)) .or. (.not. ((x / y) <= 3300000.0d0))) 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) <= -5e+51) || !((x / y) <= 3300000.0)) {
tmp = x / y;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -5e+51) or not ((x / y) <= 3300000.0): tmp = x / y else: tmp = 2.0 / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -5e+51) || !(Float64(x / y) <= 3300000.0)) 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) <= -5e+51) || ~(((x / y) <= 3300000.0))) 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], -5e+51], N[Not[LessEqual[N[(x / y), $MachinePrecision], 3300000.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(2.0 / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+51} \lor \neg \left(\frac{x}{y} \leq 3300000\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -5e51 or 3.3e6 < (/.f64 x y) Initial program 84.3%
Taylor expanded in x around inf 74.9%
if -5e51 < (/.f64 x y) < 3.3e6Initial program 86.2%
Taylor expanded in t around 0 65.8%
associate-*r/65.8%
metadata-eval65.8%
Simplified65.8%
Taylor expanded in z around inf 32.4%
Final simplification50.5%
(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 85.4%
Taylor expanded in t around 0 50.1%
associate-*r/50.1%
metadata-eval50.1%
Simplified50.1%
Taylor expanded in z around inf 23.9%
(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 2024103
(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))))