
(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 16 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 (/ (+ 2.0 (* (- 1.0 t) (* 2.0 z))) (* z t))))
(if (<= t_1 5e+297)
(+ t_1 (/ x y))
(+ (/ x y) (/ (+ (/ 2.0 t) (* z (+ (/ 2.0 t) -2.0))) z)))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 + ((1.0 - t) * (2.0 * z))) / (z * t);
double tmp;
if (t_1 <= 5e+297) {
tmp = t_1 + (x / y);
} else {
tmp = (x / y) + (((2.0 / t) + (z * ((2.0 / t) + -2.0))) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (2.0d0 + ((1.0d0 - t) * (2.0d0 * z))) / (z * t)
if (t_1 <= 5d+297) then
tmp = t_1 + (x / y)
else
tmp = (x / y) + (((2.0d0 / t) + (z * ((2.0d0 / t) + (-2.0d0)))) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (2.0 + ((1.0 - t) * (2.0 * z))) / (z * t);
double tmp;
if (t_1 <= 5e+297) {
tmp = t_1 + (x / y);
} else {
tmp = (x / y) + (((2.0 / t) + (z * ((2.0 / t) + -2.0))) / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 + ((1.0 - t) * (2.0 * z))) / (z * t) tmp = 0 if t_1 <= 5e+297: tmp = t_1 + (x / y) else: tmp = (x / y) + (((2.0 / t) + (z * ((2.0 / t) + -2.0))) / z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 + Float64(Float64(1.0 - t) * Float64(2.0 * z))) / Float64(z * t)) tmp = 0.0 if (t_1 <= 5e+297) tmp = Float64(t_1 + Float64(x / y)); else tmp = Float64(Float64(x / y) + Float64(Float64(Float64(2.0 / t) + Float64(z * Float64(Float64(2.0 / t) + -2.0))) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 + ((1.0 - t) * (2.0 * z))) / (z * t); tmp = 0.0; if (t_1 <= 5e+297) tmp = t_1 + (x / y); else tmp = (x / y) + (((2.0 / t) + (z * ((2.0 / t) + -2.0))) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 + N[(N[(1.0 - t), $MachinePrecision] * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+297], N[(t$95$1 + N[(x / y), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(N[(2.0 / t), $MachinePrecision] + N[(z * N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2 + \left(1 - t\right) \cdot \left(2 \cdot z\right)}{z \cdot t}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+297}:\\
\;\;\;\;t\_1 + \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t} + z \cdot \left(\frac{2}{t} + -2\right)}{z}\\
\end{array}
\end{array}
if (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) < 4.9999999999999998e297Initial program 98.9%
if 4.9999999999999998e297 < (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) Initial program 20.0%
Taylor expanded in z around 0 27.0%
+-commutative27.0%
associate-/l*100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r*100.0%
associate-*r/100.0%
metadata-eval100.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%
Final simplification99.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ (/ (+ 2.0 (* (- 1.0 t) (* 2.0 z))) (* z t)) (/ x y)))) (if (<= t_1 INFINITY) t_1 (- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double t_1 = ((2.0 + ((1.0 - t) * (2.0 * z))) / (z * t)) + (x / y);
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 = ((2.0 + ((1.0 - t) * (2.0 * z))) / (z * t)) + (x / y);
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 = ((2.0 + ((1.0 - t) * (2.0 * z))) / (z * t)) + (x / y) 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(Float64(2.0 + Float64(Float64(1.0 - t) * Float64(2.0 * z))) / Float64(z * t)) + Float64(x / y)) 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 = ((2.0 + ((1.0 - t) * (2.0 * z))) / (z * t)) + (x / y); 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[(N[(2.0 + N[(N[(1.0 - t), $MachinePrecision] * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(x / y), $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{2 + \left(1 - t\right) \cdot \left(2 \cdot z\right)}{z \cdot t} + \frac{x}{y}\\
\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 94.1%
Final simplification99.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= z -5e+121)
t_1
(if (<= z -9.8e+23)
(+ (/ 2.0 t) -2.0)
(if (or (<= z -4.1e-134) (not (<= z 116.0)))
t_1
(+ -2.0 (/ 2.0 (* z t))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (z <= -5e+121) {
tmp = t_1;
} else if (z <= -9.8e+23) {
tmp = (2.0 / t) + -2.0;
} else if ((z <= -4.1e-134) || !(z <= 116.0)) {
tmp = t_1;
} else {
tmp = -2.0 + (2.0 / (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / y) - 2.0d0
if (z <= (-5d+121)) then
tmp = t_1
else if (z <= (-9.8d+23)) then
tmp = (2.0d0 / t) + (-2.0d0)
else if ((z <= (-4.1d-134)) .or. (.not. (z <= 116.0d0))) then
tmp = t_1
else
tmp = (-2.0d0) + (2.0d0 / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (z <= -5e+121) {
tmp = t_1;
} else if (z <= -9.8e+23) {
tmp = (2.0 / t) + -2.0;
} else if ((z <= -4.1e-134) || !(z <= 116.0)) {
tmp = t_1;
} else {
tmp = -2.0 + (2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if z <= -5e+121: tmp = t_1 elif z <= -9.8e+23: tmp = (2.0 / t) + -2.0 elif (z <= -4.1e-134) or not (z <= 116.0): tmp = t_1 else: tmp = -2.0 + (2.0 / (z * t)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (z <= -5e+121) tmp = t_1; elseif (z <= -9.8e+23) tmp = Float64(Float64(2.0 / t) + -2.0); elseif ((z <= -4.1e-134) || !(z <= 116.0)) tmp = t_1; else tmp = Float64(-2.0 + Float64(2.0 / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (z <= -5e+121) tmp = t_1; elseif (z <= -9.8e+23) tmp = (2.0 / t) + -2.0; elseif ((z <= -4.1e-134) || ~((z <= 116.0))) tmp = t_1; else tmp = -2.0 + (2.0 / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[z, -5e+121], t$95$1, If[LessEqual[z, -9.8e+23], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], If[Or[LessEqual[z, -4.1e-134], N[Not[LessEqual[z, 116.0]], $MachinePrecision]], t$95$1, N[(-2.0 + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;z \leq -5 \cdot 10^{+121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -9.8 \cdot 10^{+23}:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{elif}\;z \leq -4.1 \cdot 10^{-134} \lor \neg \left(z \leq 116\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{z \cdot t}\\
\end{array}
\end{array}
if z < -5.00000000000000007e121 or -9.8000000000000006e23 < z < -4.1000000000000002e-134 or 116 < z Initial program 77.7%
Taylor expanded in t around inf 71.3%
if -5.00000000000000007e121 < z < -9.8000000000000006e23Initial program 87.8%
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 x around 0 83.3%
sub-neg83.3%
metadata-eval83.3%
associate-*r/83.3%
metadata-eval83.3%
+-commutative83.3%
Simplified83.3%
if -4.1000000000000002e-134 < z < 116Initial program 97.9%
Taylor expanded in t around inf 97.0%
*-commutative97.0%
*-commutative97.0%
associate-*l*97.0%
Simplified97.0%
Taylor expanded in z around inf 97.0%
sub-neg97.0%
associate-*r/97.0%
metadata-eval97.0%
*-commutative97.0%
associate-/r*96.8%
metadata-eval96.8%
Simplified96.8%
Taylor expanded in x around 0 77.1%
sub-neg77.1%
associate-*r/77.1%
metadata-eval77.1%
*-commutative77.1%
metadata-eval77.1%
+-commutative77.1%
*-commutative77.1%
Simplified77.1%
Final simplification74.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= z -5e+121)
t_1
(if (<= z -8e+26)
(+ (/ 2.0 t) -2.0)
(if (or (<= z -1.05e-134) (not (<= z 116.0))) t_1 (/ 2.0 (* z t)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (z <= -5e+121) {
tmp = t_1;
} else if (z <= -8e+26) {
tmp = (2.0 / t) + -2.0;
} else if ((z <= -1.05e-134) || !(z <= 116.0)) {
tmp = t_1;
} else {
tmp = 2.0 / (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / y) - 2.0d0
if (z <= (-5d+121)) then
tmp = t_1
else if (z <= (-8d+26)) then
tmp = (2.0d0 / t) + (-2.0d0)
else if ((z <= (-1.05d-134)) .or. (.not. (z <= 116.0d0))) then
tmp = t_1
else
tmp = 2.0d0 / (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (z <= -5e+121) {
tmp = t_1;
} else if (z <= -8e+26) {
tmp = (2.0 / t) + -2.0;
} else if ((z <= -1.05e-134) || !(z <= 116.0)) {
tmp = t_1;
} else {
tmp = 2.0 / (z * t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if z <= -5e+121: tmp = t_1 elif z <= -8e+26: tmp = (2.0 / t) + -2.0 elif (z <= -1.05e-134) or not (z <= 116.0): tmp = t_1 else: tmp = 2.0 / (z * t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (z <= -5e+121) tmp = t_1; elseif (z <= -8e+26) tmp = Float64(Float64(2.0 / t) + -2.0); elseif ((z <= -1.05e-134) || !(z <= 116.0)) tmp = t_1; else tmp = Float64(2.0 / Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (z <= -5e+121) tmp = t_1; elseif (z <= -8e+26) tmp = (2.0 / t) + -2.0; elseif ((z <= -1.05e-134) || ~((z <= 116.0))) tmp = t_1; else tmp = 2.0 / (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[z, -5e+121], t$95$1, If[LessEqual[z, -8e+26], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], If[Or[LessEqual[z, -1.05e-134], N[Not[LessEqual[z, 116.0]], $MachinePrecision]], t$95$1, N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;z \leq -5 \cdot 10^{+121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -8 \cdot 10^{+26}:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-134} \lor \neg \left(z \leq 116\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\end{array}
\end{array}
if z < -5.00000000000000007e121 or -8.00000000000000038e26 < z < -1.05e-134 or 116 < z Initial program 77.7%
Taylor expanded in t around inf 71.3%
if -5.00000000000000007e121 < z < -8.00000000000000038e26Initial program 87.8%
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 x around 0 83.3%
sub-neg83.3%
metadata-eval83.3%
associate-*r/83.3%
metadata-eval83.3%
+-commutative83.3%
Simplified83.3%
if -1.05e-134 < z < 116Initial program 97.9%
Taylor expanded in t around inf 97.0%
*-commutative97.0%
*-commutative97.0%
associate-*l*97.0%
Simplified97.0%
Taylor expanded in z around inf 97.0%
sub-neg97.0%
associate-*r/97.0%
metadata-eval97.0%
*-commutative97.0%
associate-/r*96.8%
metadata-eval96.8%
Simplified96.8%
Taylor expanded in z around 0 68.9%
Final simplification71.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -5e+81) (not (<= t 5e+55))) (+ (/ x y) (+ -2.0 (/ (/ 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 ((t <= -5e+81) || !(t <= 5e+55)) {
tmp = (x / y) + (-2.0 + ((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 ((t <= (-5d+81)) .or. (.not. (t <= 5d+55))) then
tmp = (x / y) + ((-2.0d0) + ((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 ((t <= -5e+81) || !(t <= 5e+55)) {
tmp = (x / y) + (-2.0 + ((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 (t <= -5e+81) or not (t <= 5e+55): tmp = (x / y) + (-2.0 + ((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 ((t <= -5e+81) || !(t <= 5e+55)) tmp = Float64(Float64(x / y) + Float64(-2.0 + 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 ((t <= -5e+81) || ~((t <= 5e+55))) tmp = (x / y) + (-2.0 + ((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[t, -5e+81], N[Not[LessEqual[t, 5e+55]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + 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}\;t \leq -5 \cdot 10^{+81} \lor \neg \left(t \leq 5 \cdot 10^{+55}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \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 t < -4.9999999999999998e81 or 5.00000000000000046e55 < t Initial program 67.3%
Taylor expanded in t around inf 67.3%
*-commutative67.3%
*-commutative67.3%
associate-*l*67.3%
Simplified67.3%
Taylor expanded in z around inf 99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
*-commutative99.9%
associate-/r*99.9%
metadata-eval99.9%
Simplified99.9%
if -4.9999999999999998e81 < t < 5.00000000000000046e55Initial program 98.5%
Taylor expanded in t around 0 98.6%
associate-+r+98.6%
associate-*r/98.6%
metadata-eval98.6%
sub-neg98.6%
metadata-eval98.6%
Simplified98.6%
Final simplification99.1%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -1.46e+22) (/ x y) (if (<= (/ x y) 2.3e-127) (/ 2.0 t) (if (<= (/ x y) 1.8e-8) -2.0 (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.46e+22) {
tmp = x / y;
} else if ((x / y) <= 2.3e-127) {
tmp = 2.0 / t;
} else if ((x / y) <= 1.8e-8) {
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) <= (-1.46d+22)) then
tmp = x / y
else if ((x / y) <= 2.3d-127) then
tmp = 2.0d0 / t
else if ((x / y) <= 1.8d-8) 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) <= -1.46e+22) {
tmp = x / y;
} else if ((x / y) <= 2.3e-127) {
tmp = 2.0 / t;
} else if ((x / y) <= 1.8e-8) {
tmp = -2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1.46e+22: tmp = x / y elif (x / y) <= 2.3e-127: tmp = 2.0 / t elif (x / y) <= 1.8e-8: tmp = -2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1.46e+22) tmp = Float64(x / y); elseif (Float64(x / y) <= 2.3e-127) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 1.8e-8) 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) <= -1.46e+22) tmp = x / y; elseif ((x / y) <= 2.3e-127) tmp = 2.0 / t; elseif ((x / y) <= 1.8e-8) tmp = -2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1.46e+22], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2.3e-127], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1.8e-8], -2.0, N[(x / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.46 \cdot 10^{+22}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 2.3 \cdot 10^{-127}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 1.8 \cdot 10^{-8}:\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.46e22 or 1.79999999999999991e-8 < (/.f64 x y) Initial program 83.3%
Taylor expanded in x around inf 70.2%
if -1.46e22 < (/.f64 x y) < 2.30000000000000019e-127Initial program 89.4%
Taylor expanded in z around inf 59.2%
div-sub59.2%
sub-neg59.2%
*-inverses59.2%
metadata-eval59.2%
distribute-lft-in59.2%
metadata-eval59.2%
associate-*r/59.2%
metadata-eval59.2%
Simplified59.2%
Taylor expanded in t around 0 36.2%
if 2.30000000000000019e-127 < (/.f64 x y) < 1.79999999999999991e-8Initial program 94.4%
Taylor expanded in z around inf 79.9%
div-sub79.9%
sub-neg79.9%
*-inverses79.9%
metadata-eval79.9%
distribute-lft-in79.9%
metadata-eval79.9%
associate-*r/79.9%
metadata-eval79.9%
Simplified79.9%
Taylor expanded in x around 0 77.7%
sub-neg77.7%
metadata-eval77.7%
associate-*r/77.7%
metadata-eval77.7%
+-commutative77.7%
Simplified77.7%
Taylor expanded in t around inf 61.9%
Final simplification55.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.36e+14) (not (<= t 0.0002))) (+ (/ x y) (+ -2.0 (/ (/ 2.0 z) t))) (+ (/ x y) (/ (+ 2.0 (* 2.0 z)) (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.36e+14) || !(t <= 0.0002)) {
tmp = (x / y) + (-2.0 + ((2.0 / z) / t));
} else {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (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 <= (-1.36d+14)) .or. (.not. (t <= 0.0002d0))) then
tmp = (x / y) + ((-2.0d0) + ((2.0d0 / z) / t))
else
tmp = (x / y) + ((2.0d0 + (2.0d0 * z)) / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.36e+14) || !(t <= 0.0002)) {
tmp = (x / y) + (-2.0 + ((2.0 / z) / t));
} else {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.36e+14) or not (t <= 0.0002): tmp = (x / y) + (-2.0 + ((2.0 / z) / t)) else: tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.36e+14) || !(t <= 0.0002)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(Float64(2.0 / z) / t))); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(2.0 * z)) / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.36e+14) || ~((t <= 0.0002))) tmp = (x / y) + (-2.0 + ((2.0 / z) / t)); else tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.36e+14], N[Not[LessEqual[t, 0.0002]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(2.0 * z), $MachinePrecision]), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.36 \cdot 10^{+14} \lor \neg \left(t \leq 0.0002\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{\frac{2}{z}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{2 + 2 \cdot z}{z \cdot t}\\
\end{array}
\end{array}
if t < -1.36e14 or 2.0000000000000001e-4 < t Initial program 73.9%
Taylor expanded in t around inf 73.9%
*-commutative73.9%
*-commutative73.9%
associate-*l*73.9%
Simplified73.9%
Taylor expanded in z around inf 99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
*-commutative99.9%
associate-/r*99.9%
metadata-eval99.9%
Simplified99.9%
if -1.36e14 < t < 2.0000000000000001e-4Initial program 98.3%
Taylor expanded in t around 0 98.0%
Final simplification98.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.6e+22) (not (<= z 1.0))) (+ (/ x y) (+ (/ 2.0 t) -2.0)) (+ (/ x y) (+ -2.0 (/ (/ 2.0 z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.6e+22) || !(z <= 1.0)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + (-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 ((z <= (-1.6d+22)) .or. (.not. (z <= 1.0d0))) then
tmp = (x / y) + ((2.0d0 / t) + (-2.0d0))
else
tmp = (x / y) + ((-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 ((z <= -1.6e+22) || !(z <= 1.0)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + (-2.0 + ((2.0 / z) / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.6e+22) or not (z <= 1.0): tmp = (x / y) + ((2.0 / t) + -2.0) else: tmp = (x / y) + (-2.0 + ((2.0 / z) / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.6e+22) || !(z <= 1.0)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); else tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(Float64(2.0 / z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.6e+22) || ~((z <= 1.0))) tmp = (x / y) + ((2.0 / t) + -2.0); else tmp = (x / y) + (-2.0 + ((2.0 / z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.6e+22], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+22} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{\frac{2}{z}}{t}\right)\\
\end{array}
\end{array}
if z < -1.6e22 or 1 < z Initial program 75.2%
Taylor expanded in z around inf 99.4%
div-sub99.4%
sub-neg99.4%
*-inverses99.4%
metadata-eval99.4%
distribute-lft-in99.4%
metadata-eval99.4%
associate-*r/99.4%
metadata-eval99.4%
Simplified99.4%
if -1.6e22 < z < 1Initial program 98.3%
Taylor expanded in t around inf 97.1%
*-commutative97.1%
*-commutative97.1%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in z around inf 97.0%
sub-neg97.0%
associate-*r/97.0%
metadata-eval97.0%
*-commutative97.0%
associate-/r*96.9%
metadata-eval96.9%
Simplified96.9%
Final simplification98.2%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -3.65e+19) (not (<= (/ x y) 14000.0))) (/ x y) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -3.65e+19) || !((x / y) <= 14000.0)) {
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) <= (-3.65d+19)) .or. (.not. ((x / y) <= 14000.0d0))) 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) <= -3.65e+19) || !((x / y) <= 14000.0)) {
tmp = x / y;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -3.65e+19) or not ((x / y) <= 14000.0): 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) <= -3.65e+19) || !(Float64(x / y) <= 14000.0)) 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) <= -3.65e+19) || ~(((x / y) <= 14000.0))) 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], -3.65e+19], N[Not[LessEqual[N[(x / y), $MachinePrecision], 14000.0]], $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 -3.65 \cdot 10^{+19} \lor \neg \left(\frac{x}{y} \leq 14000\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -3.65e19 or 14000 < (/.f64 x y) Initial program 83.1%
Taylor expanded in x around inf 70.7%
if -3.65e19 < (/.f64 x y) < 14000Initial program 90.2%
Taylor expanded in z around inf 62.5%
div-sub62.5%
sub-neg62.5%
*-inverses62.5%
metadata-eval62.5%
distribute-lft-in62.5%
metadata-eval62.5%
associate-*r/62.5%
metadata-eval62.5%
Simplified62.5%
Taylor expanded in x around 0 61.4%
sub-neg61.4%
metadata-eval61.4%
associate-*r/61.4%
metadata-eval61.4%
+-commutative61.4%
Simplified61.4%
Final simplification66.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -9.8e-132) (not (<= z 6.4e-28))) (+ (/ 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 ((z <= -9.8e-132) || !(z <= 6.4e-28)) {
tmp = (x / y) + ((2.0 / t) + -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 ((z <= (-9.8d-132)) .or. (.not. (z <= 6.4d-28))) then
tmp = (x / y) + ((2.0d0 / t) + (-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 ((z <= -9.8e-132) || !(z <= 6.4e-28)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = -2.0 + (2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -9.8e-132) or not (z <= 6.4e-28): tmp = (x / y) + ((2.0 / t) + -2.0) else: tmp = -2.0 + (2.0 / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -9.8e-132) || !(z <= 6.4e-28)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); else tmp = Float64(-2.0 + Float64(2.0 / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -9.8e-132) || ~((z <= 6.4e-28))) tmp = (x / y) + ((2.0 / t) + -2.0); else tmp = -2.0 + (2.0 / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -9.8e-132], N[Not[LessEqual[z, 6.4e-28]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.8 \cdot 10^{-132} \lor \neg \left(z \leq 6.4 \cdot 10^{-28}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{z \cdot t}\\
\end{array}
\end{array}
if z < -9.79999999999999961e-132 or 6.39999999999999964e-28 < z Initial program 79.5%
Taylor expanded in z around inf 95.3%
div-sub95.3%
sub-neg95.3%
*-inverses95.3%
metadata-eval95.3%
distribute-lft-in95.3%
metadata-eval95.3%
associate-*r/95.3%
metadata-eval95.3%
Simplified95.3%
if -9.79999999999999961e-132 < z < 6.39999999999999964e-28Initial program 97.8%
Taylor expanded in t around inf 97.8%
*-commutative97.8%
*-commutative97.8%
associate-*l*97.8%
Simplified97.8%
Taylor expanded in z around inf 97.8%
sub-neg97.8%
associate-*r/97.8%
metadata-eval97.8%
*-commutative97.8%
associate-/r*97.6%
metadata-eval97.6%
Simplified97.6%
Taylor expanded in x around 0 77.7%
sub-neg77.7%
associate-*r/77.7%
metadata-eval77.7%
*-commutative77.7%
metadata-eval77.7%
+-commutative77.7%
*-commutative77.7%
Simplified77.7%
Final simplification88.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.05e-29) (not (<= z 9e-9))) (+ (/ x y) (+ (/ 2.0 t) -2.0)) (+ (/ x y) (/ 2.0 (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.05e-29) || !(z <= 9e-9)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + (2.0 / (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.05d-29)) .or. (.not. (z <= 9d-9))) then
tmp = (x / y) + ((2.0d0 / t) + (-2.0d0))
else
tmp = (x / y) + (2.0d0 / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.05e-29) || !(z <= 9e-9)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + (2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.05e-29) or not (z <= 9e-9): tmp = (x / y) + ((2.0 / t) + -2.0) else: tmp = (x / y) + (2.0 / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.05e-29) || !(z <= 9e-9)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); else tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.05e-29) || ~((z <= 9e-9))) tmp = (x / y) + ((2.0 / t) + -2.0); else tmp = (x / y) + (2.0 / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.05e-29], N[Not[LessEqual[z, 9e-9]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-29} \lor \neg \left(z \leq 9 \cdot 10^{-9}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\
\end{array}
\end{array}
if z < -1.04999999999999995e-29 or 8.99999999999999953e-9 < z Initial program 77.2%
Taylor expanded in z around inf 97.6%
div-sub97.6%
sub-neg97.6%
*-inverses97.6%
metadata-eval97.6%
distribute-lft-in97.6%
metadata-eval97.6%
associate-*r/97.6%
metadata-eval97.6%
Simplified97.6%
if -1.04999999999999995e-29 < z < 8.99999999999999953e-9Initial program 98.1%
Taylor expanded in z around 0 89.5%
Final simplification94.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -9.2e-30) (not (<= z 1.3e-5))) (+ (/ x y) (+ (/ 2.0 t) -2.0)) (+ (/ x y) (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9.2e-30) || !(z <= 1.3e-5)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-9.2d-30)) .or. (.not. (z <= 1.3d-5))) then
tmp = (x / y) + ((2.0d0 / t) + (-2.0d0))
else
tmp = (x / y) + ((2.0d0 / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9.2e-30) || !(z <= 1.3e-5)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -9.2e-30) or not (z <= 1.3e-5): tmp = (x / y) + ((2.0 / t) + -2.0) else: tmp = (x / y) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -9.2e-30) || !(z <= 1.3e-5)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -9.2e-30) || ~((z <= 1.3e-5))) tmp = (x / y) + ((2.0 / t) + -2.0); else tmp = (x / y) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -9.2e-30], N[Not[LessEqual[z, 1.3e-5]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{-30} \lor \neg \left(z \leq 1.3 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if z < -9.19999999999999937e-30 or 1.29999999999999992e-5 < z Initial program 77.2%
Taylor expanded in z around inf 97.6%
div-sub97.6%
sub-neg97.6%
*-inverses97.6%
metadata-eval97.6%
distribute-lft-in97.6%
metadata-eval97.6%
associate-*r/97.6%
metadata-eval97.6%
Simplified97.6%
if -9.19999999999999937e-30 < z < 1.29999999999999992e-5Initial program 98.1%
Taylor expanded in z around 0 89.5%
Taylor expanded in x around 0 89.5%
associate-*r/89.5%
metadata-eval89.5%
associate-/r*89.5%
Simplified89.5%
Final simplification94.0%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -6.3e+19) (/ x y) (if (<= (/ x y) 0.0145) (+ (/ 2.0 t) -2.0) (- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -6.3e+19) {
tmp = x / y;
} else if ((x / y) <= 0.0145) {
tmp = (2.0 / t) + -2.0;
} 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) <= (-6.3d+19)) then
tmp = x / y
else if ((x / y) <= 0.0145d0) then
tmp = (2.0d0 / t) + (-2.0d0)
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) <= -6.3e+19) {
tmp = x / y;
} else if ((x / y) <= 0.0145) {
tmp = (2.0 / t) + -2.0;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -6.3e+19: tmp = x / y elif (x / y) <= 0.0145: tmp = (2.0 / t) + -2.0 else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -6.3e+19) tmp = Float64(x / y); elseif (Float64(x / y) <= 0.0145) tmp = Float64(Float64(2.0 / t) + -2.0); 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) <= -6.3e+19) tmp = x / y; elseif ((x / y) <= 0.0145) tmp = (2.0 / t) + -2.0; else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -6.3e+19], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 0.0145], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -6.3 \cdot 10^{+19}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 0.0145:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -6.3e19Initial program 82.3%
Taylor expanded in x around inf 71.4%
if -6.3e19 < (/.f64 x y) < 0.0145000000000000007Initial program 90.2%
Taylor expanded in z around inf 62.5%
div-sub62.5%
sub-neg62.5%
*-inverses62.5%
metadata-eval62.5%
distribute-lft-in62.5%
metadata-eval62.5%
associate-*r/62.5%
metadata-eval62.5%
Simplified62.5%
Taylor expanded in x around 0 61.4%
sub-neg61.4%
metadata-eval61.4%
associate-*r/61.4%
metadata-eval61.4%
+-commutative61.4%
Simplified61.4%
if 0.0145000000000000007 < (/.f64 x y) Initial program 84.1%
Taylor expanded in t around inf 70.5%
Final simplification66.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -620000000000.0) (not (<= t 8e-50))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -620000000000.0) || !(t <= 8e-50)) {
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 <= (-620000000000.0d0)) .or. (.not. (t <= 8d-50))) 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 <= -620000000000.0) || !(t <= 8e-50)) {
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 <= -620000000000.0) or not (t <= 8e-50): 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 <= -620000000000.0) || !(t <= 8e-50)) 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 <= -620000000000.0) || ~((t <= 8e-50))) 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, -620000000000.0], N[Not[LessEqual[t, 8e-50]], $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 -620000000000 \lor \neg \left(t \leq 8 \cdot 10^{-50}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -6.2e11 or 8.00000000000000006e-50 < t Initial program 76.6%
Taylor expanded in t around inf 79.8%
if -6.2e11 < t < 8.00000000000000006e-50Initial program 98.1%
Taylor expanded in t around 0 83.6%
associate-*r/83.6%
metadata-eval83.6%
Simplified83.6%
Final simplification81.6%
(FPCore (x y z t) :precision binary64 (if (<= t -1.7e-9) -2.0 (if (<= t 3.8e-24) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.7e-9) {
tmp = -2.0;
} else if (t <= 3.8e-24) {
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.7d-9)) then
tmp = -2.0d0
else if (t <= 3.8d-24) 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.7e-9) {
tmp = -2.0;
} else if (t <= 3.8e-24) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.7e-9: tmp = -2.0 elif t <= 3.8e-24: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.7e-9) tmp = -2.0; elseif (t <= 3.8e-24) 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.7e-9) tmp = -2.0; elseif (t <= 3.8e-24) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.7e-9], -2.0, If[LessEqual[t, 3.8e-24], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{-9}:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-24}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1.6999999999999999e-9 or 3.80000000000000026e-24 < t Initial program 75.7%
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%
Taylor expanded in x around 0 28.6%
sub-neg28.6%
metadata-eval28.6%
associate-*r/28.6%
metadata-eval28.6%
+-commutative28.6%
Simplified28.6%
Taylor expanded in t around inf 28.7%
if -1.6999999999999999e-9 < t < 3.80000000000000026e-24Initial program 98.2%
Taylor expanded in z around inf 60.3%
div-sub60.3%
sub-neg60.3%
*-inverses60.3%
metadata-eval60.3%
distribute-lft-in60.3%
metadata-eval60.3%
associate-*r/60.3%
metadata-eval60.3%
Simplified60.3%
Taylor expanded in t around 0 41.5%
Final simplification34.9%
(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 86.6%
Taylor expanded in z around inf 70.3%
div-sub70.3%
sub-neg70.3%
*-inverses70.3%
metadata-eval70.3%
distribute-lft-in70.3%
metadata-eval70.3%
associate-*r/70.3%
metadata-eval70.3%
Simplified70.3%
Taylor expanded in x around 0 35.0%
sub-neg35.0%
metadata-eval35.0%
associate-*r/35.0%
metadata-eval35.0%
+-commutative35.0%
Simplified35.0%
Taylor expanded in t around inf 16.1%
Final simplification16.1%
(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 2024130
(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))))