
(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 13 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))) (* z t))))) (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))) / (z * t));
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))) / (z * t));
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))) / (z * t)) 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(z * t))) 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))) / (z * t)); 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[(z * t), $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)}{z \cdot t}\\
\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.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)) (t_2 (+ -2.0 (/ 2.0 t))))
(if (<= z -1.65e+192)
t_2
(if (<= z -1.3e+169)
t_1
(if (<= z -3.6e+15)
t_2
(if (<= z -6.8e-109)
t_1
(if (<= z 3.5e-61)
(/ 2.0 (* z t))
(if (or (<= z 88000000000000.0) (not (<= z 9.2e+154)))
t_1
t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double t_2 = -2.0 + (2.0 / t);
double tmp;
if (z <= -1.65e+192) {
tmp = t_2;
} else if (z <= -1.3e+169) {
tmp = t_1;
} else if (z <= -3.6e+15) {
tmp = t_2;
} else if (z <= -6.8e-109) {
tmp = t_1;
} else if (z <= 3.5e-61) {
tmp = 2.0 / (z * t);
} else if ((z <= 88000000000000.0) || !(z <= 9.2e+154)) {
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 = (x / y) - 2.0d0
t_2 = (-2.0d0) + (2.0d0 / t)
if (z <= (-1.65d+192)) then
tmp = t_2
else if (z <= (-1.3d+169)) then
tmp = t_1
else if (z <= (-3.6d+15)) then
tmp = t_2
else if (z <= (-6.8d-109)) then
tmp = t_1
else if (z <= 3.5d-61) then
tmp = 2.0d0 / (z * t)
else if ((z <= 88000000000000.0d0) .or. (.not. (z <= 9.2d+154))) 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 = (x / y) - 2.0;
double t_2 = -2.0 + (2.0 / t);
double tmp;
if (z <= -1.65e+192) {
tmp = t_2;
} else if (z <= -1.3e+169) {
tmp = t_1;
} else if (z <= -3.6e+15) {
tmp = t_2;
} else if (z <= -6.8e-109) {
tmp = t_1;
} else if (z <= 3.5e-61) {
tmp = 2.0 / (z * t);
} else if ((z <= 88000000000000.0) || !(z <= 9.2e+154)) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 t_2 = -2.0 + (2.0 / t) tmp = 0 if z <= -1.65e+192: tmp = t_2 elif z <= -1.3e+169: tmp = t_1 elif z <= -3.6e+15: tmp = t_2 elif z <= -6.8e-109: tmp = t_1 elif z <= 3.5e-61: tmp = 2.0 / (z * t) elif (z <= 88000000000000.0) or not (z <= 9.2e+154): tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) t_2 = Float64(-2.0 + Float64(2.0 / t)) tmp = 0.0 if (z <= -1.65e+192) tmp = t_2; elseif (z <= -1.3e+169) tmp = t_1; elseif (z <= -3.6e+15) tmp = t_2; elseif (z <= -6.8e-109) tmp = t_1; elseif (z <= 3.5e-61) tmp = Float64(2.0 / Float64(z * t)); elseif ((z <= 88000000000000.0) || !(z <= 9.2e+154)) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; t_2 = -2.0 + (2.0 / t); tmp = 0.0; if (z <= -1.65e+192) tmp = t_2; elseif (z <= -1.3e+169) tmp = t_1; elseif (z <= -3.6e+15) tmp = t_2; elseif (z <= -6.8e-109) tmp = t_1; elseif (z <= 3.5e-61) tmp = 2.0 / (z * t); elseif ((z <= 88000000000000.0) || ~((z <= 9.2e+154))) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.65e+192], t$95$2, If[LessEqual[z, -1.3e+169], t$95$1, If[LessEqual[z, -3.6e+15], t$95$2, If[LessEqual[z, -6.8e-109], t$95$1, If[LessEqual[z, 3.5e-61], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 88000000000000.0], N[Not[LessEqual[z, 9.2e+154]], $MachinePrecision]], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
t_2 := -2 + \frac{2}{t}\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{+192}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{+169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{+15}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -6.8 \cdot 10^{-109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-61}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{elif}\;z \leq 88000000000000 \lor \neg \left(z \leq 9.2 \cdot 10^{+154}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.65000000000000005e192 or -1.3e169 < z < -3.6e15 or 8.8e13 < z < 9.1999999999999999e154Initial program 83.4%
Taylor expanded in t around 0 95.4%
associate-+r+95.4%
associate-*r/95.4%
metadata-eval95.4%
sub-neg95.4%
metadata-eval95.4%
Simplified95.4%
Taylor expanded in y around 0 81.3%
associate--l+81.3%
associate-*r/81.3%
metadata-eval81.3%
fmm-def81.3%
*-commutative81.3%
metadata-eval81.3%
fma-define81.3%
associate-*r/81.3%
metadata-eval81.3%
associate-/r*81.3%
Simplified81.3%
Taylor expanded in x around 0 79.7%
sub-neg79.7%
metadata-eval79.7%
associate-/r*79.7%
associate-*r/79.7%
associate-*l/79.7%
distribute-rgt-in79.7%
associate-*l/79.7%
associate-*r/79.7%
*-lft-identity79.7%
+-commutative79.7%
Simplified79.7%
Taylor expanded in z around inf 79.7%
associate-*r/79.7%
metadata-eval79.7%
sub-neg79.7%
metadata-eval79.7%
+-commutative79.7%
Simplified79.7%
if -1.65000000000000005e192 < z < -1.3e169 or -3.6e15 < z < -6.80000000000000023e-109 or 3.5000000000000003e-61 < z < 8.8e13 or 9.1999999999999999e154 < z Initial program 78.6%
Taylor expanded in t around inf 76.6%
if -6.80000000000000023e-109 < z < 3.5000000000000003e-61Initial program 98.9%
Taylor expanded in t around 0 93.0%
associate-+r+93.0%
associate-*r/93.0%
metadata-eval93.0%
sub-neg93.0%
metadata-eval93.0%
Simplified93.0%
Taylor expanded in z around 0 76.3%
Final simplification77.4%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -2.35e+22)
(/ x y)
(if (<= (/ x y) -1e-319)
-2.0
(if (<= (/ x y) 2.3e-272) (/ 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.35e+22) {
tmp = x / y;
} else if ((x / y) <= -1e-319) {
tmp = -2.0;
} else if ((x / y) <= 2.3e-272) {
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.35d+22)) then
tmp = x / y
else if ((x / y) <= (-1d-319)) then
tmp = -2.0d0
else if ((x / y) <= 2.3d-272) 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.35e+22) {
tmp = x / y;
} else if ((x / y) <= -1e-319) {
tmp = -2.0;
} else if ((x / y) <= 2.3e-272) {
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.35e+22: tmp = x / y elif (x / y) <= -1e-319: tmp = -2.0 elif (x / y) <= 2.3e-272: 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.35e+22) tmp = Float64(x / y); elseif (Float64(x / y) <= -1e-319) tmp = -2.0; elseif (Float64(x / y) <= 2.3e-272) 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.35e+22) tmp = x / y; elseif ((x / y) <= -1e-319) tmp = -2.0; elseif ((x / y) <= 2.3e-272) 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.35e+22], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -1e-319], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 2.3e-272], 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.35 \cdot 10^{+22}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -1 \cdot 10^{-319}:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq 2.3 \cdot 10^{-272}:\\
\;\;\;\;\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.3500000000000001e22 or 2 < (/.f64 x y) Initial program 84.7%
Taylor expanded in x around inf 65.0%
if -2.3500000000000001e22 < (/.f64 x y) < -9.99989e-320 or 2.29999999999999989e-272 < (/.f64 x y) < 2Initial program 85.5%
Taylor expanded in t around 0 99.8%
associate-+r+99.8%
associate-*r/99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 82.7%
associate--l+82.7%
associate-*r/82.7%
metadata-eval82.7%
fmm-def82.7%
*-commutative82.7%
metadata-eval82.7%
fma-define82.7%
associate-*r/82.7%
metadata-eval82.7%
associate-/r*82.7%
Simplified82.7%
Taylor expanded in x around 0 99.4%
sub-neg99.4%
metadata-eval99.4%
associate-/r*99.4%
associate-*r/99.4%
associate-*l/99.3%
distribute-rgt-in99.3%
associate-*l/99.3%
associate-*r/99.3%
*-lft-identity99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in t around inf 39.9%
if -9.99989e-320 < (/.f64 x y) < 2.29999999999999989e-272Initial program 99.7%
Taylor expanded in t around 0 83.1%
associate-*r/83.1%
metadata-eval83.1%
Simplified83.1%
Taylor expanded in z around inf 38.9%
Final simplification50.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1e+81) (not (<= (/ x y) 100000000000.0))) (+ (/ x y) (/ (+ 2.0 (* 2.0 z)) (* 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) <= -1e+81) || !((x / y) <= 100000000000.0)) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (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) <= (-1d+81)) .or. (.not. ((x / y) <= 100000000000.0d0))) then
tmp = (x / y) + ((2.0d0 + (2.0d0 * z)) / (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) <= -1e+81) || !((x / y) <= 100000000000.0)) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (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) <= -1e+81) or not ((x / y) <= 100000000000.0): tmp = (x / y) + ((2.0 + (2.0 * z)) / (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) <= -1e+81) || !(Float64(x / y) <= 100000000000.0)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(2.0 * z)) / Float64(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) <= -1e+81) || ~(((x / y) <= 100000000000.0))) tmp = (x / y) + ((2.0 + (2.0 * z)) / (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], -1e+81], N[Not[LessEqual[N[(x / y), $MachinePrecision], 100000000000.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(2.0 * z), $MachinePrecision]), $MachinePrecision] / N[(z * 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 -1 \cdot 10^{+81} \lor \neg \left(\frac{x}{y} \leq 100000000000\right):\\
\;\;\;\;\frac{x}{y} + \frac{2 + 2 \cdot z}{z \cdot t}\\
\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) < -9.99999999999999921e80 or 1e11 < (/.f64 x y) Initial program 84.4%
Taylor expanded in t around 0 98.9%
if -9.99999999999999921e80 < (/.f64 x y) < 1e11Initial program 89.7%
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 (if (or (<= (/ x y) -1000.0) (not (<= (/ x y) 5e-13))) (+ (/ x y) (/ (+ 2.0 (* 2.0 z)) (* z t))) (+ -2.0 (* (+ 2.0 (/ 2.0 z)) (/ 1.0 t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1000.0) || !((x / y) <= 5e-13)) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t));
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) * (1.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) <= (-1000.0d0)) .or. (.not. ((x / y) <= 5d-13))) then
tmp = (x / y) + ((2.0d0 + (2.0d0 * z)) / (z * t))
else
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) * (1.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) <= -1000.0) || !((x / y) <= 5e-13)) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t));
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) * (1.0 / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1000.0) or not ((x / y) <= 5e-13): tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t)) else: tmp = -2.0 + ((2.0 + (2.0 / z)) * (1.0 / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1000.0) || !(Float64(x / y) <= 5e-13)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(2.0 * z)) / Float64(z * t))); else tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) * Float64(1.0 / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1000.0) || ~(((x / y) <= 5e-13))) tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t)); else tmp = -2.0 + ((2.0 + (2.0 / z)) * (1.0 / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 5e-13]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(2.0 * z), $MachinePrecision]), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1000 \lor \neg \left(\frac{x}{y} \leq 5 \cdot 10^{-13}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2 + 2 \cdot z}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \left(2 + \frac{2}{z}\right) \cdot \frac{1}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1e3 or 4.9999999999999999e-13 < (/.f64 x y) Initial program 85.1%
Taylor expanded in t around 0 98.4%
if -1e3 < (/.f64 x y) < 4.9999999999999999e-13Initial program 89.8%
Taylor expanded in t around 0 99.8%
associate-+r+99.8%
associate-*r/99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 75.3%
associate--l+75.3%
associate-*r/75.3%
metadata-eval75.3%
fmm-def75.3%
*-commutative75.3%
metadata-eval75.3%
fma-define75.3%
associate-*r/75.3%
metadata-eval75.3%
associate-/r*75.3%
Simplified75.3%
Taylor expanded in x around 0 99.6%
sub-neg99.6%
associate-/r*99.5%
associate-*r/99.5%
associate-*l/99.5%
distribute-rgt-in99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1.02e+24) (not (<= (/ x y) 7.5e+66))) (+ (/ x y) (/ 2.0 t)) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.02e+24) || !((x / y) <= 7.5e+66)) {
tmp = (x / y) + (2.0 / t);
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-1.02d+24)) .or. (.not. ((x / y) <= 7.5d+66))) then
tmp = (x / y) + (2.0d0 / t)
else
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.02e+24) || !((x / y) <= 7.5e+66)) {
tmp = (x / y) + (2.0 / t);
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1.02e+24) or not ((x / y) <= 7.5e+66): tmp = (x / y) + (2.0 / t) else: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1.02e+24) || !(Float64(x / y) <= 7.5e+66)) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); else tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1.02e+24) || ~(((x / y) <= 7.5e+66))) tmp = (x / y) + (2.0 / t); else tmp = -2.0 + ((2.0 + (2.0 / z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1.02e+24], N[Not[LessEqual[N[(x / y), $MachinePrecision], 7.5e+66]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.02 \cdot 10^{+24} \lor \neg \left(\frac{x}{y} \leq 7.5 \cdot 10^{+66}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.02000000000000004e24 or 7.50000000000000024e66 < (/.f64 x y) Initial program 85.0%
Taylor expanded in t around 0 79.1%
associate-+r+79.1%
associate-*r/79.1%
metadata-eval79.1%
sub-neg79.1%
metadata-eval79.1%
Simplified79.1%
Taylor expanded in z around inf 63.0%
Taylor expanded in x around inf 59.8%
associate-*l/60.9%
*-commutative60.9%
Simplified60.9%
Taylor expanded in x around 0 83.8%
associate-*r/83.8%
metadata-eval83.8%
+-commutative83.8%
Simplified83.8%
if -1.02000000000000004e24 < (/.f64 x y) < 7.50000000000000024e66Initial program 89.3%
Taylor expanded in t around 0 99.3%
associate-+r+99.3%
associate-*r/99.3%
metadata-eval99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 78.5%
associate--l+78.5%
associate-*r/78.5%
metadata-eval78.5%
fmm-def78.5%
*-commutative78.5%
metadata-eval78.5%
fma-define78.5%
associate-*r/78.5%
metadata-eval78.5%
associate-/r*78.5%
Simplified78.5%
Taylor expanded in x around 0 95.3%
sub-neg95.3%
metadata-eval95.3%
associate-/r*95.3%
associate-*r/95.3%
associate-*l/95.3%
distribute-rgt-in95.3%
associate-*l/95.3%
associate-*r/95.3%
*-lft-identity95.3%
+-commutative95.3%
Simplified95.3%
Final simplification91.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1e+58) (not (<= (/ x y) 100000000000.0))) (+ (/ x y) (/ 2.0 (* z t))) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e+58) || !((x / y) <= 100000000000.0)) {
tmp = (x / y) + (2.0 / (z * t));
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-1d+58)) .or. (.not. ((x / y) <= 100000000000.0d0))) then
tmp = (x / y) + (2.0d0 / (z * t))
else
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e+58) || !((x / y) <= 100000000000.0)) {
tmp = (x / y) + (2.0 / (z * t));
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1e+58) or not ((x / y) <= 100000000000.0): tmp = (x / y) + (2.0 / (z * t)) else: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1e+58) || !(Float64(x / y) <= 100000000000.0)) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(z * t))); else tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1e+58) || ~(((x / y) <= 100000000000.0))) tmp = (x / y) + (2.0 / (z * t)); else tmp = -2.0 + ((2.0 + (2.0 / z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1e+58], N[Not[LessEqual[N[(x / y), $MachinePrecision], 100000000000.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+58} \lor \neg \left(\frac{x}{y} \leq 100000000000\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -9.99999999999999944e57 or 1e11 < (/.f64 x y) Initial program 84.2%
Taylor expanded in z around 0 88.9%
if -9.99999999999999944e57 < (/.f64 x y) < 1e11Initial program 90.0%
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%
Taylor expanded in y around 0 76.8%
associate--l+76.8%
associate-*r/76.8%
metadata-eval76.8%
fmm-def76.8%
*-commutative76.8%
metadata-eval76.8%
fma-define76.8%
associate-*r/76.8%
metadata-eval76.8%
associate-/r*76.8%
Simplified76.8%
Taylor expanded in x around 0 97.7%
sub-neg97.7%
metadata-eval97.7%
associate-/r*97.7%
associate-*r/97.7%
associate-*l/97.7%
distribute-rgt-in97.7%
associate-*l/97.7%
associate-*r/97.7%
*-lft-identity97.7%
+-commutative97.7%
Simplified97.7%
Final simplification94.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (/ 2.0 t))))
(if (<= z -2.05e+46)
t_1
(if (<= z -2.05e-109)
(- (/ x y) 2.0)
(if (<= z 1.4e-26) (/ 2.0 (* z t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / t);
double tmp;
if (z <= -2.05e+46) {
tmp = t_1;
} else if (z <= -2.05e-109) {
tmp = (x / y) - 2.0;
} else if (z <= 1.4e-26) {
tmp = 2.0 / (z * t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / y) + (2.0d0 / t)
if (z <= (-2.05d+46)) then
tmp = t_1
else if (z <= (-2.05d-109)) then
tmp = (x / y) - 2.0d0
else if (z <= 1.4d-26) then
tmp = 2.0d0 / (z * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / t);
double tmp;
if (z <= -2.05e+46) {
tmp = t_1;
} else if (z <= -2.05e-109) {
tmp = (x / y) - 2.0;
} else if (z <= 1.4e-26) {
tmp = 2.0 / (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + (2.0 / t) tmp = 0 if z <= -2.05e+46: tmp = t_1 elif z <= -2.05e-109: tmp = (x / y) - 2.0 elif z <= 1.4e-26: tmp = 2.0 / (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(2.0 / t)) tmp = 0.0 if (z <= -2.05e+46) tmp = t_1; elseif (z <= -2.05e-109) tmp = Float64(Float64(x / y) - 2.0); elseif (z <= 1.4e-26) tmp = Float64(2.0 / Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + (2.0 / t); tmp = 0.0; if (z <= -2.05e+46) tmp = t_1; elseif (z <= -2.05e-109) tmp = (x / y) - 2.0; elseif (z <= 1.4e-26) tmp = 2.0 / (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.05e+46], t$95$1, If[LessEqual[z, -2.05e-109], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], If[LessEqual[z, 1.4e-26], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2}{t}\\
\mathbf{if}\;z \leq -2.05 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.05 \cdot 10^{-109}:\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-26}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.05e46 or 1.4000000000000001e-26 < z Initial program 76.0%
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 inf 90.1%
Taylor expanded in x around inf 67.0%
associate-*l/66.9%
*-commutative66.9%
Simplified66.9%
Taylor expanded in x around 0 78.6%
associate-*r/78.6%
metadata-eval78.6%
+-commutative78.6%
Simplified78.6%
if -2.05e46 < z < -2.0500000000000001e-109Initial program 96.5%
Taylor expanded in t around inf 71.6%
if -2.0500000000000001e-109 < z < 1.4000000000000001e-26Initial program 99.0%
Taylor expanded in t around 0 93.4%
associate-+r+93.4%
associate-*r/93.4%
metadata-eval93.4%
sub-neg93.4%
metadata-eval93.4%
Simplified93.4%
Taylor expanded in z around 0 74.1%
Final simplification75.9%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -3.6e+51) (not (<= (/ x y) 4000000.0))) (/ x y) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -3.6e+51) || !((x / y) <= 4000000.0)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-3.6d+51)) .or. (.not. ((x / y) <= 4000000.0d0))) then
tmp = x / y
else
tmp = (-2.0d0) + (2.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -3.6e+51) || !((x / y) <= 4000000.0)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -3.6e+51) or not ((x / y) <= 4000000.0): tmp = x / y else: tmp = -2.0 + (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -3.6e+51) || !(Float64(x / y) <= 4000000.0)) tmp = Float64(x / y); else tmp = Float64(-2.0 + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -3.6e+51) || ~(((x / y) <= 4000000.0))) tmp = x / y; else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -3.6e+51], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4000000.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -3.6 \cdot 10^{+51} \lor \neg \left(\frac{x}{y} \leq 4000000\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -3.60000000000000011e51 or 4e6 < (/.f64 x y) Initial program 84.5%
Taylor expanded in x around inf 67.7%
if -3.60000000000000011e51 < (/.f64 x y) < 4e6Initial program 89.9%
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%
Taylor expanded in y around 0 76.5%
associate--l+76.5%
associate-*r/76.5%
metadata-eval76.5%
fmm-def76.5%
*-commutative76.5%
metadata-eval76.5%
fma-define76.5%
associate-*r/76.5%
metadata-eval76.5%
associate-/r*76.5%
Simplified76.5%
Taylor expanded in x around 0 97.7%
sub-neg97.7%
metadata-eval97.7%
associate-/r*97.7%
associate-*r/97.7%
associate-*l/97.7%
distribute-rgt-in97.7%
associate-*l/97.7%
associate-*r/97.7%
*-lft-identity97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in z around inf 59.9%
associate-*r/59.9%
metadata-eval59.9%
sub-neg59.9%
metadata-eval59.9%
+-commutative59.9%
Simplified59.9%
Final simplification63.0%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -1.5e+54) (/ x y) (if (<= (/ x y) 240.0) (+ -2.0 (/ 2.0 t)) (- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.5e+54) {
tmp = x / y;
} else if ((x / y) <= 240.0) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-1.5d+54)) then
tmp = x / y
else if ((x / y) <= 240.0d0) then
tmp = (-2.0d0) + (2.0d0 / t)
else
tmp = (x / y) - 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.5e+54) {
tmp = x / y;
} else if ((x / y) <= 240.0) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1.5e+54: tmp = x / y elif (x / y) <= 240.0: tmp = -2.0 + (2.0 / t) else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1.5e+54) tmp = Float64(x / y); elseif (Float64(x / y) <= 240.0) tmp = Float64(-2.0 + Float64(2.0 / t)); else tmp = Float64(Float64(x / y) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -1.5e+54) tmp = x / y; elseif ((x / y) <= 240.0) tmp = -2.0 + (2.0 / t); else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1.5e+54], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 240.0], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.5 \cdot 10^{+54}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 240:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -1.4999999999999999e54Initial program 80.3%
Taylor expanded in x around inf 76.5%
if -1.4999999999999999e54 < (/.f64 x y) < 240Initial program 90.4%
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%
Taylor expanded in y around 0 76.2%
associate--l+76.2%
associate-*r/76.2%
metadata-eval76.2%
fmm-def76.2%
*-commutative76.2%
metadata-eval76.2%
fma-define76.2%
associate-*r/76.2%
metadata-eval76.2%
associate-/r*76.1%
Simplified76.1%
Taylor expanded in x around 0 98.4%
sub-neg98.4%
metadata-eval98.4%
associate-/r*98.3%
associate-*r/98.3%
associate-*l/98.3%
distribute-rgt-in98.3%
associate-*l/98.3%
associate-*r/98.3%
*-lft-identity98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in z around inf 60.0%
associate-*r/60.0%
metadata-eval60.0%
sub-neg60.0%
metadata-eval60.0%
+-commutative60.0%
Simplified60.0%
if 240 < (/.f64 x y) Initial program 87.1%
Taylor expanded in t around inf 59.0%
Final simplification63.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -6.5e+25) (not (<= t 4.5e+17))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -6.5e+25) || !(t <= 4.5e+17)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-6.5d+25)) .or. (.not. (t <= 4.5d+17))) then
tmp = (x / y) - 2.0d0
else
tmp = (2.0d0 + (2.0d0 / z)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -6.5e+25) || !(t <= 4.5e+17)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -6.5e+25) or not (t <= 4.5e+17): tmp = (x / y) - 2.0 else: tmp = (2.0 + (2.0 / z)) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -6.5e+25) || !(t <= 4.5e+17)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -6.5e+25) || ~((t <= 4.5e+17))) tmp = (x / y) - 2.0; else tmp = (2.0 + (2.0 / z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -6.5e+25], N[Not[LessEqual[t, 4.5e+17]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{+25} \lor \neg \left(t \leq 4.5 \cdot 10^{+17}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -6.50000000000000005e25 or 4.5e17 < t Initial program 72.5%
Taylor expanded in t around inf 87.0%
if -6.50000000000000005e25 < t < 4.5e17Initial program 99.0%
Taylor expanded in t around 0 82.1%
associate-*r/82.1%
metadata-eval82.1%
Simplified82.1%
Final simplification84.2%
(FPCore (x y z t) :precision binary64 (if (<= t -5600000.0) -2.0 (if (<= t 2.8e-11) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5600000.0) {
tmp = -2.0;
} else if (t <= 2.8e-11) {
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 <= (-5600000.0d0)) then
tmp = -2.0d0
else if (t <= 2.8d-11) 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 <= -5600000.0) {
tmp = -2.0;
} else if (t <= 2.8e-11) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5600000.0: tmp = -2.0 elif t <= 2.8e-11: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5600000.0) tmp = -2.0; elseif (t <= 2.8e-11) 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 <= -5600000.0) tmp = -2.0; elseif (t <= 2.8e-11) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5600000.0], -2.0, If[LessEqual[t, 2.8e-11], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5600000:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-11}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -5.6e6 or 2.8e-11 < t Initial program 75.1%
Taylor expanded in t around 0 82.9%
associate-+r+82.9%
associate-*r/82.9%
metadata-eval82.9%
sub-neg82.9%
metadata-eval82.9%
Simplified82.9%
Taylor expanded in y around 0 93.6%
associate--l+93.6%
associate-*r/93.6%
metadata-eval93.6%
fmm-def93.6%
*-commutative93.6%
metadata-eval93.6%
fma-define93.6%
associate-*r/93.6%
metadata-eval93.6%
associate-/r*93.6%
Simplified93.6%
Taylor expanded in x around 0 56.1%
sub-neg56.1%
metadata-eval56.1%
associate-/r*56.1%
associate-*r/56.1%
associate-*l/56.1%
distribute-rgt-in56.1%
associate-*l/56.1%
associate-*r/56.1%
*-lft-identity56.1%
+-commutative56.1%
Simplified56.1%
Taylor expanded in t around inf 38.8%
if -5.6e6 < t < 2.8e-11Initial program 99.0%
Taylor expanded in t around 0 85.0%
associate-*r/85.0%
metadata-eval85.0%
Simplified85.0%
Taylor expanded in z around inf 39.5%
Final simplification39.2%
(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 87.7%
Taylor expanded in t around 0 91.9%
associate-+r+91.9%
associate-*r/91.9%
metadata-eval91.9%
sub-neg91.9%
metadata-eval91.9%
Simplified91.9%
Taylor expanded in y around 0 84.9%
associate--l+84.9%
associate-*r/84.9%
metadata-eval84.9%
fmm-def84.9%
*-commutative84.9%
metadata-eval84.9%
fma-define84.9%
associate-*r/84.9%
metadata-eval84.9%
associate-/r*84.9%
Simplified84.9%
Taylor expanded in x around 0 71.5%
sub-neg71.5%
metadata-eval71.5%
associate-/r*71.5%
associate-*r/71.5%
associate-*l/71.5%
distribute-rgt-in71.5%
associate-*l/71.5%
associate-*r/71.5%
*-lft-identity71.5%
+-commutative71.5%
Simplified71.5%
Taylor expanded in t around inf 19.8%
Final simplification19.8%
(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 2024115
(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))))