
(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 17 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 (/ 1.0 t)) (+ (/ 2.0 (* t z)) (/ x y))) 2.0))
double code(double x, double y, double z, double t) {
return ((2.0 * (1.0 / t)) + ((2.0 / (t * z)) + (x / y))) - 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 * (1.0d0 / t)) + ((2.0d0 / (t * z)) + (x / y))) - 2.0d0
end function
public static double code(double x, double y, double z, double t) {
return ((2.0 * (1.0 / t)) + ((2.0 / (t * z)) + (x / y))) - 2.0;
}
def code(x, y, z, t): return ((2.0 * (1.0 / t)) + ((2.0 / (t * z)) + (x / y))) - 2.0
function code(x, y, z, t) return Float64(Float64(Float64(2.0 * Float64(1.0 / t)) + Float64(Float64(2.0 / Float64(t * z)) + Float64(x / y))) - 2.0) end
function tmp = code(x, y, z, t) tmp = ((2.0 * (1.0 / t)) + ((2.0 / (t * z)) + (x / y))) - 2.0; end
code[x_, y_, z_, t_] := N[(N[(N[(2.0 * N[(1.0 / t), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]
\begin{array}{l}
\\
\left(2 \cdot \frac{1}{t} + \left(\frac{2}{t \cdot z} + \frac{x}{y}\right)\right) - 2
\end{array}
Initial program 83.8%
Taylor expanded in t around inf 98.3%
Final simplification98.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 2.0 (* t z))))
(if (<= (/ x y) -2.9e+106)
(/ x y)
(if (<= (/ x y) -1e-14)
t_1
(if (<= (/ x y) 3.3e-60)
(- (/ 2.0 t) 2.0)
(if (<= (/ x y) 1.85e+21) t_1 (- (/ x y) 2.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 / (t * z);
double tmp;
if ((x / y) <= -2.9e+106) {
tmp = x / y;
} else if ((x / y) <= -1e-14) {
tmp = t_1;
} else if ((x / y) <= 3.3e-60) {
tmp = (2.0 / t) - 2.0;
} else if ((x / y) <= 1.85e+21) {
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) :: tmp
t_1 = 2.0d0 / (t * z)
if ((x / y) <= (-2.9d+106)) then
tmp = x / y
else if ((x / y) <= (-1d-14)) then
tmp = t_1
else if ((x / y) <= 3.3d-60) then
tmp = (2.0d0 / t) - 2.0d0
else if ((x / y) <= 1.85d+21) 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 / (t * z);
double tmp;
if ((x / y) <= -2.9e+106) {
tmp = x / y;
} else if ((x / y) <= -1e-14) {
tmp = t_1;
} else if ((x / y) <= 3.3e-60) {
tmp = (2.0 / t) - 2.0;
} else if ((x / y) <= 1.85e+21) {
tmp = t_1;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 / (t * z) tmp = 0 if (x / y) <= -2.9e+106: tmp = x / y elif (x / y) <= -1e-14: tmp = t_1 elif (x / y) <= 3.3e-60: tmp = (2.0 / t) - 2.0 elif (x / y) <= 1.85e+21: tmp = t_1 else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 / Float64(t * z)) tmp = 0.0 if (Float64(x / y) <= -2.9e+106) tmp = Float64(x / y); elseif (Float64(x / y) <= -1e-14) tmp = t_1; elseif (Float64(x / y) <= 3.3e-60) tmp = Float64(Float64(2.0 / t) - 2.0); elseif (Float64(x / y) <= 1.85e+21) 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 / (t * z); tmp = 0.0; if ((x / y) <= -2.9e+106) tmp = x / y; elseif ((x / y) <= -1e-14) tmp = t_1; elseif ((x / y) <= 3.3e-60) tmp = (2.0 / t) - 2.0; elseif ((x / y) <= 1.85e+21) 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[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -2.9e+106], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -1e-14], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 3.3e-60], N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1.85e+21], t$95$1, N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{t \cdot z}\\
\mathbf{if}\;\frac{x}{y} \leq -2.9 \cdot 10^{+106}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -1 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 3.3 \cdot 10^{-60}:\\
\;\;\;\;\frac{2}{t} - 2\\
\mathbf{elif}\;\frac{x}{y} \leq 1.85 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -2.9000000000000002e106Initial program 85.4%
Taylor expanded in x around inf 78.2%
if -2.9000000000000002e106 < (/.f64 x y) < -9.99999999999999999e-15 or 3.2999999999999998e-60 < (/.f64 x y) < 1.85e21Initial program 92.8%
Taylor expanded in t around 0 95.3%
associate-+r+95.3%
associate-*r/95.3%
metadata-eval95.3%
sub-neg95.3%
metadata-eval95.3%
Simplified95.3%
Taylor expanded in z around 0 60.2%
if -9.99999999999999999e-15 < (/.f64 x y) < 3.2999999999999998e-60Initial program 83.6%
Taylor expanded in t around inf 99.9%
Taylor expanded in t around 0 99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 65.6%
if 1.85e21 < (/.f64 x y) Initial program 76.2%
Taylor expanded in t around inf 80.4%
Final simplification70.4%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -7.8e+105)
(/ x y)
(if (<= (/ x y) -2.7e-14)
(/ 2.0 (* t z))
(if (<= (/ x y) 1.9e-60)
(- (/ 2.0 t) 2.0)
(if (<= (/ x y) 2.8e+22) (/ (/ 2.0 z) t) (- (/ x y) 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -7.8e+105) {
tmp = x / y;
} else if ((x / y) <= -2.7e-14) {
tmp = 2.0 / (t * z);
} else if ((x / y) <= 1.9e-60) {
tmp = (2.0 / t) - 2.0;
} else if ((x / y) <= 2.8e+22) {
tmp = (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) <= (-7.8d+105)) then
tmp = x / y
else if ((x / y) <= (-2.7d-14)) then
tmp = 2.0d0 / (t * z)
else if ((x / y) <= 1.9d-60) then
tmp = (2.0d0 / t) - 2.0d0
else if ((x / y) <= 2.8d+22) then
tmp = (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) <= -7.8e+105) {
tmp = x / y;
} else if ((x / y) <= -2.7e-14) {
tmp = 2.0 / (t * z);
} else if ((x / y) <= 1.9e-60) {
tmp = (2.0 / t) - 2.0;
} else if ((x / y) <= 2.8e+22) {
tmp = (2.0 / z) / t;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -7.8e+105: tmp = x / y elif (x / y) <= -2.7e-14: tmp = 2.0 / (t * z) elif (x / y) <= 1.9e-60: tmp = (2.0 / t) - 2.0 elif (x / y) <= 2.8e+22: tmp = (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) <= -7.8e+105) tmp = Float64(x / y); elseif (Float64(x / y) <= -2.7e-14) tmp = Float64(2.0 / Float64(t * z)); elseif (Float64(x / y) <= 1.9e-60) tmp = Float64(Float64(2.0 / t) - 2.0); elseif (Float64(x / y) <= 2.8e+22) tmp = Float64(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) <= -7.8e+105) tmp = x / y; elseif ((x / y) <= -2.7e-14) tmp = 2.0 / (t * z); elseif ((x / y) <= 1.9e-60) tmp = (2.0 / t) - 2.0; elseif ((x / y) <= 2.8e+22) tmp = (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], -7.8e+105], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -2.7e-14], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1.9e-60], N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2.8e+22], N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -7.8 \cdot 10^{+105}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -2.7 \cdot 10^{-14}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;\frac{x}{y} \leq 1.9 \cdot 10^{-60}:\\
\;\;\;\;\frac{2}{t} - 2\\
\mathbf{elif}\;\frac{x}{y} \leq 2.8 \cdot 10^{+22}:\\
\;\;\;\;\frac{\frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -7.79999999999999957e105Initial program 85.4%
Taylor expanded in x around inf 78.2%
if -7.79999999999999957e105 < (/.f64 x y) < -2.6999999999999999e-14Initial program 88.7%
Taylor expanded in t around 0 92.7%
associate-+r+92.7%
associate-*r/92.7%
metadata-eval92.7%
sub-neg92.7%
metadata-eval92.7%
Simplified92.7%
Taylor expanded in z around 0 52.2%
if -2.6999999999999999e-14 < (/.f64 x y) < 1.89999999999999997e-60Initial program 83.6%
Taylor expanded in t around inf 99.9%
Taylor expanded in t around 0 99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 65.6%
if 1.89999999999999997e-60 < (/.f64 x y) < 2.8e22Initial program 99.4%
Taylor expanded in t around 0 99.4%
associate-+r+99.4%
associate-*r/99.4%
metadata-eval99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 72.8%
*-commutative72.8%
associate-/r*72.9%
Simplified72.9%
if 2.8e22 < (/.f64 x y) Initial program 76.2%
Taylor expanded in t around inf 80.4%
Final simplification70.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ 2.0 t) z)))
(if (<= (/ x y) -7.8e+105)
(/ x y)
(if (<= (/ x y) -2.5e-10)
t_1
(if (<= (/ x y) 3.7e-62)
(- (/ 2.0 t) 2.0)
(if (<= (/ x y) 1.16e+23) t_1 (- (/ x y) 2.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 / t) / z;
double tmp;
if ((x / y) <= -7.8e+105) {
tmp = x / y;
} else if ((x / y) <= -2.5e-10) {
tmp = t_1;
} else if ((x / y) <= 3.7e-62) {
tmp = (2.0 / t) - 2.0;
} else if ((x / y) <= 1.16e+23) {
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) :: tmp
t_1 = (2.0d0 / t) / z
if ((x / y) <= (-7.8d+105)) then
tmp = x / y
else if ((x / y) <= (-2.5d-10)) then
tmp = t_1
else if ((x / y) <= 3.7d-62) then
tmp = (2.0d0 / t) - 2.0d0
else if ((x / y) <= 1.16d+23) 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 / t) / z;
double tmp;
if ((x / y) <= -7.8e+105) {
tmp = x / y;
} else if ((x / y) <= -2.5e-10) {
tmp = t_1;
} else if ((x / y) <= 3.7e-62) {
tmp = (2.0 / t) - 2.0;
} else if ((x / y) <= 1.16e+23) {
tmp = t_1;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 / t) / z tmp = 0 if (x / y) <= -7.8e+105: tmp = x / y elif (x / y) <= -2.5e-10: tmp = t_1 elif (x / y) <= 3.7e-62: tmp = (2.0 / t) - 2.0 elif (x / y) <= 1.16e+23: tmp = t_1 else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 / t) / z) tmp = 0.0 if (Float64(x / y) <= -7.8e+105) tmp = Float64(x / y); elseif (Float64(x / y) <= -2.5e-10) tmp = t_1; elseif (Float64(x / y) <= 3.7e-62) tmp = Float64(Float64(2.0 / t) - 2.0); elseif (Float64(x / y) <= 1.16e+23) 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 / t) / z; tmp = 0.0; if ((x / y) <= -7.8e+105) tmp = x / y; elseif ((x / y) <= -2.5e-10) tmp = t_1; elseif ((x / y) <= 3.7e-62) tmp = (2.0 / t) - 2.0; elseif ((x / y) <= 1.16e+23) tmp = t_1; else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -7.8e+105], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -2.5e-10], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 3.7e-62], N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1.16e+23], t$95$1, N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{2}{t}}{z}\\
\mathbf{if}\;\frac{x}{y} \leq -7.8 \cdot 10^{+105}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -2.5 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 3.7 \cdot 10^{-62}:\\
\;\;\;\;\frac{2}{t} - 2\\
\mathbf{elif}\;\frac{x}{y} \leq 1.16 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -7.79999999999999957e105Initial program 85.4%
Taylor expanded in x around inf 78.2%
if -7.79999999999999957e105 < (/.f64 x y) < -2.50000000000000016e-10 or 3.6999999999999998e-62 < (/.f64 x y) < 1.16e23Initial program 92.8%
Taylor expanded in t around 0 95.3%
associate-+r+95.3%
associate-*r/95.3%
metadata-eval95.3%
sub-neg95.3%
metadata-eval95.3%
Simplified95.3%
Taylor expanded in z around 0 60.2%
*-un-lft-identity60.2%
*-commutative60.2%
associate-/r*60.3%
Applied egg-rr60.3%
if -2.50000000000000016e-10 < (/.f64 x y) < 3.6999999999999998e-62Initial program 83.6%
Taylor expanded in t around inf 99.9%
Taylor expanded in t around 0 99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 65.6%
if 1.16e23 < (/.f64 x y) Initial program 76.2%
Taylor expanded in t around inf 80.4%
Final simplification70.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -7.8e+97)
t_1
(if (<= t -1.25e+35)
(/ (/ 2.0 t) z)
(if (or (<= t -1.8e+25) (not (<= t 7e-19)))
t_1
(+ (/ 2.0 (* t z)) (/ 2.0 t)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -7.8e+97) {
tmp = t_1;
} else if (t <= -1.25e+35) {
tmp = (2.0 / t) / z;
} else if ((t <= -1.8e+25) || !(t <= 7e-19)) {
tmp = t_1;
} else {
tmp = (2.0 / (t * z)) + (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) :: t_1
real(8) :: tmp
t_1 = (x / y) - 2.0d0
if (t <= (-7.8d+97)) then
tmp = t_1
else if (t <= (-1.25d+35)) then
tmp = (2.0d0 / t) / z
else if ((t <= (-1.8d+25)) .or. (.not. (t <= 7d-19))) then
tmp = t_1
else
tmp = (2.0d0 / (t * z)) + (2.0d0 / t)
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 <= -7.8e+97) {
tmp = t_1;
} else if (t <= -1.25e+35) {
tmp = (2.0 / t) / z;
} else if ((t <= -1.8e+25) || !(t <= 7e-19)) {
tmp = t_1;
} else {
tmp = (2.0 / (t * z)) + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if t <= -7.8e+97: tmp = t_1 elif t <= -1.25e+35: tmp = (2.0 / t) / z elif (t <= -1.8e+25) or not (t <= 7e-19): tmp = t_1 else: tmp = (2.0 / (t * z)) + (2.0 / t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -7.8e+97) tmp = t_1; elseif (t <= -1.25e+35) tmp = Float64(Float64(2.0 / t) / z); elseif ((t <= -1.8e+25) || !(t <= 7e-19)) tmp = t_1; else tmp = Float64(Float64(2.0 / Float64(t * z)) + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (t <= -7.8e+97) tmp = t_1; elseif (t <= -1.25e+35) tmp = (2.0 / t) / z; elseif ((t <= -1.8e+25) || ~((t <= 7e-19))) tmp = t_1; else tmp = (2.0 / (t * z)) + (2.0 / t); 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, -7.8e+97], t$95$1, If[LessEqual[t, -1.25e+35], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[t, -1.8e+25], N[Not[LessEqual[t, 7e-19]], $MachinePrecision]], t$95$1, N[(N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -7.8 \cdot 10^{+97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.25 \cdot 10^{+35}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{elif}\;t \leq -1.8 \cdot 10^{+25} \lor \neg \left(t \leq 7 \cdot 10^{-19}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t \cdot z} + \frac{2}{t}\\
\end{array}
\end{array}
if t < -7.7999999999999999e97 or -1.25000000000000005e35 < t < -1.80000000000000008e25 or 7.00000000000000031e-19 < t Initial program 68.3%
Taylor expanded in t around inf 84.4%
if -7.7999999999999999e97 < t < -1.25000000000000005e35Initial program 99.7%
Taylor expanded in t around 0 90.8%
associate-+r+90.8%
associate-*r/90.8%
metadata-eval90.8%
sub-neg90.8%
metadata-eval90.8%
Simplified90.8%
Taylor expanded in z around 0 74.3%
*-un-lft-identity74.3%
*-commutative74.3%
associate-/r*74.5%
Applied egg-rr74.5%
if -1.80000000000000008e25 < t < 7.00000000000000031e-19Initial program 96.6%
Taylor expanded in t around 0 76.0%
associate-*r/76.0%
metadata-eval76.0%
Simplified76.0%
Taylor expanded in z around 0 62.3%
Taylor expanded in z around inf 76.0%
associate-*r/76.0%
metadata-eval76.0%
associate-*r/76.0%
metadata-eval76.0%
Simplified76.0%
Final simplification79.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -2.3e+100)
t_1
(if (<= t -2.2e+35)
(/ (/ 2.0 t) z)
(if (or (<= t -1.5e+26) (not (<= t 1.4e-19)))
t_1
(/ (+ 2.0 (/ 2.0 z)) t))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -2.3e+100) {
tmp = t_1;
} else if (t <= -2.2e+35) {
tmp = (2.0 / t) / z;
} else if ((t <= -1.5e+26) || !(t <= 1.4e-19)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x / y) - 2.0d0
if (t <= (-2.3d+100)) then
tmp = t_1
else if (t <= (-2.2d+35)) then
tmp = (2.0d0 / t) / z
else if ((t <= (-1.5d+26)) .or. (.not. (t <= 1.4d-19))) then
tmp = t_1
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 t_1 = (x / y) - 2.0;
double tmp;
if (t <= -2.3e+100) {
tmp = t_1;
} else if (t <= -2.2e+35) {
tmp = (2.0 / t) / z;
} else if ((t <= -1.5e+26) || !(t <= 1.4e-19)) {
tmp = t_1;
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if t <= -2.3e+100: tmp = t_1 elif t <= -2.2e+35: tmp = (2.0 / t) / z elif (t <= -1.5e+26) or not (t <= 1.4e-19): tmp = t_1 else: tmp = (2.0 + (2.0 / z)) / t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -2.3e+100) tmp = t_1; elseif (t <= -2.2e+35) tmp = Float64(Float64(2.0 / t) / z); elseif ((t <= -1.5e+26) || !(t <= 1.4e-19)) tmp = t_1; else tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (t <= -2.3e+100) tmp = t_1; elseif (t <= -2.2e+35) tmp = (2.0 / t) / z; elseif ((t <= -1.5e+26) || ~((t <= 1.4e-19))) tmp = t_1; else tmp = (2.0 + (2.0 / z)) / t; 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, -2.3e+100], t$95$1, If[LessEqual[t, -2.2e+35], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[t, -1.5e+26], N[Not[LessEqual[t, 1.4e-19]], $MachinePrecision]], t$95$1, N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -2.3 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.2 \cdot 10^{+35}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{elif}\;t \leq -1.5 \cdot 10^{+26} \lor \neg \left(t \leq 1.4 \cdot 10^{-19}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -2.2999999999999999e100 or -2.1999999999999999e35 < t < -1.49999999999999999e26 or 1.40000000000000001e-19 < t Initial program 68.3%
Taylor expanded in t around inf 84.4%
if -2.2999999999999999e100 < t < -2.1999999999999999e35Initial program 99.7%
Taylor expanded in t around 0 90.8%
associate-+r+90.8%
associate-*r/90.8%
metadata-eval90.8%
sub-neg90.8%
metadata-eval90.8%
Simplified90.8%
Taylor expanded in z around 0 74.3%
*-un-lft-identity74.3%
*-commutative74.3%
associate-/r*74.5%
Applied egg-rr74.5%
if -1.49999999999999999e26 < t < 1.40000000000000001e-19Initial program 96.6%
Taylor expanded in t around 0 76.0%
associate-*r/76.0%
metadata-eval76.0%
Simplified76.0%
Final simplification79.8%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -2e+19)
(+ (/ 2.0 (* t z)) (/ x y))
(if (<= (/ x y) 2e-5)
(- (/ (+ 2.0 (/ 2.0 z)) t) 2.0)
(+ (/ x y) (/ (/ 2.0 t) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2e+19) {
tmp = (2.0 / (t * z)) + (x / y);
} else if ((x / y) <= 2e-5) {
tmp = ((2.0 + (2.0 / z)) / t) - 2.0;
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-2d+19)) then
tmp = (2.0d0 / (t * z)) + (x / y)
else if ((x / y) <= 2d-5) then
tmp = ((2.0d0 + (2.0d0 / z)) / t) - 2.0d0
else
tmp = (x / y) + ((2.0d0 / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2e+19) {
tmp = (2.0 / (t * z)) + (x / y);
} else if ((x / y) <= 2e-5) {
tmp = ((2.0 + (2.0 / z)) / t) - 2.0;
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2e+19: tmp = (2.0 / (t * z)) + (x / y) elif (x / y) <= 2e-5: tmp = ((2.0 + (2.0 / z)) / t) - 2.0 else: tmp = (x / y) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2e+19) tmp = Float64(Float64(2.0 / Float64(t * z)) + Float64(x / y)); elseif (Float64(x / y) <= 2e-5) tmp = Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) - 2.0); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -2e+19) tmp = (2.0 / (t * z)) + (x / y); elseif ((x / y) <= 2e-5) tmp = ((2.0 + (2.0 / z)) / t) - 2.0; else tmp = (x / y) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2e+19], N[(N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2e-5], N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+19}:\\
\;\;\;\;\frac{2}{t \cdot z} + \frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if (/.f64 x y) < -2e19Initial program 89.5%
Taylor expanded in z around 0 84.3%
if -2e19 < (/.f64 x y) < 2.00000000000000016e-5Initial program 83.8%
Taylor expanded in t around inf 99.8%
Taylor expanded in t around 0 97.6%
associate-*r/97.6%
metadata-eval97.6%
Simplified97.6%
if 2.00000000000000016e-5 < (/.f64 x y) Initial program 77.7%
Taylor expanded in z around 0 93.8%
associate-/r*93.9%
Simplified93.9%
Final simplification93.2%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -2e+113)
(* x (+ (/ 1.0 y) (/ 2.0 (* t (* z x)))))
(if (<= (/ x y) 2e-5)
(- (/ (+ 2.0 (/ 2.0 z)) t) 2.0)
(+ (/ x y) (/ (/ 2.0 t) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2e+113) {
tmp = x * ((1.0 / y) + (2.0 / (t * (z * x))));
} else if ((x / y) <= 2e-5) {
tmp = ((2.0 + (2.0 / z)) / t) - 2.0;
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-2d+113)) then
tmp = x * ((1.0d0 / y) + (2.0d0 / (t * (z * x))))
else if ((x / y) <= 2d-5) then
tmp = ((2.0d0 + (2.0d0 / z)) / t) - 2.0d0
else
tmp = (x / y) + ((2.0d0 / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2e+113) {
tmp = x * ((1.0 / y) + (2.0 / (t * (z * x))));
} else if ((x / y) <= 2e-5) {
tmp = ((2.0 + (2.0 / z)) / t) - 2.0;
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2e+113: tmp = x * ((1.0 / y) + (2.0 / (t * (z * x)))) elif (x / y) <= 2e-5: tmp = ((2.0 + (2.0 / z)) / t) - 2.0 else: tmp = (x / y) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2e+113) tmp = Float64(x * Float64(Float64(1.0 / y) + Float64(2.0 / Float64(t * Float64(z * x))))); elseif (Float64(x / y) <= 2e-5) tmp = Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) - 2.0); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -2e+113) tmp = x * ((1.0 / y) + (2.0 / (t * (z * x)))); elseif ((x / y) <= 2e-5) tmp = ((2.0 + (2.0 / z)) / t) - 2.0; else tmp = (x / y) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2e+113], N[(x * N[(N[(1.0 / y), $MachinePrecision] + N[(2.0 / N[(t * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2e-5], N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+113}:\\
\;\;\;\;x \cdot \left(\frac{1}{y} + \frac{2}{t \cdot \left(z \cdot x\right)}\right)\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if (/.f64 x y) < -2e113Initial program 85.4%
Taylor expanded in z around 0 86.1%
associate-/r*86.1%
Simplified86.1%
Taylor expanded in x around inf 92.3%
associate-*r/92.3%
metadata-eval92.3%
*-commutative92.3%
Simplified92.3%
if -2e113 < (/.f64 x y) < 2.00000000000000016e-5Initial program 85.9%
Taylor expanded in t around inf 99.8%
Taylor expanded in t around 0 95.1%
associate-*r/95.1%
metadata-eval95.1%
Simplified95.1%
if 2.00000000000000016e-5 < (/.f64 x y) Initial program 77.7%
Taylor expanded in z around 0 93.8%
associate-/r*93.9%
Simplified93.9%
Final simplification94.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -124000.0) (not (<= (/ x y) 8.8e+20))) (/ x y) (- (/ 2.0 t) 2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -124000.0) || !((x / y) <= 8.8e+20)) {
tmp = x / y;
} else {
tmp = (2.0 / t) - 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-124000.0d0)) .or. (.not. ((x / y) <= 8.8d+20))) then
tmp = x / y
else
tmp = (2.0d0 / t) - 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -124000.0) || !((x / y) <= 8.8e+20)) {
tmp = x / y;
} else {
tmp = (2.0 / t) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -124000.0) or not ((x / y) <= 8.8e+20): tmp = x / y else: tmp = (2.0 / t) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -124000.0) || !(Float64(x / y) <= 8.8e+20)) tmp = Float64(x / y); else tmp = Float64(Float64(2.0 / t) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -124000.0) || ~(((x / y) <= 8.8e+20))) tmp = x / y; else tmp = (2.0 / t) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -124000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 8.8e+20]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -124000 \lor \neg \left(\frac{x}{y} \leq 8.8 \cdot 10^{+20}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -124000 or 8.8e20 < (/.f64 x y) Initial program 82.1%
Taylor expanded in x around inf 70.2%
if -124000 < (/.f64 x y) < 8.8e20Initial program 85.5%
Taylor expanded in t around inf 99.8%
Taylor expanded in t around 0 98.8%
associate-*r/98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in z around inf 58.1%
Final simplification64.2%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -0.115) (not (<= (/ x y) 9.2e+20))) (- (/ x y) 2.0) (- (/ 2.0 t) 2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -0.115) || !((x / y) <= 9.2e+20)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 / t) - 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-0.115d0)) .or. (.not. ((x / y) <= 9.2d+20))) then
tmp = (x / y) - 2.0d0
else
tmp = (2.0d0 / t) - 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -0.115) || !((x / y) <= 9.2e+20)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 / t) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -0.115) or not ((x / y) <= 9.2e+20): tmp = (x / y) - 2.0 else: tmp = (2.0 / t) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -0.115) || !(Float64(x / y) <= 9.2e+20)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(Float64(2.0 / t) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -0.115) || ~(((x / y) <= 9.2e+20))) tmp = (x / y) - 2.0; else tmp = (2.0 / t) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -0.115], N[Not[LessEqual[N[(x / y), $MachinePrecision], 9.2e+20]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -0.115 \lor \neg \left(\frac{x}{y} \leq 9.2 \cdot 10^{+20}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -0.115000000000000005 or 9.2e20 < (/.f64 x y) Initial program 81.6%
Taylor expanded in t around inf 70.5%
if -0.115000000000000005 < (/.f64 x y) < 9.2e20Initial program 86.1%
Taylor expanded in t around inf 99.8%
Taylor expanded in t around 0 99.4%
associate-*r/99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around inf 58.8%
Final simplification64.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.7e-189) (not (<= z 7e-38))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (/ (/ 2.0 t) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.7e-189) || !(z <= 7e-38)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (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 <= (-1.7d-189)) .or. (.not. (z <= 7d-38))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = (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 <= -1.7e-189) || !(z <= 7e-38)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (2.0 / t) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.7e-189) or not (z <= 7e-38): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = (2.0 / t) / z return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.7e-189) || !(z <= 7e-38)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(2.0 / t) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.7e-189) || ~((z <= 7e-38))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = (2.0 / t) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.7e-189], N[Not[LessEqual[z, 7e-38]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-189} \lor \neg \left(z \leq 7 \cdot 10^{-38}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if z < -1.7000000000000001e-189 or 7.0000000000000003e-38 < z Initial program 76.1%
Taylor expanded in z around inf 89.6%
div-sub89.6%
sub-neg89.6%
*-inverses89.6%
metadata-eval89.6%
distribute-lft-in89.6%
associate-*r/89.6%
metadata-eval89.6%
metadata-eval89.6%
Simplified89.6%
if -1.7000000000000001e-189 < z < 7.0000000000000003e-38Initial program 96.7%
Taylor expanded in t around 0 89.9%
associate-+r+89.9%
associate-*r/89.9%
metadata-eval89.9%
sub-neg89.9%
metadata-eval89.9%
Simplified89.9%
Taylor expanded in z around 0 69.6%
*-un-lft-identity69.6%
*-commutative69.6%
associate-/r*69.7%
Applied egg-rr69.7%
Final simplification82.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.6e-32) (not (<= z 4.9e-8))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (/ 2.0 (* t z)) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.6e-32) || !(z <= 4.9e-8)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (2.0 / (t * z)) + (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 ((z <= (-1.6d-32)) .or. (.not. (z <= 4.9d-8))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = (2.0d0 / (t * z)) + (x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.6e-32) || !(z <= 4.9e-8)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (2.0 / (t * z)) + (x / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.6e-32) or not (z <= 4.9e-8): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = (2.0 / (t * z)) + (x / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.6e-32) || !(z <= 4.9e-8)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(2.0 / Float64(t * z)) + Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.6e-32) || ~((z <= 4.9e-8))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = (2.0 / (t * z)) + (x / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.6e-32], N[Not[LessEqual[z, 4.9e-8]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-32} \lor \neg \left(z \leq 4.9 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t \cdot z} + \frac{x}{y}\\
\end{array}
\end{array}
if z < -1.6000000000000001e-32 or 4.9000000000000002e-8 < z Initial program 69.9%
Taylor expanded in z around inf 97.4%
div-sub97.4%
sub-neg97.4%
*-inverses97.4%
metadata-eval97.4%
distribute-lft-in97.4%
associate-*r/97.4%
metadata-eval97.4%
metadata-eval97.4%
Simplified97.4%
if -1.6000000000000001e-32 < z < 4.9000000000000002e-8Initial program 97.5%
Taylor expanded in z around 0 87.3%
Final simplification92.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -8.8e-33) (not (<= z 8.5e-9))) (+ (/ 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 <= -8.8e-33) || !(z <= 8.5e-9)) {
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 <= (-8.8d-33)) .or. (.not. (z <= 8.5d-9))) 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 <= -8.8e-33) || !(z <= 8.5e-9)) {
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 <= -8.8e-33) or not (z <= 8.5e-9): 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 <= -8.8e-33) || !(z <= 8.5e-9)) 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 <= -8.8e-33) || ~((z <= 8.5e-9))) 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, -8.8e-33], N[Not[LessEqual[z, 8.5e-9]], $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 -8.8 \cdot 10^{-33} \lor \neg \left(z \leq 8.5 \cdot 10^{-9}\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 < -8.80000000000000022e-33 or 8.5e-9 < z Initial program 69.9%
Taylor expanded in z around inf 97.4%
div-sub97.4%
sub-neg97.4%
*-inverses97.4%
metadata-eval97.4%
distribute-lft-in97.4%
associate-*r/97.4%
metadata-eval97.4%
metadata-eval97.4%
Simplified97.4%
if -8.80000000000000022e-33 < z < 8.5e-9Initial program 97.5%
Taylor expanded in z around 0 87.3%
associate-/r*87.4%
Simplified87.4%
Final simplification92.3%
(FPCore (x y z t)
:precision binary64
(if (<= z -4.2e-31)
(+ (/ x y) (+ -2.0 (/ 2.0 t)))
(if (<= z 7.2e-8)
(+ (/ x y) (/ (/ 2.0 t) z))
(- (+ (/ x y) (/ 2.0 t)) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.2e-31) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else if (z <= 7.2e-8) {
tmp = (x / y) + ((2.0 / t) / z);
} else {
tmp = ((x / y) + (2.0 / t)) - 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-4.2d-31)) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else if (z <= 7.2d-8) then
tmp = (x / y) + ((2.0d0 / t) / z)
else
tmp = ((x / y) + (2.0d0 / t)) - 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.2e-31) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else if (z <= 7.2e-8) {
tmp = (x / y) + ((2.0 / t) / z);
} else {
tmp = ((x / y) + (2.0 / t)) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.2e-31: tmp = (x / y) + (-2.0 + (2.0 / t)) elif z <= 7.2e-8: tmp = (x / y) + ((2.0 / t) / z) else: tmp = ((x / y) + (2.0 / t)) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.2e-31) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); elseif (z <= 7.2e-8) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); else tmp = Float64(Float64(Float64(x / y) + Float64(2.0 / t)) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.2e-31) tmp = (x / y) + (-2.0 + (2.0 / t)); elseif (z <= 7.2e-8) tmp = (x / y) + ((2.0 / t) / z); else tmp = ((x / y) + (2.0 / t)) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.2e-31], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e-8], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-31}:\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-8}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{x}{y} + \frac{2}{t}\right) - 2\\
\end{array}
\end{array}
if z < -4.19999999999999982e-31Initial program 66.4%
Taylor expanded in z around inf 95.5%
div-sub95.5%
sub-neg95.5%
*-inverses95.5%
metadata-eval95.5%
distribute-lft-in95.5%
associate-*r/95.5%
metadata-eval95.5%
metadata-eval95.5%
Simplified95.5%
if -4.19999999999999982e-31 < z < 7.19999999999999962e-8Initial program 97.5%
Taylor expanded in z around 0 87.3%
associate-/r*87.4%
Simplified87.4%
if 7.19999999999999962e-8 < z Initial program 73.0%
Taylor expanded in t around inf 100.0%
Taylor expanded in z around inf 99.1%
associate-*r/99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Final simplification92.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -0.106) (not (<= (/ x y) 1.26e+21))) (/ x y) (/ 2.0 t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -0.106) || !((x / y) <= 1.26e+21)) {
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) <= (-0.106d0)) .or. (.not. ((x / y) <= 1.26d+21))) 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) <= -0.106) || !((x / y) <= 1.26e+21)) {
tmp = x / y;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -0.106) or not ((x / y) <= 1.26e+21): tmp = x / y else: tmp = 2.0 / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -0.106) || !(Float64(x / y) <= 1.26e+21)) 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) <= -0.106) || ~(((x / y) <= 1.26e+21))) 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], -0.106], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1.26e+21]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(2.0 / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -0.106 \lor \neg \left(\frac{x}{y} \leq 1.26 \cdot 10^{+21}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -0.105999999999999997 or 1.26e21 < (/.f64 x y) Initial program 81.6%
Taylor expanded in x around inf 69.2%
if -0.105999999999999997 < (/.f64 x y) < 1.26e21Initial program 86.1%
Taylor expanded in t around 0 66.4%
associate-*r/66.4%
metadata-eval66.4%
Simplified66.4%
Taylor expanded in z around inf 26.7%
Final simplification48.5%
(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(-2.0 + Float64(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[(-2.0 + N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-2 + \left(\frac{x}{y} + \frac{2 + \frac{2}{z}}{t}\right)
\end{array}
Initial program 83.8%
+-commutative83.8%
remove-double-neg83.8%
distribute-frac-neg83.8%
unsub-neg83.8%
*-commutative83.8%
associate-*r*83.8%
distribute-rgt1-in83.8%
associate-/l*83.7%
fma-neg83.7%
*-commutative83.7%
fma-define83.7%
*-commutative83.7%
distribute-frac-neg83.7%
remove-double-neg83.7%
Simplified83.7%
Taylor expanded in t around inf 98.3%
sub-neg98.3%
metadata-eval98.3%
+-commutative98.3%
+-commutative98.3%
associate-*r/98.3%
distribute-lft-in98.3%
metadata-eval98.3%
associate-*r/98.3%
metadata-eval98.3%
Simplified98.3%
Final simplification98.3%
(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 83.8%
Taylor expanded in t around 0 48.8%
associate-*r/48.8%
metadata-eval48.8%
Simplified48.8%
Taylor expanded in z around inf 18.0%
Final simplification18.0%
(FPCore (x y z t) :precision binary64 (- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y))))
double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((2.0d0 / z) + 2.0d0) / t) - (2.0d0 - (x / y))
end function
public static double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
def code(x, y, z, t): return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(2.0 / z) + 2.0) / t) - Float64(2.0 - Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = (((2.0 / z) + 2.0) / t) - (2.0 - (x / y)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(2.0 / z), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] - N[(2.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{2}{z} + 2}{t} - \left(2 - \frac{x}{y}\right)
\end{array}
herbie shell --seed 2024053
(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))))