
(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 18 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 (let* ((t_1 (+ (/ x y) (/ (+ 2.0 (* (- 1.0 t) (* 2.0 z))) (* t z))))) (if (<= t_1 INFINITY) t_1 (+ (/ x y) -2.0))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + ((2.0 + ((1.0 - t) * (2.0 * z))) / (t * z));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (x / y) + -2.0;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + ((2.0 + ((1.0 - t) * (2.0 * z))) / (t * z));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (x / y) + -2.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + ((2.0 + ((1.0 - t) * (2.0 * z))) / (t * z)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = (x / y) + -2.0 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(1.0 - t) * Float64(2.0 * z))) / Float64(t * z))) tmp = 0.0 if (t_1 <= Inf) 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 = (x / y) + ((2.0 + ((1.0 - t) * (2.0 * z))) / (t * z)); tmp = 0.0; if (t_1 <= Inf) 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[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(1.0 - t), $MachinePrecision] * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2 + \left(1 - t\right) \cdot \left(2 \cdot z\right)}{t \cdot z}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + -2\\
\end{array}
\end{array}
if (+.f64 (/.f64 x y) (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z))) < +inf.0Initial program 99.8%
if +inf.0 < (+.f64 (/.f64 x y) (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z))) Initial program 0.0%
Taylor expanded in t around inf 100.0%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (+ (fma 2.0 (/ (- 1.0 t) t) (/ (/ 2.0 t) z)) (/ x y)))
double code(double x, double y, double z, double t) {
return fma(2.0, ((1.0 - t) / t), ((2.0 / t) / z)) + (x / y);
}
function code(x, y, z, t) return Float64(fma(2.0, Float64(Float64(1.0 - t) / t), Float64(Float64(2.0 / t) / z)) + Float64(x / y)) end
code[x_, y_, z_, t_] := N[(N[(2.0 * N[(N[(1.0 - t), $MachinePrecision] / t), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(2, \frac{1 - t}{t}, \frac{\frac{2}{t}}{z}\right) + \frac{x}{y}
\end{array}
Initial program 84.6%
Taylor expanded in x around 0 99.5%
associate-+r+99.5%
+-commutative99.5%
fma-define99.5%
associate-*r/99.5%
metadata-eval99.5%
associate-/r*99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ 2.0 (/ 2.0 z)) t)) (t_2 (+ (/ (/ 2.0 t) z) (/ x y))))
(if (<= (/ x y) -2000.0)
t_2
(if (<= (/ x y) 5e-31)
(+ -2.0 t_1)
(if (<= (/ x y) 2e+51)
(+ (/ x y) (+ (/ 2.0 t) -2.0))
(if (<= (/ x y) 5e+90) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 + (2.0 / z)) / t;
double t_2 = ((2.0 / t) / z) + (x / y);
double tmp;
if ((x / y) <= -2000.0) {
tmp = t_2;
} else if ((x / y) <= 5e-31) {
tmp = -2.0 + t_1;
} else if ((x / y) <= 2e+51) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else if ((x / y) <= 5e+90) {
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 / z)) / t
t_2 = ((2.0d0 / t) / z) + (x / y)
if ((x / y) <= (-2000.0d0)) then
tmp = t_2
else if ((x / y) <= 5d-31) then
tmp = (-2.0d0) + t_1
else if ((x / y) <= 2d+51) then
tmp = (x / y) + ((2.0d0 / t) + (-2.0d0))
else if ((x / y) <= 5d+90) 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 / z)) / t;
double t_2 = ((2.0 / t) / z) + (x / y);
double tmp;
if ((x / y) <= -2000.0) {
tmp = t_2;
} else if ((x / y) <= 5e-31) {
tmp = -2.0 + t_1;
} else if ((x / y) <= 2e+51) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else if ((x / y) <= 5e+90) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 + (2.0 / z)) / t t_2 = ((2.0 / t) / z) + (x / y) tmp = 0 if (x / y) <= -2000.0: tmp = t_2 elif (x / y) <= 5e-31: tmp = -2.0 + t_1 elif (x / y) <= 2e+51: tmp = (x / y) + ((2.0 / t) + -2.0) elif (x / y) <= 5e+90: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 + Float64(2.0 / z)) / t) t_2 = Float64(Float64(Float64(2.0 / t) / z) + Float64(x / y)) tmp = 0.0 if (Float64(x / y) <= -2000.0) tmp = t_2; elseif (Float64(x / y) <= 5e-31) tmp = Float64(-2.0 + t_1); elseif (Float64(x / y) <= 2e+51) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); elseif (Float64(x / y) <= 5e+90) 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 / z)) / t; t_2 = ((2.0 / t) / z) + (x / y); tmp = 0.0; if ((x / y) <= -2000.0) tmp = t_2; elseif ((x / y) <= 5e-31) tmp = -2.0 + t_1; elseif ((x / y) <= 2e+51) tmp = (x / y) + ((2.0 / t) + -2.0); elseif ((x / y) <= 5e+90) tmp = t_1; else tmp = t_2; 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]}, Block[{t$95$2 = N[(N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -2000.0], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], 5e-31], N[(-2.0 + t$95$1), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2e+51], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5e+90], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2 + \frac{2}{z}}{t}\\
t_2 := \frac{\frac{2}{t}}{z} + \frac{x}{y}\\
\mathbf{if}\;\frac{x}{y} \leq -2000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-31}:\\
\;\;\;\;-2 + t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+51}:\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{+90}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 x y) < -2e3 or 5.0000000000000004e90 < (/.f64 x y) Initial program 85.5%
Taylor expanded in z around 0 96.0%
associate-/r*96.0%
Simplified96.0%
if -2e3 < (/.f64 x y) < 5e-31Initial program 83.3%
Taylor expanded in x around 0 99.9%
associate-+r+99.9%
+-commutative99.9%
fma-define99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in x around 0 99.4%
distribute-lft-out99.4%
div-sub99.4%
*-inverses99.4%
sub-neg99.4%
metadata-eval99.4%
distribute-lft-out99.4%
distribute-lft-in99.4%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
+-commutative99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-+l+99.4%
metadata-eval99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-*r/99.4%
associate-/r*99.4%
*-lft-identity99.4%
associate-*l/99.4%
associate-*r*99.4%
Simplified99.4%
if 5e-31 < (/.f64 x y) < 2e51Initial program 81.7%
Taylor expanded in z around inf 100.0%
div-sub100.0%
sub-neg100.0%
*-inverses100.0%
metadata-eval100.0%
distribute-lft-in100.0%
metadata-eval100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
if 2e51 < (/.f64 x y) < 5.0000000000000004e90Initial program 99.5%
Taylor expanded in t around 0 88.8%
associate-*r/88.8%
metadata-eval88.8%
Simplified88.8%
Final simplification97.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ (/ 2.0 t) z) (/ x y))))
(if (<= (/ x y) -2000.0)
t_1
(if (<= (/ x y) 5e-31)
(* 2.0 (/ (+ (- 1.0 t) (/ 1.0 z)) t))
(if (<= (/ x y) 2e+51)
(+ (/ x y) (+ (/ 2.0 t) -2.0))
(if (<= (/ x y) 5e+90) (/ (+ 2.0 (/ 2.0 z)) t) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = ((2.0 / t) / z) + (x / y);
double tmp;
if ((x / y) <= -2000.0) {
tmp = t_1;
} else if ((x / y) <= 5e-31) {
tmp = 2.0 * (((1.0 - t) + (1.0 / z)) / t);
} else if ((x / y) <= 2e+51) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else if ((x / y) <= 5e+90) {
tmp = (2.0 + (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 = ((2.0d0 / t) / z) + (x / y)
if ((x / y) <= (-2000.0d0)) then
tmp = t_1
else if ((x / y) <= 5d-31) then
tmp = 2.0d0 * (((1.0d0 - t) + (1.0d0 / z)) / t)
else if ((x / y) <= 2d+51) then
tmp = (x / y) + ((2.0d0 / t) + (-2.0d0))
else if ((x / y) <= 5d+90) then
tmp = (2.0d0 + (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 = ((2.0 / t) / z) + (x / y);
double tmp;
if ((x / y) <= -2000.0) {
tmp = t_1;
} else if ((x / y) <= 5e-31) {
tmp = 2.0 * (((1.0 - t) + (1.0 / z)) / t);
} else if ((x / y) <= 2e+51) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else if ((x / y) <= 5e+90) {
tmp = (2.0 + (2.0 / z)) / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((2.0 / t) / z) + (x / y) tmp = 0 if (x / y) <= -2000.0: tmp = t_1 elif (x / y) <= 5e-31: tmp = 2.0 * (((1.0 - t) + (1.0 / z)) / t) elif (x / y) <= 2e+51: tmp = (x / y) + ((2.0 / t) + -2.0) elif (x / y) <= 5e+90: tmp = (2.0 + (2.0 / z)) / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(2.0 / t) / z) + Float64(x / y)) tmp = 0.0 if (Float64(x / y) <= -2000.0) tmp = t_1; elseif (Float64(x / y) <= 5e-31) tmp = Float64(2.0 * Float64(Float64(Float64(1.0 - t) + Float64(1.0 / z)) / t)); elseif (Float64(x / y) <= 2e+51) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); elseif (Float64(x / y) <= 5e+90) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((2.0 / t) / z) + (x / y); tmp = 0.0; if ((x / y) <= -2000.0) tmp = t_1; elseif ((x / y) <= 5e-31) tmp = 2.0 * (((1.0 - t) + (1.0 / z)) / t); elseif ((x / y) <= 2e+51) tmp = (x / y) + ((2.0 / t) + -2.0); elseif ((x / y) <= 5e+90) tmp = (2.0 + (2.0 / z)) / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -2000.0], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 5e-31], N[(2.0 * N[(N[(N[(1.0 - t), $MachinePrecision] + N[(1.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2e+51], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5e+90], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{2}{t}}{z} + \frac{x}{y}\\
\mathbf{if}\;\frac{x}{y} \leq -2000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-31}:\\
\;\;\;\;2 \cdot \frac{\left(1 - t\right) + \frac{1}{z}}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+51}:\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{+90}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -2e3 or 5.0000000000000004e90 < (/.f64 x y) Initial program 85.5%
Taylor expanded in z around 0 96.0%
associate-/r*96.0%
Simplified96.0%
if -2e3 < (/.f64 x y) < 5e-31Initial program 83.3%
+-commutative83.3%
remove-double-neg83.3%
distribute-frac-neg83.3%
unsub-neg83.3%
*-commutative83.3%
associate-*r*83.3%
distribute-rgt1-in83.3%
associate-/l*83.2%
fma-neg83.2%
*-commutative83.2%
fma-define83.2%
*-commutative83.2%
distribute-frac-neg83.2%
remove-double-neg83.2%
Simplified83.2%
Taylor expanded in x around 0 82.8%
Taylor expanded in t around 0 99.5%
neg-mul-199.5%
associate-+r+99.5%
sub-neg99.5%
Simplified99.5%
if 5e-31 < (/.f64 x y) < 2e51Initial program 81.7%
Taylor expanded in z around inf 100.0%
div-sub100.0%
sub-neg100.0%
*-inverses100.0%
metadata-eval100.0%
distribute-lft-in100.0%
metadata-eval100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
if 2e51 < (/.f64 x y) < 5.0000000000000004e90Initial program 99.5%
Taylor expanded in t around 0 88.8%
associate-*r/88.8%
metadata-eval88.8%
Simplified88.8%
Final simplification97.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 2.0 (* t z))) (t_2 (+ (/ x y) -2.0)))
(if (<= z -1.05e-34)
t_2
(if (<= z -1.95e-53)
t_1
(if (<= z -1.16e-114)
t_2
(if (<= z 2.35e-8)
t_1
(if (or (<= z 1.82e+140) (not (<= z 2.6e+183)))
t_2
(+ (/ 2.0 t) -2.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 / (t * z);
double t_2 = (x / y) + -2.0;
double tmp;
if (z <= -1.05e-34) {
tmp = t_2;
} else if (z <= -1.95e-53) {
tmp = t_1;
} else if (z <= -1.16e-114) {
tmp = t_2;
} else if (z <= 2.35e-8) {
tmp = t_1;
} else if ((z <= 1.82e+140) || !(z <= 2.6e+183)) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 / (t * z)
t_2 = (x / y) + (-2.0d0)
if (z <= (-1.05d-34)) then
tmp = t_2
else if (z <= (-1.95d-53)) then
tmp = t_1
else if (z <= (-1.16d-114)) then
tmp = t_2
else if (z <= 2.35d-8) then
tmp = t_1
else if ((z <= 1.82d+140) .or. (.not. (z <= 2.6d+183))) then
tmp = t_2
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 t_1 = 2.0 / (t * z);
double t_2 = (x / y) + -2.0;
double tmp;
if (z <= -1.05e-34) {
tmp = t_2;
} else if (z <= -1.95e-53) {
tmp = t_1;
} else if (z <= -1.16e-114) {
tmp = t_2;
} else if (z <= 2.35e-8) {
tmp = t_1;
} else if ((z <= 1.82e+140) || !(z <= 2.6e+183)) {
tmp = t_2;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 / (t * z) t_2 = (x / y) + -2.0 tmp = 0 if z <= -1.05e-34: tmp = t_2 elif z <= -1.95e-53: tmp = t_1 elif z <= -1.16e-114: tmp = t_2 elif z <= 2.35e-8: tmp = t_1 elif (z <= 1.82e+140) or not (z <= 2.6e+183): tmp = t_2 else: tmp = (2.0 / t) + -2.0 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 / Float64(t * z)) t_2 = Float64(Float64(x / y) + -2.0) tmp = 0.0 if (z <= -1.05e-34) tmp = t_2; elseif (z <= -1.95e-53) tmp = t_1; elseif (z <= -1.16e-114) tmp = t_2; elseif (z <= 2.35e-8) tmp = t_1; elseif ((z <= 1.82e+140) || !(z <= 2.6e+183)) tmp = t_2; else tmp = Float64(Float64(2.0 / t) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 / (t * z); t_2 = (x / y) + -2.0; tmp = 0.0; if (z <= -1.05e-34) tmp = t_2; elseif (z <= -1.95e-53) tmp = t_1; elseif (z <= -1.16e-114) tmp = t_2; elseif (z <= 2.35e-8) tmp = t_1; elseif ((z <= 1.82e+140) || ~((z <= 2.6e+183))) tmp = t_2; else tmp = (2.0 / t) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[z, -1.05e-34], t$95$2, If[LessEqual[z, -1.95e-53], t$95$1, If[LessEqual[z, -1.16e-114], t$95$2, If[LessEqual[z, 2.35e-8], t$95$1, If[Or[LessEqual[z, 1.82e+140], N[Not[LessEqual[z, 2.6e+183]], $MachinePrecision]], t$95$2, N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{t \cdot z}\\
t_2 := \frac{x}{y} + -2\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{-34}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.16 \cdot 10^{-114}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.82 \cdot 10^{+140} \lor \neg \left(z \leq 2.6 \cdot 10^{+183}\right):\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if z < -1.05e-34 or -1.9500000000000001e-53 < z < -1.1599999999999999e-114 or 2.3499999999999999e-8 < z < 1.82e140 or 2.5999999999999999e183 < z Initial program 74.2%
Taylor expanded in t around inf 73.2%
if -1.05e-34 < z < -1.9500000000000001e-53 or -1.1599999999999999e-114 < z < 2.3499999999999999e-8Initial program 98.9%
Taylor expanded in x around 0 98.9%
associate-+r+98.9%
+-commutative98.9%
fma-define98.9%
associate-*r/98.9%
metadata-eval98.9%
associate-/r*98.9%
Simplified98.9%
Taylor expanded in z around 0 70.2%
*-commutative70.2%
Simplified70.2%
if 1.82e140 < z < 2.5999999999999999e183Initial program 85.5%
Taylor expanded in z around inf 100.0%
div-sub100.0%
sub-neg100.0%
*-inverses100.0%
metadata-eval100.0%
distribute-lft-in100.0%
metadata-eval100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 46.4%
sub-neg46.4%
associate-*r/46.4%
metadata-eval46.4%
metadata-eval46.4%
+-commutative46.4%
Simplified46.4%
Taylor expanded in x around 0 100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Final simplification72.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) -2.0)))
(if (<= z -1.32e-34)
t_1
(if (<= z -9e-54)
(/ (/ 2.0 z) t)
(if (<= z -9e-114)
t_1
(if (<= z 2.35e-8)
(/ 2.0 (* t z))
(if (or (<= z 1.32e+140) (not (<= z 1.3e+182)))
t_1
(+ (/ 2.0 t) -2.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double tmp;
if (z <= -1.32e-34) {
tmp = t_1;
} else if (z <= -9e-54) {
tmp = (2.0 / z) / t;
} else if (z <= -9e-114) {
tmp = t_1;
} else if (z <= 2.35e-8) {
tmp = 2.0 / (t * z);
} else if ((z <= 1.32e+140) || !(z <= 1.3e+182)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x / y) + (-2.0d0)
if (z <= (-1.32d-34)) then
tmp = t_1
else if (z <= (-9d-54)) then
tmp = (2.0d0 / z) / t
else if (z <= (-9d-114)) then
tmp = t_1
else if (z <= 2.35d-8) then
tmp = 2.0d0 / (t * z)
else if ((z <= 1.32d+140) .or. (.not. (z <= 1.3d+182))) then
tmp = t_1
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 t_1 = (x / y) + -2.0;
double tmp;
if (z <= -1.32e-34) {
tmp = t_1;
} else if (z <= -9e-54) {
tmp = (2.0 / z) / t;
} else if (z <= -9e-114) {
tmp = t_1;
} else if (z <= 2.35e-8) {
tmp = 2.0 / (t * z);
} else if ((z <= 1.32e+140) || !(z <= 1.3e+182)) {
tmp = t_1;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + -2.0 tmp = 0 if z <= -1.32e-34: tmp = t_1 elif z <= -9e-54: tmp = (2.0 / z) / t elif z <= -9e-114: tmp = t_1 elif z <= 2.35e-8: tmp = 2.0 / (t * z) elif (z <= 1.32e+140) or not (z <= 1.3e+182): tmp = t_1 else: tmp = (2.0 / t) + -2.0 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + -2.0) tmp = 0.0 if (z <= -1.32e-34) tmp = t_1; elseif (z <= -9e-54) tmp = Float64(Float64(2.0 / z) / t); elseif (z <= -9e-114) tmp = t_1; elseif (z <= 2.35e-8) tmp = Float64(2.0 / Float64(t * z)); elseif ((z <= 1.32e+140) || !(z <= 1.3e+182)) tmp = t_1; else tmp = Float64(Float64(2.0 / t) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + -2.0; tmp = 0.0; if (z <= -1.32e-34) tmp = t_1; elseif (z <= -9e-54) tmp = (2.0 / z) / t; elseif (z <= -9e-114) tmp = t_1; elseif (z <= 2.35e-8) tmp = 2.0 / (t * z); elseif ((z <= 1.32e+140) || ~((z <= 1.3e+182))) tmp = t_1; else tmp = (2.0 / t) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[z, -1.32e-34], t$95$1, If[LessEqual[z, -9e-54], N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, -9e-114], t$95$1, If[LessEqual[z, 2.35e-8], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.32e+140], N[Not[LessEqual[z, 1.3e+182]], $MachinePrecision]], t$95$1, N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
\mathbf{if}\;z \leq -1.32 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-54}:\\
\;\;\;\;\frac{\frac{2}{z}}{t}\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{-8}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{+140} \lor \neg \left(z \leq 1.3 \cdot 10^{+182}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if z < -1.32e-34 or -8.9999999999999997e-54 < z < -8.99999999999999937e-114 or 2.3499999999999999e-8 < z < 1.3200000000000001e140 or 1.3e182 < z Initial program 74.2%
Taylor expanded in t around inf 73.2%
if -1.32e-34 < z < -8.9999999999999997e-54Initial 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 92.2%
if -8.99999999999999937e-114 < z < 2.3499999999999999e-8Initial program 98.9%
Taylor expanded in x around 0 98.9%
associate-+r+98.9%
+-commutative98.9%
fma-define98.9%
associate-*r/98.9%
metadata-eval98.9%
associate-/r*98.9%
Simplified98.9%
Taylor expanded in z around 0 69.1%
*-commutative69.1%
Simplified69.1%
if 1.3200000000000001e140 < z < 1.3e182Initial program 85.5%
Taylor expanded in z around inf 100.0%
div-sub100.0%
sub-neg100.0%
*-inverses100.0%
metadata-eval100.0%
distribute-lft-in100.0%
metadata-eval100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 46.4%
sub-neg46.4%
associate-*r/46.4%
metadata-eval46.4%
metadata-eval46.4%
+-commutative46.4%
Simplified46.4%
Taylor expanded in x around 0 100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Final simplification72.7%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -2.0)
(/ x y)
(if (<= (/ x y) 4.5e-96)
-2.0
(if (<= (/ x y) 1.24e-48) (/ 2.0 t) (if (<= (/ x y) 2.0) -2.0 (/ x y))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2.0) {
tmp = x / y;
} else if ((x / y) <= 4.5e-96) {
tmp = -2.0;
} else if ((x / y) <= 1.24e-48) {
tmp = 2.0 / t;
} else if ((x / y) <= 2.0) {
tmp = -2.0;
} 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) <= (-2.0d0)) then
tmp = x / y
else if ((x / y) <= 4.5d-96) then
tmp = -2.0d0
else if ((x / y) <= 1.24d-48) then
tmp = 2.0d0 / t
else if ((x / y) <= 2.0d0) then
tmp = -2.0d0
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) <= -2.0) {
tmp = x / y;
} else if ((x / y) <= 4.5e-96) {
tmp = -2.0;
} else if ((x / y) <= 1.24e-48) {
tmp = 2.0 / t;
} else if ((x / y) <= 2.0) {
tmp = -2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2.0: tmp = x / y elif (x / y) <= 4.5e-96: tmp = -2.0 elif (x / y) <= 1.24e-48: tmp = 2.0 / t elif (x / y) <= 2.0: tmp = -2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2.0) tmp = Float64(x / y); elseif (Float64(x / y) <= 4.5e-96) tmp = -2.0; elseif (Float64(x / y) <= 1.24e-48) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 2.0) tmp = -2.0; else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -2.0) tmp = x / y; elseif ((x / y) <= 4.5e-96) tmp = -2.0; elseif ((x / y) <= 1.24e-48) tmp = 2.0 / t; elseif ((x / y) <= 2.0) tmp = -2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2.0], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 4.5e-96], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 1.24e-48], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2.0], -2.0, N[(x / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 4.5 \cdot 10^{-96}:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq 1.24 \cdot 10^{-48}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 2:\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -2 or 2 < (/.f64 x y) Initial program 85.9%
Taylor expanded in x around inf 70.4%
if -2 < (/.f64 x y) < 4.5e-96 or 1.24e-48 < (/.f64 x y) < 2Initial program 82.3%
+-commutative82.3%
remove-double-neg82.3%
distribute-frac-neg82.3%
unsub-neg82.3%
*-commutative82.3%
associate-*r*82.3%
distribute-rgt1-in82.3%
associate-/l*82.3%
fma-neg82.3%
*-commutative82.3%
fma-define82.3%
*-commutative82.3%
distribute-frac-neg82.3%
remove-double-neg82.3%
Simplified82.3%
Taylor expanded in x around 0 81.1%
Taylor expanded in t around inf 59.3%
mul-1-neg59.3%
*-commutative59.3%
distribute-rgt-neg-in59.3%
Simplified59.3%
Taylor expanded in z around inf 41.3%
if 4.5e-96 < (/.f64 x y) < 1.24e-48Initial program 99.8%
Taylor expanded in t around 0 93.6%
associate-*r/93.6%
metadata-eval93.6%
Simplified93.6%
Taylor expanded in z around inf 57.5%
Final simplification56.4%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2e+122) (not (<= (/ x y) 0.02))) (+ (/ x y) (+ (/ 2.0 t) (/ (/ 2.0 z) t))) (/ (+ (+ 2.0 (/ 2.0 z)) (* t (+ (/ x y) -2.0))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2e+122) || !((x / y) <= 0.02)) {
tmp = (x / y) + ((2.0 / t) + ((2.0 / z) / t));
} else {
tmp = ((2.0 + (2.0 / z)) + (t * ((x / y) + -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) <= (-2d+122)) .or. (.not. ((x / y) <= 0.02d0))) then
tmp = (x / y) + ((2.0d0 / t) + ((2.0d0 / z) / t))
else
tmp = ((2.0d0 + (2.0d0 / z)) + (t * ((x / y) + (-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) <= -2e+122) || !((x / y) <= 0.02)) {
tmp = (x / y) + ((2.0 / t) + ((2.0 / z) / t));
} else {
tmp = ((2.0 + (2.0 / z)) + (t * ((x / y) + -2.0))) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2e+122) or not ((x / y) <= 0.02): tmp = (x / y) + ((2.0 / t) + ((2.0 / z) / t)) else: tmp = ((2.0 + (2.0 / z)) + (t * ((x / y) + -2.0))) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2e+122) || !(Float64(x / y) <= 0.02)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + Float64(Float64(2.0 / z) / t))); else tmp = Float64(Float64(Float64(2.0 + Float64(2.0 / z)) + Float64(t * Float64(Float64(x / y) + -2.0))) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2e+122) || ~(((x / y) <= 0.02))) tmp = (x / y) + ((2.0 / t) + ((2.0 / z) / t)); else tmp = ((2.0 + (2.0 / z)) + (t * ((x / y) + -2.0))) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2e+122], N[Not[LessEqual[N[(x / y), $MachinePrecision], 0.02]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] + N[(t * N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+122} \lor \neg \left(\frac{x}{y} \leq 0.02\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + \frac{\frac{2}{z}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(2 + \frac{2}{z}\right) + t \cdot \left(\frac{x}{y} + -2\right)}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -2.00000000000000003e122 or 0.0200000000000000004 < (/.f64 x y) Initial program 84.0%
Taylor expanded in x around 0 99.0%
associate-+r+99.0%
+-commutative99.0%
fma-define99.0%
associate-*r/99.0%
metadata-eval99.0%
associate-/r*99.0%
Simplified99.0%
Taylor expanded in t around 0 99.0%
fma-undefine99.0%
div-inv99.0%
+-commutative99.0%
associate-/l/99.0%
associate-/r*99.0%
Applied egg-rr99.0%
if -2.00000000000000003e122 < (/.f64 x y) < 0.0200000000000000004Initial program 85.1%
Taylor expanded in t around 0 99.9%
associate-+r+99.9%
associate-*r/99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ 2.0 t) (/ x y))) (t_2 (+ (/ x y) -2.0)))
(if (<= t -5e+14)
t_2
(if (<= t -1e-191)
t_1
(if (<= t -2.5e-275)
(/ 2.0 (* t z))
(if (<= t 29500000000000.0) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 / t) + (x / y);
double t_2 = (x / y) + -2.0;
double tmp;
if (t <= -5e+14) {
tmp = t_2;
} else if (t <= -1e-191) {
tmp = t_1;
} else if (t <= -2.5e-275) {
tmp = 2.0 / (t * z);
} else if (t <= 29500000000000.0) {
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 / t) + (x / y)
t_2 = (x / y) + (-2.0d0)
if (t <= (-5d+14)) then
tmp = t_2
else if (t <= (-1d-191)) then
tmp = t_1
else if (t <= (-2.5d-275)) then
tmp = 2.0d0 / (t * z)
else if (t <= 29500000000000.0d0) 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 / t) + (x / y);
double t_2 = (x / y) + -2.0;
double tmp;
if (t <= -5e+14) {
tmp = t_2;
} else if (t <= -1e-191) {
tmp = t_1;
} else if (t <= -2.5e-275) {
tmp = 2.0 / (t * z);
} else if (t <= 29500000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 / t) + (x / y) t_2 = (x / y) + -2.0 tmp = 0 if t <= -5e+14: tmp = t_2 elif t <= -1e-191: tmp = t_1 elif t <= -2.5e-275: tmp = 2.0 / (t * z) elif t <= 29500000000000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 / t) + Float64(x / y)) t_2 = Float64(Float64(x / y) + -2.0) tmp = 0.0 if (t <= -5e+14) tmp = t_2; elseif (t <= -1e-191) tmp = t_1; elseif (t <= -2.5e-275) tmp = Float64(2.0 / Float64(t * z)); elseif (t <= 29500000000000.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 / t) + (x / y); t_2 = (x / y) + -2.0; tmp = 0.0; if (t <= -5e+14) tmp = t_2; elseif (t <= -1e-191) tmp = t_1; elseif (t <= -2.5e-275) tmp = 2.0 / (t * z); elseif (t <= 29500000000000.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 / t), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[t, -5e+14], t$95$2, If[LessEqual[t, -1e-191], t$95$1, If[LessEqual[t, -2.5e-275], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 29500000000000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{t} + \frac{x}{y}\\
t_2 := \frac{x}{y} + -2\\
\mathbf{if}\;t \leq -5 \cdot 10^{+14}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -1 \cdot 10^{-191}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.5 \cdot 10^{-275}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;t \leq 29500000000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -5e14 or 2.95e13 < t Initial program 66.9%
Taylor expanded in t around inf 86.2%
if -5e14 < t < -1e-191 or -2.49999999999999992e-275 < t < 2.95e13Initial program 98.9%
Taylor expanded in x around 0 99.0%
associate-+r+99.0%
+-commutative99.0%
fma-define99.0%
associate-*r/99.0%
metadata-eval99.0%
associate-/r*99.0%
Simplified99.0%
Taylor expanded in t around 0 98.3%
Taylor expanded in z around inf 64.8%
associate-*r/64.8%
metadata-eval64.8%
+-commutative64.8%
Simplified64.8%
if -1e-191 < t < -2.49999999999999992e-275Initial program 99.8%
Taylor expanded in x around 0 99.9%
associate-+r+99.9%
+-commutative99.9%
fma-define99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in z around 0 73.4%
*-commutative73.4%
Simplified73.4%
Final simplification75.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ 2.0 (/ 2.0 z)) t)) (t_2 (+ (/ x y) -2.0)))
(if (<= t -1e-17)
t_2
(if (<= t -8e-45)
t_1
(if (<= t -5.2e-191)
(+ (/ 2.0 t) (/ x y))
(if (<= t 85000000000000.0) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 + (2.0 / z)) / t;
double t_2 = (x / y) + -2.0;
double tmp;
if (t <= -1e-17) {
tmp = t_2;
} else if (t <= -8e-45) {
tmp = t_1;
} else if (t <= -5.2e-191) {
tmp = (2.0 / t) + (x / y);
} else if (t <= 85000000000000.0) {
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 / z)) / t
t_2 = (x / y) + (-2.0d0)
if (t <= (-1d-17)) then
tmp = t_2
else if (t <= (-8d-45)) then
tmp = t_1
else if (t <= (-5.2d-191)) then
tmp = (2.0d0 / t) + (x / y)
else if (t <= 85000000000000.0d0) 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 / z)) / t;
double t_2 = (x / y) + -2.0;
double tmp;
if (t <= -1e-17) {
tmp = t_2;
} else if (t <= -8e-45) {
tmp = t_1;
} else if (t <= -5.2e-191) {
tmp = (2.0 / t) + (x / y);
} else if (t <= 85000000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 + (2.0 / z)) / t t_2 = (x / y) + -2.0 tmp = 0 if t <= -1e-17: tmp = t_2 elif t <= -8e-45: tmp = t_1 elif t <= -5.2e-191: tmp = (2.0 / t) + (x / y) elif t <= 85000000000000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 + Float64(2.0 / z)) / t) t_2 = Float64(Float64(x / y) + -2.0) tmp = 0.0 if (t <= -1e-17) tmp = t_2; elseif (t <= -8e-45) tmp = t_1; elseif (t <= -5.2e-191) tmp = Float64(Float64(2.0 / t) + Float64(x / y)); elseif (t <= 85000000000000.0) 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 / z)) / t; t_2 = (x / y) + -2.0; tmp = 0.0; if (t <= -1e-17) tmp = t_2; elseif (t <= -8e-45) tmp = t_1; elseif (t <= -5.2e-191) tmp = (2.0 / t) + (x / y); elseif (t <= 85000000000000.0) tmp = t_1; else tmp = t_2; 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]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[t, -1e-17], t$95$2, If[LessEqual[t, -8e-45], t$95$1, If[LessEqual[t, -5.2e-191], N[(N[(2.0 / t), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 85000000000000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2 + \frac{2}{z}}{t}\\
t_2 := \frac{x}{y} + -2\\
\mathbf{if}\;t \leq -1 \cdot 10^{-17}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -8 \cdot 10^{-45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -5.2 \cdot 10^{-191}:\\
\;\;\;\;\frac{2}{t} + \frac{x}{y}\\
\mathbf{elif}\;t \leq 85000000000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -1.00000000000000007e-17 or 8.5e13 < t Initial program 68.8%
Taylor expanded in t around inf 86.1%
if -1.00000000000000007e-17 < t < -7.99999999999999987e-45 or -5.19999999999999972e-191 < t < 8.5e13Initial program 98.9%
Taylor expanded in t around 0 80.9%
associate-*r/80.9%
metadata-eval80.9%
Simplified80.9%
if -7.99999999999999987e-45 < t < -5.19999999999999972e-191Initial program 99.7%
Taylor expanded in x around 0 100.0%
associate-+r+100.0%
+-commutative100.0%
fma-define100.0%
associate-*r/100.0%
metadata-eval100.0%
associate-/r*100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
Taylor expanded in z around inf 79.5%
associate-*r/79.5%
metadata-eval79.5%
+-commutative79.5%
Simplified79.5%
Final simplification83.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) -2.0)))
(if (<= t -3.6e-16)
t_1
(if (<= t -6.6e-45)
(* 2.0 (/ (+ 1.0 z) (* t z)))
(if (<= t -3e-190)
(+ (/ 2.0 t) (/ x y))
(if (<= t 31000000000000.0) (/ (+ 2.0 (/ 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 <= -3.6e-16) {
tmp = t_1;
} else if (t <= -6.6e-45) {
tmp = 2.0 * ((1.0 + z) / (t * z));
} else if (t <= -3e-190) {
tmp = (2.0 / t) + (x / y);
} else if (t <= 31000000000000.0) {
tmp = (2.0 + (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 <= (-3.6d-16)) then
tmp = t_1
else if (t <= (-6.6d-45)) then
tmp = 2.0d0 * ((1.0d0 + z) / (t * z))
else if (t <= (-3d-190)) then
tmp = (2.0d0 / t) + (x / y)
else if (t <= 31000000000000.0d0) then
tmp = (2.0d0 + (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 <= -3.6e-16) {
tmp = t_1;
} else if (t <= -6.6e-45) {
tmp = 2.0 * ((1.0 + z) / (t * z));
} else if (t <= -3e-190) {
tmp = (2.0 / t) + (x / y);
} else if (t <= 31000000000000.0) {
tmp = (2.0 + (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 <= -3.6e-16: tmp = t_1 elif t <= -6.6e-45: tmp = 2.0 * ((1.0 + z) / (t * z)) elif t <= -3e-190: tmp = (2.0 / t) + (x / y) elif t <= 31000000000000.0: tmp = (2.0 + (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 <= -3.6e-16) tmp = t_1; elseif (t <= -6.6e-45) tmp = Float64(2.0 * Float64(Float64(1.0 + z) / Float64(t * z))); elseif (t <= -3e-190) tmp = Float64(Float64(2.0 / t) + Float64(x / y)); elseif (t <= 31000000000000.0) tmp = Float64(Float64(2.0 + Float64(2.0 / 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 <= -3.6e-16) tmp = t_1; elseif (t <= -6.6e-45) tmp = 2.0 * ((1.0 + z) / (t * z)); elseif (t <= -3e-190) tmp = (2.0 / t) + (x / y); elseif (t <= 31000000000000.0) tmp = (2.0 + (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, -3.6e-16], t$95$1, If[LessEqual[t, -6.6e-45], N[(2.0 * N[(N[(1.0 + z), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3e-190], N[(N[(2.0 / t), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 31000000000000.0], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
\mathbf{if}\;t \leq -3.6 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -6.6 \cdot 10^{-45}:\\
\;\;\;\;2 \cdot \frac{1 + z}{t \cdot z}\\
\mathbf{elif}\;t \leq -3 \cdot 10^{-190}:\\
\;\;\;\;\frac{2}{t} + \frac{x}{y}\\
\mathbf{elif}\;t \leq 31000000000000:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.59999999999999983e-16 or 3.1e13 < t Initial program 68.8%
Taylor expanded in t around inf 86.1%
if -3.59999999999999983e-16 < t < -6.6000000000000001e-45Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
distribute-frac-neg100.0%
unsub-neg100.0%
*-commutative100.0%
associate-*r*100.0%
distribute-rgt1-in100.0%
associate-/l*100.0%
fma-neg100.0%
*-commutative100.0%
fma-define100.0%
*-commutative100.0%
distribute-frac-neg100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in t around 0 97.1%
if -6.6000000000000001e-45 < t < -2.9999999999999998e-190Initial program 99.7%
Taylor expanded in x around 0 100.0%
associate-+r+100.0%
+-commutative100.0%
fma-define100.0%
associate-*r/100.0%
metadata-eval100.0%
associate-/r*100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
Taylor expanded in z around inf 79.5%
associate-*r/79.5%
metadata-eval79.5%
+-commutative79.5%
Simplified79.5%
if -2.9999999999999998e-190 < t < 3.1e13Initial program 98.8%
Taylor expanded in t around 0 79.8%
associate-*r/79.8%
metadata-eval79.8%
Simplified79.8%
Final simplification83.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1e+17) (not (<= (/ x y) 0.02))) (+ (/ x y) (+ (/ 2.0 t) (/ (/ 2.0 z) t))) (* 2.0 (/ (+ (- 1.0 t) (/ 1.0 z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e+17) || !((x / y) <= 0.02)) {
tmp = (x / y) + ((2.0 / t) + ((2.0 / z) / t));
} else {
tmp = 2.0 * (((1.0 - t) + (1.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) <= (-1d+17)) .or. (.not. ((x / y) <= 0.02d0))) then
tmp = (x / y) + ((2.0d0 / t) + ((2.0d0 / z) / t))
else
tmp = 2.0d0 * (((1.0d0 - t) + (1.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) <= -1e+17) || !((x / y) <= 0.02)) {
tmp = (x / y) + ((2.0 / t) + ((2.0 / z) / t));
} else {
tmp = 2.0 * (((1.0 - t) + (1.0 / z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1e+17) or not ((x / y) <= 0.02): tmp = (x / y) + ((2.0 / t) + ((2.0 / z) / t)) else: tmp = 2.0 * (((1.0 - t) + (1.0 / z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1e+17) || !(Float64(x / y) <= 0.02)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + Float64(Float64(2.0 / z) / t))); else tmp = Float64(2.0 * Float64(Float64(Float64(1.0 - t) + Float64(1.0 / z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1e+17) || ~(((x / y) <= 0.02))) tmp = (x / y) + ((2.0 / t) + ((2.0 / z) / t)); else tmp = 2.0 * (((1.0 - t) + (1.0 / z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1e+17], N[Not[LessEqual[N[(x / y), $MachinePrecision], 0.02]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(1.0 - t), $MachinePrecision] + N[(1.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+17} \lor \neg \left(\frac{x}{y} \leq 0.02\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + \frac{\frac{2}{z}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\left(1 - t\right) + \frac{1}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1e17 or 0.0200000000000000004 < (/.f64 x y) Initial program 85.6%
Taylor expanded in x around 0 99.2%
associate-+r+99.2%
+-commutative99.2%
fma-define99.2%
associate-*r/99.2%
metadata-eval99.2%
associate-/r*99.1%
Simplified99.1%
Taylor expanded in t around 0 99.1%
fma-undefine99.1%
div-inv99.1%
+-commutative99.1%
associate-/l/99.2%
associate-/r*99.1%
Applied egg-rr99.1%
if -1e17 < (/.f64 x y) < 0.0200000000000000004Initial program 83.7%
+-commutative83.7%
remove-double-neg83.7%
distribute-frac-neg83.7%
unsub-neg83.7%
*-commutative83.7%
associate-*r*83.7%
distribute-rgt1-in83.7%
associate-/l*83.6%
fma-neg83.6%
*-commutative83.6%
fma-define83.6%
*-commutative83.6%
distribute-frac-neg83.6%
remove-double-neg83.6%
Simplified83.6%
Taylor expanded in x around 0 82.5%
Taylor expanded in t around 0 98.3%
neg-mul-198.3%
associate-+r+98.3%
sub-neg98.3%
Simplified98.3%
Final simplification98.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1.5e+80) (not (<= (/ x y) 1.2e+14))) (+ (/ 2.0 t) (/ x y)) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.5e+80) || !((x / y) <= 1.2e+14)) {
tmp = (2.0 / t) + (x / y);
} 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) <= (-1.5d+80)) .or. (.not. ((x / y) <= 1.2d+14))) then
tmp = (2.0d0 / t) + (x / y)
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) <= -1.5e+80) || !((x / y) <= 1.2e+14)) {
tmp = (2.0 / t) + (x / y);
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1.5e+80) or not ((x / y) <= 1.2e+14): tmp = (2.0 / t) + (x / y) 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) <= -1.5e+80) || !(Float64(x / y) <= 1.2e+14)) tmp = Float64(Float64(2.0 / t) + Float64(x / y)); 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) <= -1.5e+80) || ~(((x / y) <= 1.2e+14))) tmp = (2.0 / t) + (x / y); 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], -1.5e+80], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1.2e+14]], $MachinePrecision]], N[(N[(2.0 / t), $MachinePrecision] + N[(x / y), $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 -1.5 \cdot 10^{+80} \lor \neg \left(\frac{x}{y} \leq 1.2 \cdot 10^{+14}\right):\\
\;\;\;\;\frac{2}{t} + \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.49999999999999993e80 or 1.2e14 < (/.f64 x y) Initial program 85.0%
Taylor expanded in x around 0 99.1%
associate-+r+99.1%
+-commutative99.1%
fma-define99.1%
associate-*r/99.1%
metadata-eval99.1%
associate-/r*99.1%
Simplified99.1%
Taylor expanded in t around 0 99.1%
Taylor expanded in z around inf 80.1%
associate-*r/80.1%
metadata-eval80.1%
+-commutative80.1%
Simplified80.1%
if -1.49999999999999993e80 < (/.f64 x y) < 1.2e14Initial program 84.3%
Taylor expanded in x around 0 99.9%
associate-+r+99.9%
+-commutative99.9%
fma-define99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in x around 0 95.2%
distribute-lft-out95.2%
div-sub95.2%
*-inverses95.2%
sub-neg95.2%
metadata-eval95.2%
distribute-lft-out95.2%
distribute-lft-in95.2%
associate-*r/95.2%
metadata-eval95.2%
metadata-eval95.2%
+-commutative95.2%
associate-*r/95.2%
metadata-eval95.2%
associate-+l+95.2%
metadata-eval95.2%
associate-*r/95.2%
metadata-eval95.2%
associate-*r/95.2%
associate-/r*95.2%
*-lft-identity95.2%
associate-*l/95.1%
associate-*r*95.1%
Simplified95.2%
Final simplification88.5%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -2.6e+81)
(+ (/ 2.0 t) (/ x y))
(if (<= (/ x y) 2e-29)
(+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))
(+ (/ x y) (+ (/ 2.0 t) -2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2.6e+81) {
tmp = (2.0 / t) + (x / y);
} else if ((x / y) <= 2e-29) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} 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 ((x / y) <= (-2.6d+81)) then
tmp = (2.0d0 / t) + (x / y)
else if ((x / y) <= 2d-29) then
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
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 ((x / y) <= -2.6e+81) {
tmp = (2.0 / t) + (x / y);
} else if ((x / y) <= 2e-29) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x / y) + ((2.0 / t) + -2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2.6e+81: tmp = (2.0 / t) + (x / y) elif (x / y) <= 2e-29: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) else: tmp = (x / y) + ((2.0 / t) + -2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2.6e+81) tmp = Float64(Float64(2.0 / t) + Float64(x / y)); elseif (Float64(x / y) <= 2e-29) tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); else tmp = Float64(Float64(x / y) + 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) <= -2.6e+81) tmp = (2.0 / t) + (x / y); elseif ((x / y) <= 2e-29) tmp = -2.0 + ((2.0 + (2.0 / z)) / t); else tmp = (x / y) + ((2.0 / t) + -2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2.6e+81], N[(N[(2.0 / t), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2e-29], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2.6 \cdot 10^{+81}:\\
\;\;\;\;\frac{2}{t} + \frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{-29}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -2.59999999999999992e81Initial program 86.5%
Taylor expanded in x around 0 98.0%
associate-+r+98.0%
+-commutative98.0%
fma-define98.0%
associate-*r/98.0%
metadata-eval98.0%
associate-/r*98.0%
Simplified98.0%
Taylor expanded in t around 0 98.0%
Taylor expanded in z around inf 83.4%
associate-*r/83.4%
metadata-eval83.4%
+-commutative83.4%
Simplified83.4%
if -2.59999999999999992e81 < (/.f64 x y) < 1.99999999999999989e-29Initial program 84.3%
Taylor expanded in x around 0 99.9%
associate-+r+99.9%
+-commutative99.9%
fma-define99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in x around 0 96.1%
distribute-lft-out96.1%
div-sub96.1%
*-inverses96.1%
sub-neg96.1%
metadata-eval96.1%
distribute-lft-out96.1%
distribute-lft-in96.1%
associate-*r/96.1%
metadata-eval96.1%
metadata-eval96.1%
+-commutative96.1%
associate-*r/96.1%
metadata-eval96.1%
associate-+l+96.1%
metadata-eval96.1%
associate-*r/96.1%
metadata-eval96.1%
associate-*r/96.1%
associate-/r*96.0%
*-lft-identity96.0%
associate-*l/96.0%
associate-*r*96.0%
Simplified96.0%
if 1.99999999999999989e-29 < (/.f64 x y) Initial program 83.9%
Taylor expanded in z around inf 79.7%
div-sub79.7%
sub-neg79.7%
*-inverses79.7%
metadata-eval79.7%
distribute-lft-in79.7%
metadata-eval79.7%
associate-*r/79.7%
metadata-eval79.7%
Simplified79.7%
Final simplification89.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2600.0) (not (<= (/ x y) 4e+90))) (/ x y) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2600.0) || !((x / y) <= 4e+90)) {
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) <= (-2600.0d0)) .or. (.not. ((x / y) <= 4d+90))) 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) <= -2600.0) || !((x / y) <= 4e+90)) {
tmp = x / y;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2600.0) or not ((x / y) <= 4e+90): 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) <= -2600.0) || !(Float64(x / y) <= 4e+90)) 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) <= -2600.0) || ~(((x / y) <= 4e+90))) 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], -2600.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4e+90]], $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 -2600 \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{+90}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -2600 or 3.99999999999999987e90 < (/.f64 x y) Initial program 85.5%
Taylor expanded in x around inf 73.7%
if -2600 < (/.f64 x y) < 3.99999999999999987e90Initial program 83.9%
Taylor expanded in z around inf 66.0%
div-sub66.0%
sub-neg66.0%
*-inverses66.0%
metadata-eval66.0%
distribute-lft-in66.0%
metadata-eval66.0%
associate-*r/66.0%
metadata-eval66.0%
Simplified66.0%
Taylor expanded in y around 0 59.2%
sub-neg59.2%
associate-*r/59.2%
metadata-eval59.2%
metadata-eval59.2%
+-commutative59.2%
Simplified59.2%
Taylor expanded in x around 0 61.9%
sub-neg61.9%
associate-*r/61.9%
metadata-eval61.9%
metadata-eval61.9%
Simplified61.9%
Final simplification67.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1.7e-6) (not (<= (/ x y) 4.5e-15))) (+ (/ x y) -2.0) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.7e-6) || !((x / y) <= 4.5e-15)) {
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) <= (-1.7d-6)) .or. (.not. ((x / y) <= 4.5d-15))) 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) <= -1.7e-6) || !((x / y) <= 4.5e-15)) {
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) <= -1.7e-6) or not ((x / y) <= 4.5e-15): 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) <= -1.7e-6) || !(Float64(x / y) <= 4.5e-15)) 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) <= -1.7e-6) || ~(((x / y) <= 4.5e-15))) 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], -1.7e-6], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4.5e-15]], $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 -1.7 \cdot 10^{-6} \lor \neg \left(\frac{x}{y} \leq 4.5 \cdot 10^{-15}\right):\\
\;\;\;\;\frac{x}{y} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -1.70000000000000003e-6 or 4.4999999999999998e-15 < (/.f64 x y) Initial program 85.6%
Taylor expanded in t around inf 71.5%
if -1.70000000000000003e-6 < (/.f64 x y) < 4.4999999999999998e-15Initial program 83.5%
Taylor expanded in z around inf 63.4%
div-sub63.4%
sub-neg63.4%
*-inverses63.4%
metadata-eval63.4%
distribute-lft-in63.4%
metadata-eval63.4%
associate-*r/63.4%
metadata-eval63.4%
Simplified63.4%
Taylor expanded in y around 0 57.2%
sub-neg57.2%
associate-*r/57.2%
metadata-eval57.2%
metadata-eval57.2%
+-commutative57.2%
Simplified57.2%
Taylor expanded in x around 0 63.4%
sub-neg63.4%
associate-*r/63.4%
metadata-eval63.4%
metadata-eval63.4%
Simplified63.4%
Final simplification67.7%
(FPCore (x y z t) :precision binary64 (if (<= t -1.0) -2.0 (if (<= t 29500000000000.0) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.0) {
tmp = -2.0;
} else if (t <= 29500000000000.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.0d0)) then
tmp = -2.0d0
else if (t <= 29500000000000.0d0) then
tmp = 2.0d0 / t
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.0) {
tmp = -2.0;
} else if (t <= 29500000000000.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.0: tmp = -2.0 elif t <= 29500000000000.0: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.0) tmp = -2.0; elseif (t <= 29500000000000.0) tmp = Float64(2.0 / t); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.0) tmp = -2.0; elseif (t <= 29500000000000.0) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.0], -2.0, If[LessEqual[t, 29500000000000.0], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 29500000000000:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1 or 2.95e13 < t Initial program 67.7%
+-commutative67.7%
remove-double-neg67.7%
distribute-frac-neg67.7%
unsub-neg67.7%
*-commutative67.7%
associate-*r*67.7%
distribute-rgt1-in67.7%
associate-/l*67.7%
fma-neg67.7%
*-commutative67.7%
fma-define67.7%
*-commutative67.7%
distribute-frac-neg67.7%
remove-double-neg67.7%
Simplified67.7%
Taylor expanded in x around 0 37.6%
Taylor expanded in t around inf 37.6%
mul-1-neg37.6%
*-commutative37.6%
distribute-rgt-neg-in37.6%
Simplified37.6%
Taylor expanded in z around inf 42.1%
if -1 < t < 2.95e13Initial program 99.1%
Taylor expanded in t around 0 74.4%
associate-*r/74.4%
metadata-eval74.4%
Simplified74.4%
Taylor expanded in z around inf 30.1%
Final simplification35.6%
(FPCore (x y z t) :precision binary64 -2.0)
double code(double x, double y, double z, double t) {
return -2.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -2.0d0
end function
public static double code(double x, double y, double z, double t) {
return -2.0;
}
def code(x, y, z, t): return -2.0
function code(x, y, z, t) return -2.0 end
function tmp = code(x, y, z, t) tmp = -2.0; end
code[x_, y_, z_, t_] := -2.0
\begin{array}{l}
\\
-2
\end{array}
Initial program 84.6%
+-commutative84.6%
remove-double-neg84.6%
distribute-frac-neg84.6%
unsub-neg84.6%
*-commutative84.6%
associate-*r*84.6%
distribute-rgt1-in84.6%
associate-/l*84.6%
fma-neg84.6%
*-commutative84.6%
fma-define84.6%
*-commutative84.6%
distribute-frac-neg84.6%
remove-double-neg84.6%
Simplified84.6%
Taylor expanded in x around 0 57.7%
Taylor expanded in t around inf 42.6%
mul-1-neg42.6%
*-commutative42.6%
distribute-rgt-neg-in42.6%
Simplified42.6%
Taylor expanded in z around inf 20.7%
Final simplification20.7%
(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 2024071
(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))))