
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ 2.0 (* (- 1.0 t) (* 2.0 z))) (* z t))))
(if (<= t_1 2e+305)
(+ t_1 (/ x y))
(/ (+ x (* y (+ (* 2.0 (/ (- 1.0 t) t)) (* 2.0 (/ 1.0 (* z t)))))) y))))
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 <= 2e+305) {
tmp = t_1 + (x / y);
} else {
tmp = (x + (y * ((2.0 * ((1.0 - t) / t)) + (2.0 * (1.0 / (z * t)))))) / 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) :: t_1
real(8) :: tmp
t_1 = (2.0d0 + ((1.0d0 - t) * (2.0d0 * z))) / (z * t)
if (t_1 <= 2d+305) then
tmp = t_1 + (x / y)
else
tmp = (x + (y * ((2.0d0 * ((1.0d0 - t) / t)) + (2.0d0 * (1.0d0 / (z * t)))))) / y
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 <= 2e+305) {
tmp = t_1 + (x / y);
} else {
tmp = (x + (y * ((2.0 * ((1.0 - t) / t)) + (2.0 * (1.0 / (z * t)))))) / y;
}
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 <= 2e+305: tmp = t_1 + (x / y) else: tmp = (x + (y * ((2.0 * ((1.0 - t) / t)) + (2.0 * (1.0 / (z * t)))))) / y 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 <= 2e+305) tmp = Float64(t_1 + Float64(x / y)); else tmp = Float64(Float64(x + Float64(y * Float64(Float64(2.0 * Float64(Float64(1.0 - t) / t)) + Float64(2.0 * Float64(1.0 / Float64(z * t)))))) / y); 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 <= 2e+305) tmp = t_1 + (x / y); else tmp = (x + (y * ((2.0 * ((1.0 - t) / t)) + (2.0 * (1.0 / (z * t)))))) / y; 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, 2e+305], N[(t$95$1 + N[(x / y), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * N[(N[(2.0 * N[(N[(1.0 - t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(1.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $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 2 \cdot 10^{+305}:\\
\;\;\;\;t\_1 + \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \left(2 \cdot \frac{1 - t}{t} + 2 \cdot \frac{1}{z \cdot t}\right)}{y}\\
\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)) < 1.9999999999999999e305Initial program 99.8%
if 1.9999999999999999e305 < (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) Initial program 36.7%
Taylor expanded in y around 0 100.0%
Final simplification99.8%
(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)) y))))
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)) / y;
}
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)) / y;
}
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)) / y 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 + Float64(y * -2.0)) / y); 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)) / y; 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 + N[(y * -2.0), $MachinePrecision]), $MachinePrecision] / y), $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 \cdot -2}{y}\\
\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 y around 0 100.0%
Taylor expanded in t around inf 93.5%
+-commutative93.5%
*-commutative93.5%
Simplified93.5%
Final simplification99.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1e+16) (not (<= (/ x y) 2.0))) (+ (/ x y) (/ (+ 2.0 (* 2.0 z)) (* z t))) (+ -2.0 (* (/ 1.0 t) (+ 2.0 (/ 2.0 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e+16) || !((x / y) <= 2.0)) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t));
} else {
tmp = -2.0 + ((1.0 / t) * (2.0 + (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) :: tmp
if (((x / y) <= (-1d+16)) .or. (.not. ((x / y) <= 2.0d0))) then
tmp = (x / y) + ((2.0d0 + (2.0d0 * z)) / (z * t))
else
tmp = (-2.0d0) + ((1.0d0 / t) * (2.0d0 + (2.0d0 / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e+16) || !((x / y) <= 2.0)) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t));
} else {
tmp = -2.0 + ((1.0 / t) * (2.0 + (2.0 / z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1e+16) or not ((x / y) <= 2.0): tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t)) else: tmp = -2.0 + ((1.0 / t) * (2.0 + (2.0 / z))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1e+16) || !(Float64(x / y) <= 2.0)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(2.0 * z)) / Float64(z * t))); else tmp = Float64(-2.0 + Float64(Float64(1.0 / t) * Float64(2.0 + Float64(2.0 / z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1e+16) || ~(((x / y) <= 2.0))) tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t)); else tmp = -2.0 + ((1.0 / t) * (2.0 + (2.0 / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1e+16], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2.0]], $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[(1.0 / t), $MachinePrecision] * N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+16} \lor \neg \left(\frac{x}{y} \leq 2\right):\\
\;\;\;\;\frac{x}{y} + \frac{2 + 2 \cdot z}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{1}{t} \cdot \left(2 + \frac{2}{z}\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -1e16 or 2 < (/.f64 x y) Initial program 88.4%
Taylor expanded in t around 0 97.8%
if -1e16 < (/.f64 x y) < 2Initial program 87.1%
Taylor expanded in x around 0 97.9%
associate-*r/97.9%
metadata-eval97.9%
associate-/l/98.0%
+-commutative98.0%
div-sub98.0%
sub-neg98.0%
*-inverses98.0%
metadata-eval98.0%
distribute-lft-in98.0%
metadata-eval98.0%
associate-+l+98.0%
+-commutative98.0%
associate-/l/97.9%
+-commutative97.9%
associate-/l/98.0%
*-rgt-identity98.0%
associate-*r/97.9%
distribute-rgt-out97.9%
Simplified97.9%
Final simplification97.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= z -3.15e-80)
t_1
(if (<= z 2.5e-66)
(/ (/ 2.0 t) z)
(if (or (<= z 3.7e+27) (not (<= z 4.4e+190)))
t_1
(+ -2.0 (/ 2.0 t)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (z <= -3.15e-80) {
tmp = t_1;
} else if (z <= 2.5e-66) {
tmp = (2.0 / t) / z;
} else if ((z <= 3.7e+27) || !(z <= 4.4e+190)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x / y) - 2.0d0
if (z <= (-3.15d-80)) then
tmp = t_1
else if (z <= 2.5d-66) then
tmp = (2.0d0 / t) / z
else if ((z <= 3.7d+27) .or. (.not. (z <= 4.4d+190))) then
tmp = t_1
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 t_1 = (x / y) - 2.0;
double tmp;
if (z <= -3.15e-80) {
tmp = t_1;
} else if (z <= 2.5e-66) {
tmp = (2.0 / t) / z;
} else if ((z <= 3.7e+27) || !(z <= 4.4e+190)) {
tmp = t_1;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if z <= -3.15e-80: tmp = t_1 elif z <= 2.5e-66: tmp = (2.0 / t) / z elif (z <= 3.7e+27) or not (z <= 4.4e+190): tmp = t_1 else: tmp = -2.0 + (2.0 / t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (z <= -3.15e-80) tmp = t_1; elseif (z <= 2.5e-66) tmp = Float64(Float64(2.0 / t) / z); elseif ((z <= 3.7e+27) || !(z <= 4.4e+190)) tmp = t_1; else tmp = Float64(-2.0 + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (z <= -3.15e-80) tmp = t_1; elseif (z <= 2.5e-66) tmp = (2.0 / t) / z; elseif ((z <= 3.7e+27) || ~((z <= 4.4e+190))) tmp = t_1; else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[z, -3.15e-80], t$95$1, If[LessEqual[z, 2.5e-66], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[z, 3.7e+27], N[Not[LessEqual[z, 4.4e+190]], $MachinePrecision]], t$95$1, N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;z \leq -3.15 \cdot 10^{-80}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-66}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+27} \lor \neg \left(z \leq 4.4 \cdot 10^{+190}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if z < -3.14999999999999983e-80 or 2.49999999999999981e-66 < z < 3.70000000000000002e27 or 4.4e190 < z Initial program 80.2%
Taylor expanded in t around inf 74.5%
if -3.14999999999999983e-80 < z < 2.49999999999999981e-66Initial program 98.7%
Taylor expanded in z around 0 67.1%
associate-/l/67.2%
Simplified67.2%
Taylor expanded in z around 0 67.1%
associate-/r*67.2%
Simplified67.2%
if 3.70000000000000002e27 < z < 4.4e190Initial program 85.7%
Taylor expanded in z around inf 100.0%
div-sub100.0%
sub-neg100.0%
*-inverses100.0%
metadata-eval100.0%
distribute-lft-in100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 82.6%
sub-neg82.6%
associate-*r/82.6%
metadata-eval82.6%
metadata-eval82.6%
Simplified82.6%
Final simplification72.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= z -3.95e-79)
t_1
(if (<= z 5.5e-60)
(/ 2.0 (* z t))
(if (or (<= z 2.25e+27) (not (<= z 4.4e+190)))
t_1
(+ -2.0 (/ 2.0 t)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (z <= -3.95e-79) {
tmp = t_1;
} else if (z <= 5.5e-60) {
tmp = 2.0 / (z * t);
} else if ((z <= 2.25e+27) || !(z <= 4.4e+190)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x / y) - 2.0d0
if (z <= (-3.95d-79)) then
tmp = t_1
else if (z <= 5.5d-60) then
tmp = 2.0d0 / (z * t)
else if ((z <= 2.25d+27) .or. (.not. (z <= 4.4d+190))) then
tmp = t_1
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 t_1 = (x / y) - 2.0;
double tmp;
if (z <= -3.95e-79) {
tmp = t_1;
} else if (z <= 5.5e-60) {
tmp = 2.0 / (z * t);
} else if ((z <= 2.25e+27) || !(z <= 4.4e+190)) {
tmp = t_1;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if z <= -3.95e-79: tmp = t_1 elif z <= 5.5e-60: tmp = 2.0 / (z * t) elif (z <= 2.25e+27) or not (z <= 4.4e+190): tmp = t_1 else: tmp = -2.0 + (2.0 / t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (z <= -3.95e-79) tmp = t_1; elseif (z <= 5.5e-60) tmp = Float64(2.0 / Float64(z * t)); elseif ((z <= 2.25e+27) || !(z <= 4.4e+190)) tmp = t_1; else tmp = Float64(-2.0 + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (z <= -3.95e-79) tmp = t_1; elseif (z <= 5.5e-60) tmp = 2.0 / (z * t); elseif ((z <= 2.25e+27) || ~((z <= 4.4e+190))) tmp = t_1; else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[z, -3.95e-79], t$95$1, If[LessEqual[z, 5.5e-60], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 2.25e+27], N[Not[LessEqual[z, 4.4e+190]], $MachinePrecision]], t$95$1, N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;z \leq -3.95 \cdot 10^{-79}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-60}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+27} \lor \neg \left(z \leq 4.4 \cdot 10^{+190}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if z < -3.94999999999999973e-79 or 5.4999999999999997e-60 < z < 2.25e27 or 4.4e190 < z Initial program 80.2%
Taylor expanded in t around inf 74.5%
if -3.94999999999999973e-79 < z < 5.4999999999999997e-60Initial program 98.7%
Taylor expanded in z around 0 67.1%
if 2.25e27 < z < 4.4e190Initial program 85.7%
Taylor expanded in z around inf 100.0%
div-sub100.0%
sub-neg100.0%
*-inverses100.0%
metadata-eval100.0%
distribute-lft-in100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 82.6%
sub-neg82.6%
associate-*r/82.6%
metadata-eval82.6%
metadata-eval82.6%
Simplified82.6%
Final simplification72.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2e+34) (not (<= (/ x y) 2e+15))) (+ (/ x y) (/ (/ 2.0 z) t)) (+ -2.0 (* (/ 1.0 t) (+ 2.0 (/ 2.0 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2e+34) || !((x / y) <= 2e+15)) {
tmp = (x / y) + ((2.0 / z) / t);
} else {
tmp = -2.0 + ((1.0 / t) * (2.0 + (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) :: tmp
if (((x / y) <= (-2d+34)) .or. (.not. ((x / y) <= 2d+15))) then
tmp = (x / y) + ((2.0d0 / z) / t)
else
tmp = (-2.0d0) + ((1.0d0 / t) * (2.0d0 + (2.0d0 / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2e+34) || !((x / y) <= 2e+15)) {
tmp = (x / y) + ((2.0 / z) / t);
} else {
tmp = -2.0 + ((1.0 / t) * (2.0 + (2.0 / z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2e+34) or not ((x / y) <= 2e+15): tmp = (x / y) + ((2.0 / z) / t) else: tmp = -2.0 + ((1.0 / t) * (2.0 + (2.0 / z))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2e+34) || !(Float64(x / y) <= 2e+15)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / z) / t)); else tmp = Float64(-2.0 + Float64(Float64(1.0 / t) * Float64(2.0 + Float64(2.0 / z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2e+34) || ~(((x / y) <= 2e+15))) tmp = (x / y) + ((2.0 / z) / t); else tmp = -2.0 + ((1.0 / t) * (2.0 + (2.0 / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2e+34], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2e+15]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(1.0 / t), $MachinePrecision] * N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+34} \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{+15}\right):\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{1}{t} \cdot \left(2 + \frac{2}{z}\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -1.99999999999999989e34 or 2e15 < (/.f64 x y) Initial program 87.9%
Taylor expanded in y around 0 99.2%
Taylor expanded in z around 0 92.8%
*-commutative92.8%
associate-*l/92.8%
associate-*r/92.8%
associate-/r*92.9%
Simplified92.9%
Taylor expanded in x around 0 91.8%
associate-*r/91.8%
metadata-eval91.8%
associate-/l/91.9%
Simplified91.9%
if -1.99999999999999989e34 < (/.f64 x y) < 2e15Initial program 87.6%
Taylor expanded in x around 0 96.7%
associate-*r/96.7%
metadata-eval96.7%
associate-/l/96.7%
+-commutative96.7%
div-sub96.7%
sub-neg96.7%
*-inverses96.7%
metadata-eval96.7%
distribute-lft-in96.7%
metadata-eval96.7%
associate-+l+96.7%
+-commutative96.7%
associate-/l/96.7%
+-commutative96.7%
associate-/l/96.7%
*-rgt-identity96.7%
associate-*r/96.6%
distribute-rgt-out96.6%
Simplified96.6%
Final simplification94.5%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -2e+34)
(/ (+ x (* y (/ (/ 2.0 t) z))) y)
(if (<= (/ x y) 2e+15)
(+ -2.0 (* (/ 1.0 t) (+ 2.0 (/ 2.0 z))))
(+ (/ x y) (/ (/ 2.0 z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2e+34) {
tmp = (x + (y * ((2.0 / t) / z))) / y;
} else if ((x / y) <= 2e+15) {
tmp = -2.0 + ((1.0 / t) * (2.0 + (2.0 / z)));
} 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 ((x / y) <= (-2d+34)) then
tmp = (x + (y * ((2.0d0 / t) / z))) / y
else if ((x / y) <= 2d+15) then
tmp = (-2.0d0) + ((1.0d0 / t) * (2.0d0 + (2.0d0 / z)))
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 ((x / y) <= -2e+34) {
tmp = (x + (y * ((2.0 / t) / z))) / y;
} else if ((x / y) <= 2e+15) {
tmp = -2.0 + ((1.0 / t) * (2.0 + (2.0 / z)));
} else {
tmp = (x / y) + ((2.0 / z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2e+34: tmp = (x + (y * ((2.0 / t) / z))) / y elif (x / y) <= 2e+15: tmp = -2.0 + ((1.0 / t) * (2.0 + (2.0 / z))) else: tmp = (x / y) + ((2.0 / z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2e+34) tmp = Float64(Float64(x + Float64(y * Float64(Float64(2.0 / t) / z))) / y); elseif (Float64(x / y) <= 2e+15) tmp = Float64(-2.0 + Float64(Float64(1.0 / t) * Float64(2.0 + Float64(2.0 / z)))); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -2e+34) tmp = (x + (y * ((2.0 / t) / z))) / y; elseif ((x / y) <= 2e+15) tmp = -2.0 + ((1.0 / t) * (2.0 + (2.0 / z))); else tmp = (x / y) + ((2.0 / z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2e+34], N[(N[(x + N[(y * N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2e+15], N[(-2.0 + N[(N[(1.0 / t), $MachinePrecision] * N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+34}:\\
\;\;\;\;\frac{x + y \cdot \frac{\frac{2}{t}}{z}}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+15}:\\
\;\;\;\;-2 + \frac{1}{t} \cdot \left(2 + \frac{2}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.99999999999999989e34Initial program 89.2%
Taylor expanded in y around 0 99.9%
Taylor expanded in z around 0 95.3%
*-commutative95.3%
associate-*l/95.3%
associate-*r/95.3%
associate-/r*95.4%
Simplified95.4%
if -1.99999999999999989e34 < (/.f64 x y) < 2e15Initial program 87.6%
Taylor expanded in x around 0 96.7%
associate-*r/96.7%
metadata-eval96.7%
associate-/l/96.7%
+-commutative96.7%
div-sub96.7%
sub-neg96.7%
*-inverses96.7%
metadata-eval96.7%
distribute-lft-in96.7%
metadata-eval96.7%
associate-+l+96.7%
+-commutative96.7%
associate-/l/96.7%
+-commutative96.7%
associate-/l/96.7%
*-rgt-identity96.7%
associate-*r/96.6%
distribute-rgt-out96.6%
Simplified96.6%
if 2e15 < (/.f64 x y) Initial program 86.6%
Taylor expanded in y around 0 98.6%
Taylor expanded in z around 0 90.5%
*-commutative90.5%
associate-*l/90.5%
associate-*r/90.5%
associate-/r*90.5%
Simplified90.5%
Taylor expanded in x around 0 91.9%
associate-*r/91.9%
metadata-eval91.9%
associate-/l/91.9%
Simplified91.9%
Final simplification95.2%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -3.1e+29) (/ x y) (if (<= (/ x y) -1.02e-79) (/ 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) <= -3.1e+29) {
tmp = x / y;
} else if ((x / y) <= -1.02e-79) {
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) <= (-3.1d+29)) then
tmp = x / y
else if ((x / y) <= (-1.02d-79)) 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) <= -3.1e+29) {
tmp = x / y;
} else if ((x / y) <= -1.02e-79) {
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) <= -3.1e+29: tmp = x / y elif (x / y) <= -1.02e-79: 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) <= -3.1e+29) tmp = Float64(x / y); elseif (Float64(x / y) <= -1.02e-79) 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) <= -3.1e+29) tmp = x / y; elseif ((x / y) <= -1.02e-79) 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], -3.1e+29], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -1.02e-79], 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 -3.1 \cdot 10^{+29}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -1.02 \cdot 10^{-79}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 2:\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -3.0999999999999999e29 or 2 < (/.f64 x y) Initial program 88.2%
Taylor expanded in x around inf 69.8%
if -3.0999999999999999e29 < (/.f64 x y) < -1.02000000000000002e-79Initial program 88.1%
Taylor expanded in t around 0 68.1%
associate-*r/68.1%
metadata-eval68.1%
Simplified68.1%
Taylor expanded in z around inf 44.3%
if -1.02000000000000002e-79 < (/.f64 x y) < 2Initial program 87.2%
Taylor expanded in t around inf 46.1%
Taylor expanded in x around 0 44.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2e+157) (not (<= (/ x y) 1.45e+26))) (/ x y) (+ -2.0 (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2e+157) || !((x / y) <= 1.45e+26)) {
tmp = x / y;
} else {
tmp = -2.0 + ((2.0 / t) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-2d+157)) .or. (.not. ((x / y) <= 1.45d+26))) then
tmp = x / y
else
tmp = (-2.0d0) + ((2.0d0 / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2e+157) || !((x / y) <= 1.45e+26)) {
tmp = x / y;
} else {
tmp = -2.0 + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2e+157) or not ((x / y) <= 1.45e+26): tmp = x / y else: tmp = -2.0 + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2e+157) || !(Float64(x / y) <= 1.45e+26)) tmp = Float64(x / y); else tmp = Float64(-2.0 + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2e+157) || ~(((x / y) <= 1.45e+26))) tmp = x / y; else tmp = -2.0 + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2e+157], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1.45e+26]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(-2.0 + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+157} \lor \neg \left(\frac{x}{y} \leq 1.45 \cdot 10^{+26}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.99999999999999997e157 or 1.45e26 < (/.f64 x y) Initial program 87.6%
Taylor expanded in x around inf 79.6%
if -1.99999999999999997e157 < (/.f64 x y) < 1.45e26Initial program 87.8%
Taylor expanded in x around 0 94.1%
associate-*r/94.1%
metadata-eval94.1%
associate-/l/94.1%
+-commutative94.1%
div-sub94.1%
sub-neg94.1%
*-inverses94.1%
metadata-eval94.1%
distribute-lft-in94.1%
metadata-eval94.1%
associate-+l+94.1%
+-commutative94.1%
associate-/l/94.1%
+-commutative94.1%
associate-/l/94.1%
*-rgt-identity94.1%
associate-*r/94.1%
distribute-rgt-out94.1%
Simplified94.1%
Taylor expanded in z around 0 72.1%
Taylor expanded in t around inf 72.2%
sub-neg72.2%
metadata-eval72.2%
associate-*r/72.2%
metadata-eval72.2%
+-commutative72.2%
associate-/r*72.2%
Simplified72.2%
Final simplification75.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.02e-41) (not (<= z 3.1e-59))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (/ x y) (/ (/ 2.0 z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.02e-41) || !(z <= 3.1e-59)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} 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.02d-41)) .or. (.not. (z <= 3.1d-59))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
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.02e-41) || !(z <= 3.1e-59)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + ((2.0 / z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.02e-41) or not (z <= 3.1e-59): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = (x / y) + ((2.0 / z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.02e-41) || !(z <= 3.1e-59)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.02e-41) || ~((z <= 3.1e-59))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = (x / y) + ((2.0 / z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.02e-41], N[Not[LessEqual[z, 3.1e-59]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{-41} \lor \neg \left(z \leq 3.1 \cdot 10^{-59}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{z}}{t}\\
\end{array}
\end{array}
if z < -1.02e-41 or 3.09999999999999999e-59 < z Initial program 79.4%
Taylor expanded in z around inf 98.1%
div-sub98.1%
sub-neg98.1%
*-inverses98.1%
metadata-eval98.1%
distribute-lft-in98.1%
associate-*r/98.1%
metadata-eval98.1%
metadata-eval98.1%
Simplified98.1%
if -1.02e-41 < z < 3.09999999999999999e-59Initial program 98.1%
Taylor expanded in y around 0 93.4%
Taylor expanded in z around 0 80.6%
*-commutative80.6%
associate-*l/80.6%
associate-*r/80.6%
associate-/r*80.6%
Simplified80.6%
Taylor expanded in x around 0 85.2%
associate-*r/85.2%
metadata-eval85.2%
associate-/l/85.3%
Simplified85.3%
Final simplification92.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -6e-57) (not (<= z 3.2e-60))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ -2.0 (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6e-57) || !(z <= 3.2e-60)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = -2.0 + ((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 <= (-6d-57)) .or. (.not. (z <= 3.2d-60))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = (-2.0d0) + ((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 <= -6e-57) || !(z <= 3.2e-60)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = -2.0 + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -6e-57) or not (z <= 3.2e-60): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = -2.0 + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -6e-57) || !(z <= 3.2e-60)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(-2.0 + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -6e-57) || ~((z <= 3.2e-60))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = -2.0 + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -6e-57], N[Not[LessEqual[z, 3.2e-60]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-57} \lor \neg \left(z \leq 3.2 \cdot 10^{-60}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if z < -6.00000000000000001e-57 or 3.2000000000000001e-60 < z Initial program 80.7%
Taylor expanded in z around inf 96.3%
div-sub96.3%
sub-neg96.3%
*-inverses96.3%
metadata-eval96.3%
distribute-lft-in96.3%
associate-*r/96.3%
metadata-eval96.3%
metadata-eval96.3%
Simplified96.3%
if -6.00000000000000001e-57 < z < 3.2000000000000001e-60Initial program 97.9%
Taylor expanded in x around 0 76.5%
associate-*r/76.5%
metadata-eval76.5%
associate-/l/76.6%
+-commutative76.6%
div-sub76.6%
sub-neg76.6%
*-inverses76.6%
metadata-eval76.6%
distribute-lft-in76.6%
metadata-eval76.6%
associate-+l+76.6%
+-commutative76.6%
associate-/l/76.5%
+-commutative76.5%
associate-/l/76.6%
*-rgt-identity76.6%
associate-*r/76.5%
distribute-rgt-out76.5%
Simplified76.5%
Taylor expanded in z around 0 76.5%
Taylor expanded in t around inf 76.5%
sub-neg76.5%
metadata-eval76.5%
associate-*r/76.5%
metadata-eval76.5%
+-commutative76.5%
associate-/r*76.6%
Simplified76.6%
Final simplification88.2%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -6.6e+28) (not (<= (/ x y) 2.1e+15))) (/ x y) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -6.6e+28) || !((x / y) <= 2.1e+15)) {
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) <= (-6.6d+28)) .or. (.not. ((x / y) <= 2.1d+15))) 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) <= -6.6e+28) || !((x / y) <= 2.1e+15)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -6.6e+28) or not ((x / y) <= 2.1e+15): 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) <= -6.6e+28) || !(Float64(x / y) <= 2.1e+15)) 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) <= -6.6e+28) || ~(((x / y) <= 2.1e+15))) 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], -6.6e+28], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2.1e+15]], $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 -6.6 \cdot 10^{+28} \lor \neg \left(\frac{x}{y} \leq 2.1 \cdot 10^{+15}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -6.6e28 or 2.1e15 < (/.f64 x y) Initial program 87.9%
Taylor expanded in x around inf 71.3%
if -6.6e28 < (/.f64 x y) < 2.1e15Initial program 87.6%
Taylor expanded in z around inf 67.2%
div-sub67.2%
sub-neg67.2%
*-inverses67.2%
metadata-eval67.2%
distribute-lft-in67.2%
associate-*r/67.2%
metadata-eval67.2%
metadata-eval67.2%
Simplified67.2%
Taylor expanded in x around 0 64.0%
sub-neg64.0%
associate-*r/64.0%
metadata-eval64.0%
metadata-eval64.0%
Simplified64.0%
Final simplification67.3%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -9e+28) (/ x y) (if (<= (/ x y) 0.000108) (+ -2.0 (/ 2.0 t)) (- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -9e+28) {
tmp = x / y;
} else if ((x / y) <= 0.000108) {
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) <= (-9d+28)) then
tmp = x / y
else if ((x / y) <= 0.000108d0) 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) <= -9e+28) {
tmp = x / y;
} else if ((x / y) <= 0.000108) {
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) <= -9e+28: tmp = x / y elif (x / y) <= 0.000108: 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) <= -9e+28) tmp = Float64(x / y); elseif (Float64(x / y) <= 0.000108) 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) <= -9e+28) tmp = x / y; elseif ((x / y) <= 0.000108) 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], -9e+28], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 0.000108], 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 -9 \cdot 10^{+28}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 0.000108:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -8.9999999999999994e28Initial program 89.2%
Taylor expanded in x around inf 71.2%
if -8.9999999999999994e28 < (/.f64 x y) < 1.08e-4Initial program 87.9%
Taylor expanded in z around inf 66.7%
div-sub66.7%
sub-neg66.7%
*-inverses66.7%
metadata-eval66.7%
distribute-lft-in66.7%
associate-*r/66.7%
metadata-eval66.7%
metadata-eval66.7%
Simplified66.7%
Taylor expanded in x around 0 65.3%
sub-neg65.3%
associate-*r/65.3%
metadata-eval65.3%
metadata-eval65.3%
Simplified65.3%
if 1.08e-4 < (/.f64 x y) Initial program 86.1%
Taylor expanded in t around inf 70.5%
Final simplification67.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -6.7) (not (<= t 3000.0))) (- (/ 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.7) || !(t <= 3000.0)) {
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.7d0)) .or. (.not. (t <= 3000.0d0))) 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.7) || !(t <= 3000.0)) {
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.7) or not (t <= 3000.0): 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.7) || !(t <= 3000.0)) 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.7) || ~((t <= 3000.0))) 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.7], N[Not[LessEqual[t, 3000.0]], $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.7 \lor \neg \left(t \leq 3000\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -6.70000000000000018 or 3e3 < t Initial program 77.5%
Taylor expanded in t around inf 85.8%
if -6.70000000000000018 < t < 3e3Initial program 98.2%
Taylor expanded in t around 0 77.2%
associate-*r/77.2%
metadata-eval77.2%
Simplified77.2%
Final simplification81.5%
(FPCore (x y z t) :precision binary64 (if (<= t -400.0) (/ (+ x (* y -2.0)) y) (if (<= t 80000.0) (/ (+ 2.0 (/ 2.0 z)) t) (- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -400.0) {
tmp = (x + (y * -2.0)) / y;
} else if (t <= 80000.0) {
tmp = (2.0 + (2.0 / z)) / t;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-400.0d0)) then
tmp = (x + (y * (-2.0d0))) / y
else if (t <= 80000.0d0) then
tmp = (2.0d0 + (2.0d0 / z)) / t
else
tmp = (x / y) - 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -400.0) {
tmp = (x + (y * -2.0)) / y;
} else if (t <= 80000.0) {
tmp = (2.0 + (2.0 / z)) / t;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -400.0: tmp = (x + (y * -2.0)) / y elif t <= 80000.0: tmp = (2.0 + (2.0 / z)) / t else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -400.0) tmp = Float64(Float64(x + Float64(y * -2.0)) / y); elseif (t <= 80000.0) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); else tmp = Float64(Float64(x / y) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -400.0) tmp = (x + (y * -2.0)) / y; elseif (t <= 80000.0) tmp = (2.0 + (2.0 / z)) / t; else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -400.0], N[(N[(x + N[(y * -2.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 80000.0], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -400:\\
\;\;\;\;\frac{x + y \cdot -2}{y}\\
\mathbf{elif}\;t \leq 80000:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if t < -400Initial program 71.5%
Taylor expanded in y around 0 98.5%
Taylor expanded in t around inf 81.5%
+-commutative81.5%
*-commutative81.5%
Simplified81.5%
if -400 < t < 8e4Initial program 98.2%
Taylor expanded in t around 0 77.2%
associate-*r/77.2%
metadata-eval77.2%
Simplified77.2%
if 8e4 < t Initial program 83.8%
Taylor expanded in t around inf 90.6%
Final simplification81.5%
(FPCore (x y z t) :precision binary64 (if (<= t -1.0) -2.0 (if (<= t 1.15e+26) (/ 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 <= 1.15e+26) {
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 <= 1.15d+26) 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 <= 1.15e+26) {
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 <= 1.15e+26: 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 <= 1.15e+26) 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 <= 1.15e+26) 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, 1.15e+26], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+26}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1 or 1.15e26 < t Initial program 77.3%
Taylor expanded in t around inf 85.7%
Taylor expanded in x around 0 43.7%
if -1 < t < 1.15e26Initial program 98.2%
Taylor expanded in t around 0 76.6%
associate-*r/76.6%
metadata-eval76.6%
Simplified76.6%
Taylor expanded in z around inf 32.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 87.7%
Taylor expanded in t around inf 56.0%
Taylor expanded in x around 0 23.0%
(FPCore (x y z t) :precision binary64 (- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y))))
double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((2.0d0 / z) + 2.0d0) / t) - (2.0d0 - (x / y))
end function
public static double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
def code(x, y, z, t): return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(2.0 / z) + 2.0) / t) - Float64(2.0 - Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = (((2.0 / z) + 2.0) / t) - (2.0 - (x / y)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(2.0 / z), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] - N[(2.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{2}{z} + 2}{t} - \left(2 - \frac{x}{y}\right)
\end{array}
herbie shell --seed 2024145
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:alt
(! :herbie-platform default (- (/ (+ (/ 2 z) 2) t) (- 2 (/ x y))))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))