
(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 (if (or (<= t -14200000.0) (not (<= t 8.4e-29))) (+ (/ x y) (+ (/ 2.0 (* z t)) -2.0)) (/ (+ (+ 2.0 (/ 2.0 z)) (/ (* x t) y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -14200000.0) || !(t <= 8.4e-29)) {
tmp = (x / y) + ((2.0 / (z * t)) + -2.0);
} else {
tmp = ((2.0 + (2.0 / z)) + ((x * t) / y)) / 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 <= (-14200000.0d0)) .or. (.not. (t <= 8.4d-29))) then
tmp = (x / y) + ((2.0d0 / (z * t)) + (-2.0d0))
else
tmp = ((2.0d0 + (2.0d0 / z)) + ((x * t) / y)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -14200000.0) || !(t <= 8.4e-29)) {
tmp = (x / y) + ((2.0 / (z * t)) + -2.0);
} else {
tmp = ((2.0 + (2.0 / z)) + ((x * t) / y)) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -14200000.0) or not (t <= 8.4e-29): tmp = (x / y) + ((2.0 / (z * t)) + -2.0) else: tmp = ((2.0 + (2.0 / z)) + ((x * t) / y)) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -14200000.0) || !(t <= 8.4e-29)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / Float64(z * t)) + -2.0)); else tmp = Float64(Float64(Float64(2.0 + Float64(2.0 / z)) + Float64(Float64(x * t) / y)) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -14200000.0) || ~((t <= 8.4e-29))) tmp = (x / y) + ((2.0 / (z * t)) + -2.0); else tmp = ((2.0 + (2.0 / z)) + ((x * t) / y)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -14200000.0], N[Not[LessEqual[t, 8.4e-29]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -14200000 \lor \neg \left(t \leq 8.4 \cdot 10^{-29}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{z \cdot t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(2 + \frac{2}{z}\right) + \frac{x \cdot t}{y}}{t}\\
\end{array}
\end{array}
if t < -1.42e7 or 8.39999999999999958e-29 < t Initial program 80.7%
Taylor expanded in t around 0 88.3%
associate-+r+88.3%
associate-*r/88.3%
metadata-eval88.3%
sub-neg88.3%
metadata-eval88.3%
Simplified88.3%
Taylor expanded in z around 0 88.3%
Taylor expanded in z around inf 99.9%
+-commutative99.9%
associate--l+99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
if -1.42e7 < t < 8.39999999999999958e-29Initial program 97.4%
Taylor expanded in t around 0 98.3%
associate-+r+98.3%
associate-*r/98.3%
metadata-eval98.3%
sub-neg98.3%
metadata-eval98.3%
Simplified98.3%
Taylor expanded in x around inf 99.3%
Final simplification99.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (/ (+ 2.0 (* (- 1.0 t) (* 2.0 z))) (* z t)))))
(if (<= t_1 2e+305)
t_1
(/ (+ 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 = (x / y) + ((2.0 + ((1.0 - t) * (2.0 * z))) / (z * t));
double tmp;
if (t_1 <= 2e+305) {
tmp = t_1;
} 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 = (x / y) + ((2.0d0 + ((1.0d0 - t) * (2.0d0 * z))) / (z * t))
if (t_1 <= 2d+305) then
tmp = t_1
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 = (x / y) + ((2.0 + ((1.0 - t) * (2.0 * z))) / (z * t));
double tmp;
if (t_1 <= 2e+305) {
tmp = t_1;
} 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 = (x / y) + ((2.0 + ((1.0 - t) * (2.0 * z))) / (z * t)) tmp = 0 if t_1 <= 2e+305: tmp = t_1 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(x / y) + 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 = t_1; 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 = (x / y) + ((2.0 + ((1.0 - t) * (2.0 * z))) / (z * t)); tmp = 0.0; if (t_1 <= 2e+305) tmp = t_1; 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[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(1.0 - t), $MachinePrecision] * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+305], t$95$1, 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{x}{y} + \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\\
\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 x y) (/.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 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 49.1%
Taylor expanded in y around 0 98.2%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ (/ x y) (/ (+ 2.0 (* (- 1.0 t) (* 2.0 z))) (* z t))))) (if (<= t_1 INFINITY) t_1 (- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + ((2.0 + ((1.0 - t) * (2.0 * z))) / (z * t));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + ((2.0 + ((1.0 - t) * (2.0 * z))) / (z * t));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + ((2.0 + ((1.0 - t) * (2.0 * z))) / (z * t)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(1.0 - t) * Float64(2.0 * z))) / Float64(z * t))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(x / y) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + ((2.0 + ((1.0 - t) * (2.0 * z))) / (z * t)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(1.0 - t), $MachinePrecision] * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2 + \left(1 - t\right) \cdot \left(2 \cdot z\right)}{z \cdot t}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (+.f64 (/.f64 x y) (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z))) < +inf.0Initial program 99.8%
if +inf.0 < (+.f64 (/.f64 x y) (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z))) Initial program 0.0%
Taylor expanded in t around inf 92.9%
Final simplification99.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.16e+23) (not (<= t 8.4e-29))) (+ (/ x y) (+ (/ 2.0 (* z t)) -2.0)) (+ (/ x y) (/ (+ 2.0 (* 2.0 z)) (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.16e+23) || !(t <= 8.4e-29)) {
tmp = (x / y) + ((2.0 / (z * t)) + -2.0);
} 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.16d+23)) .or. (.not. (t <= 8.4d-29))) then
tmp = (x / y) + ((2.0d0 / (z * t)) + (-2.0d0))
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.16e+23) || !(t <= 8.4e-29)) {
tmp = (x / y) + ((2.0 / (z * t)) + -2.0);
} else {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.16e+23) or not (t <= 8.4e-29): tmp = (x / y) + ((2.0 / (z * t)) + -2.0) 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.16e+23) || !(t <= 8.4e-29)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / Float64(z * t)) + -2.0)); 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.16e+23) || ~((t <= 8.4e-29))) tmp = (x / y) + ((2.0 / (z * t)) + -2.0); 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.16e+23], N[Not[LessEqual[t, 8.4e-29]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision] + -2.0), $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.16 \cdot 10^{+23} \lor \neg \left(t \leq 8.4 \cdot 10^{-29}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{z \cdot t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{2 + 2 \cdot z}{z \cdot t}\\
\end{array}
\end{array}
if t < -1.16e23 or 8.39999999999999958e-29 < t Initial program 80.4%
Taylor expanded in t around 0 88.2%
associate-+r+88.2%
associate-*r/88.2%
metadata-eval88.2%
sub-neg88.2%
metadata-eval88.2%
Simplified88.2%
Taylor expanded in z around 0 88.2%
Taylor expanded in z around inf 99.9%
+-commutative99.9%
associate--l+99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
if -1.16e23 < t < 8.39999999999999958e-29Initial program 97.4%
Taylor expanded in t around 0 96.9%
Final simplification98.4%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1e+16) (not (<= (/ x y) 4e-19))) (+ (/ x y) (/ (/ 2.0 t) z)) (/ (+ (/ 2.0 z) (* t -2.0)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e+16) || !((x / y) <= 4e-19)) {
tmp = (x / y) + ((2.0 / t) / z);
} else {
tmp = ((2.0 / z) + (t * -2.0)) / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-1d+16)) .or. (.not. ((x / y) <= 4d-19))) then
tmp = (x / y) + ((2.0d0 / t) / z)
else
tmp = ((2.0d0 / z) + (t * (-2.0d0))) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e+16) || !((x / y) <= 4e-19)) {
tmp = (x / y) + ((2.0 / t) / z);
} else {
tmp = ((2.0 / z) + (t * -2.0)) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1e+16) or not ((x / y) <= 4e-19): tmp = (x / y) + ((2.0 / t) / z) else: tmp = ((2.0 / z) + (t * -2.0)) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1e+16) || !(Float64(x / y) <= 4e-19)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); else tmp = Float64(Float64(Float64(2.0 / z) + Float64(t * -2.0)) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1e+16) || ~(((x / y) <= 4e-19))) tmp = (x / y) + ((2.0 / t) / z); else tmp = ((2.0 / z) + (t * -2.0)) / t; 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], 4e-19]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / z), $MachinePrecision] + N[(t * -2.0), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+16} \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{-19}\right):\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{z} + t \cdot -2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1e16 or 3.9999999999999999e-19 < (/.f64 x y) Initial program 90.3%
Taylor expanded in z around 0 89.2%
associate-/r*89.3%
Simplified89.3%
if -1e16 < (/.f64 x y) < 3.9999999999999999e-19Initial program 87.6%
Taylor expanded in t around 0 99.9%
associate-+r+99.9%
associate-*r/99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 79.6%
Taylor expanded in x around 0 79.1%
*-commutative79.1%
Simplified79.1%
Final simplification84.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ 2.0 t) z)))
(if (or (<= (/ x y) -1e+16) (not (<= (/ x y) 4e-19)))
(+ (/ x y) t_1)
(+ -2.0 t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 / t) / z;
double tmp;
if (((x / y) <= -1e+16) || !((x / y) <= 4e-19)) {
tmp = (x / y) + t_1;
} else {
tmp = -2.0 + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (2.0d0 / t) / z
if (((x / y) <= (-1d+16)) .or. (.not. ((x / y) <= 4d-19))) then
tmp = (x / y) + t_1
else
tmp = (-2.0d0) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (2.0 / t) / z;
double tmp;
if (((x / y) <= -1e+16) || !((x / y) <= 4e-19)) {
tmp = (x / y) + t_1;
} else {
tmp = -2.0 + t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 / t) / z tmp = 0 if ((x / y) <= -1e+16) or not ((x / y) <= 4e-19): tmp = (x / y) + t_1 else: tmp = -2.0 + t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 / t) / z) tmp = 0.0 if ((Float64(x / y) <= -1e+16) || !(Float64(x / y) <= 4e-19)) tmp = Float64(Float64(x / y) + t_1); else tmp = Float64(-2.0 + t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 / t) / z; tmp = 0.0; if (((x / y) <= -1e+16) || ~(((x / y) <= 4e-19))) tmp = (x / y) + t_1; else tmp = -2.0 + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]}, If[Or[LessEqual[N[(x / y), $MachinePrecision], -1e+16], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4e-19]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + t$95$1), $MachinePrecision], N[(-2.0 + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{2}{t}}{z}\\
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+16} \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{-19}\right):\\
\;\;\;\;\frac{x}{y} + t\_1\\
\mathbf{else}:\\
\;\;\;\;-2 + t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -1e16 or 3.9999999999999999e-19 < (/.f64 x y) Initial program 90.3%
Taylor expanded in z around 0 89.2%
associate-/r*89.3%
Simplified89.3%
if -1e16 < (/.f64 x y) < 3.9999999999999999e-19Initial program 87.6%
Taylor expanded in t around 0 99.9%
associate-+r+99.9%
associate-*r/99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 79.6%
Taylor expanded in z around inf 79.7%
+-commutative79.7%
associate--l+79.7%
sub-neg79.7%
associate-*r/79.7%
metadata-eval79.7%
metadata-eval79.7%
Simplified79.7%
Taylor expanded in x around 0 79.1%
sub-neg79.1%
associate-*r/79.1%
metadata-eval79.1%
associate-/l/79.1%
metadata-eval79.1%
+-commutative79.1%
associate-/l/79.1%
associate-/r*79.1%
Simplified79.1%
Final simplification84.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1e+16) (not (<= (/ x y) 4e-19))) (+ (/ x y) (/ 2.0 (* z t))) (+ -2.0 (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e+16) || !((x / y) <= 4e-19)) {
tmp = (x / y) + (2.0 / (z * 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 (((x / y) <= (-1d+16)) .or. (.not. ((x / y) <= 4d-19))) then
tmp = (x / y) + (2.0d0 / (z * 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 (((x / y) <= -1e+16) || !((x / y) <= 4e-19)) {
tmp = (x / y) + (2.0 / (z * t));
} else {
tmp = -2.0 + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1e+16) or not ((x / y) <= 4e-19): tmp = (x / y) + (2.0 / (z * t)) else: tmp = -2.0 + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1e+16) || !(Float64(x / y) <= 4e-19)) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(z * 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 (((x / y) <= -1e+16) || ~(((x / y) <= 4e-19))) tmp = (x / y) + (2.0 / (z * t)); 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], -1e+16], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4e-19]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $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 -1 \cdot 10^{+16} \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{-19}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if (/.f64 x y) < -1e16 or 3.9999999999999999e-19 < (/.f64 x y) Initial program 90.3%
Taylor expanded in z around 0 89.2%
if -1e16 < (/.f64 x y) < 3.9999999999999999e-19Initial program 87.6%
Taylor expanded in t around 0 99.9%
associate-+r+99.9%
associate-*r/99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 79.6%
Taylor expanded in z around inf 79.7%
+-commutative79.7%
associate--l+79.7%
sub-neg79.7%
associate-*r/79.7%
metadata-eval79.7%
metadata-eval79.7%
Simplified79.7%
Taylor expanded in x around 0 79.1%
sub-neg79.1%
associate-*r/79.1%
metadata-eval79.1%
associate-/l/79.1%
metadata-eval79.1%
+-commutative79.1%
associate-/l/79.1%
associate-/r*79.1%
Simplified79.1%
Final simplification84.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.55e+57) (not (<= z 0.52))) (+ (/ x y) (* 2.0 (+ (/ 1.0 t) -1.0))) (+ (/ x y) (+ (/ 2.0 (* z t)) -2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.55e+57) || !(z <= 0.52)) {
tmp = (x / y) + (2.0 * ((1.0 / t) + -1.0));
} else {
tmp = (x / y) + ((2.0 / (z * t)) + -2.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.55d+57)) .or. (.not. (z <= 0.52d0))) then
tmp = (x / y) + (2.0d0 * ((1.0d0 / t) + (-1.0d0)))
else
tmp = (x / y) + ((2.0d0 / (z * t)) + (-2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.55e+57) || !(z <= 0.52)) {
tmp = (x / y) + (2.0 * ((1.0 / t) + -1.0));
} else {
tmp = (x / y) + ((2.0 / (z * t)) + -2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.55e+57) or not (z <= 0.52): tmp = (x / y) + (2.0 * ((1.0 / t) + -1.0)) else: tmp = (x / y) + ((2.0 / (z * t)) + -2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.55e+57) || !(z <= 0.52)) tmp = Float64(Float64(x / y) + Float64(2.0 * Float64(Float64(1.0 / t) + -1.0))); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / Float64(z * t)) + -2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.55e+57) || ~((z <= 0.52))) tmp = (x / y) + (2.0 * ((1.0 / t) + -1.0)); else tmp = (x / y) + ((2.0 / (z * t)) + -2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.55e+57], N[Not[LessEqual[z, 0.52]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 * N[(N[(1.0 / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+57} \lor \neg \left(z \leq 0.52\right):\\
\;\;\;\;\frac{x}{y} + 2 \cdot \left(\frac{1}{t} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{z \cdot t} + -2\right)\\
\end{array}
\end{array}
if z < -1.55000000000000007e57 or 0.52000000000000002 < z Initial program 76.8%
Taylor expanded in z around inf 99.2%
div-sub99.2%
sub-neg99.2%
*-inverses99.2%
metadata-eval99.2%
Simplified99.2%
if -1.55000000000000007e57 < z < 0.52000000000000002Initial program 97.2%
Taylor expanded in t around 0 91.7%
associate-+r+91.7%
associate-*r/91.7%
metadata-eval91.7%
sub-neg91.7%
metadata-eval91.7%
Simplified91.7%
Taylor expanded in z around 0 90.6%
Taylor expanded in z around inf 96.7%
+-commutative96.7%
associate--l+96.7%
sub-neg96.7%
associate-*r/96.7%
metadata-eval96.7%
metadata-eval96.7%
Simplified96.7%
Final simplification97.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.3e-9) (not (<= z 8e-5))) (+ (/ x y) (* 2.0 (+ (/ 1.0 t) -1.0))) (+ (/ x y) (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.3e-9) || !(z <= 8e-5)) {
tmp = (x / y) + (2.0 * ((1.0 / t) + -1.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 <= (-1.3d-9)) .or. (.not. (z <= 8d-5))) then
tmp = (x / y) + (2.0d0 * ((1.0d0 / t) + (-1.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 <= -1.3e-9) || !(z <= 8e-5)) {
tmp = (x / y) + (2.0 * ((1.0 / t) + -1.0));
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.3e-9) or not (z <= 8e-5): tmp = (x / y) + (2.0 * ((1.0 / t) + -1.0)) else: tmp = (x / y) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.3e-9) || !(z <= 8e-5)) tmp = Float64(Float64(x / y) + Float64(2.0 * Float64(Float64(1.0 / t) + -1.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 <= -1.3e-9) || ~((z <= 8e-5))) tmp = (x / y) + (2.0 * ((1.0 / t) + -1.0)); else tmp = (x / y) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.3e-9], N[Not[LessEqual[z, 8e-5]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 * N[(N[(1.0 / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{-9} \lor \neg \left(z \leq 8 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{x}{y} + 2 \cdot \left(\frac{1}{t} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if z < -1.3000000000000001e-9 or 8.00000000000000065e-5 < z Initial program 77.6%
Taylor expanded in z around inf 98.4%
div-sub98.4%
sub-neg98.4%
*-inverses98.4%
metadata-eval98.4%
Simplified98.4%
if -1.3000000000000001e-9 < z < 8.00000000000000065e-5Initial program 97.7%
Taylor expanded in z around 0 83.0%
associate-/r*83.0%
Simplified83.0%
Final simplification89.8%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1.5e+147) (not (<= (/ x y) 2e+25))) (+ (/ x y) (/ 2.0 t)) (+ -2.0 (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.5e+147) || !((x / y) <= 2e+25)) {
tmp = (x / y) + (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 (((x / y) <= (-1.5d+147)) .or. (.not. ((x / y) <= 2d+25))) then
tmp = (x / y) + (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 (((x / y) <= -1.5e+147) || !((x / y) <= 2e+25)) {
tmp = (x / y) + (2.0 / t);
} else {
tmp = -2.0 + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1.5e+147) or not ((x / y) <= 2e+25): tmp = (x / y) + (2.0 / t) else: tmp = -2.0 + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1.5e+147) || !(Float64(x / y) <= 2e+25)) tmp = Float64(Float64(x / y) + 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 (((x / y) <= -1.5e+147) || ~(((x / y) <= 2e+25))) tmp = (x / y) + (2.0 / t); 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], -1.5e+147], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2e+25]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $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 -1.5 \cdot 10^{+147} \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{+25}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.49999999999999997e147 or 2.00000000000000018e25 < (/.f64 x y) Initial program 89.8%
Taylor expanded in t around 0 96.8%
Taylor expanded in z around inf 79.4%
associate-*r/79.4%
metadata-eval79.4%
+-commutative79.4%
Simplified79.4%
if -1.49999999999999997e147 < (/.f64 x y) < 2.00000000000000018e25Initial program 88.3%
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%
Taylor expanded in z around 0 79.8%
Taylor expanded in z around inf 81.1%
+-commutative81.1%
associate--l+81.1%
sub-neg81.1%
associate-*r/81.1%
metadata-eval81.1%
metadata-eval81.1%
Simplified81.1%
Taylor expanded in x around 0 75.6%
sub-neg75.6%
associate-*r/75.6%
metadata-eval75.6%
associate-/l/75.5%
metadata-eval75.5%
+-commutative75.5%
associate-/l/75.6%
associate-/r*75.6%
Simplified75.6%
Final simplification77.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1.5e+147) (not (<= (/ x y) 2e+25))) (/ x y) (+ -2.0 (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.5e+147) || !((x / y) <= 2e+25)) {
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) <= (-1.5d+147)) .or. (.not. ((x / y) <= 2d+25))) 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) <= -1.5e+147) || !((x / y) <= 2e+25)) {
tmp = x / y;
} else {
tmp = -2.0 + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1.5e+147) or not ((x / y) <= 2e+25): 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) <= -1.5e+147) || !(Float64(x / y) <= 2e+25)) 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) <= -1.5e+147) || ~(((x / y) <= 2e+25))) 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], -1.5e+147], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2e+25]], $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 -1.5 \cdot 10^{+147} \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{+25}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.49999999999999997e147 or 2.00000000000000018e25 < (/.f64 x y) Initial program 89.8%
Taylor expanded in x around inf 72.6%
if -1.49999999999999997e147 < (/.f64 x y) < 2.00000000000000018e25Initial program 88.3%
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%
Taylor expanded in z around 0 79.8%
Taylor expanded in z around inf 81.1%
+-commutative81.1%
associate--l+81.1%
sub-neg81.1%
associate-*r/81.1%
metadata-eval81.1%
metadata-eval81.1%
Simplified81.1%
Taylor expanded in x around 0 75.6%
sub-neg75.6%
associate-*r/75.6%
metadata-eval75.6%
associate-/l/75.5%
metadata-eval75.5%
+-commutative75.5%
associate-/l/75.6%
associate-/r*75.6%
Simplified75.6%
Final simplification74.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.8e+32) (not (<= t 3.4e-64))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.8e+32) || !(t <= 3.4e-64)) {
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 <= (-4.8d+32)) .or. (.not. (t <= 3.4d-64))) 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 <= -4.8e+32) || !(t <= 3.4e-64)) {
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 <= -4.8e+32) or not (t <= 3.4e-64): 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 <= -4.8e+32) || !(t <= 3.4e-64)) 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 <= -4.8e+32) || ~((t <= 3.4e-64))) 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, -4.8e+32], N[Not[LessEqual[t, 3.4e-64]], $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 -4.8 \cdot 10^{+32} \lor \neg \left(t \leq 3.4 \cdot 10^{-64}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -4.79999999999999983e32 or 3.40000000000000012e-64 < t Initial program 81.0%
Taylor expanded in t around inf 82.0%
if -4.79999999999999983e32 < t < 3.40000000000000012e-64Initial program 97.3%
Taylor expanded in t around 0 78.7%
associate-*r/78.7%
metadata-eval78.7%
Simplified78.7%
Final simplification80.4%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1e+14) (not (<= (/ x y) 2e+25))) (/ x y) (/ 2.0 t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e+14) || !((x / y) <= 2e+25)) {
tmp = x / y;
} else {
tmp = 2.0 / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-1d+14)) .or. (.not. ((x / y) <= 2d+25))) then
tmp = x / y
else
tmp = 2.0d0 / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e+14) || !((x / y) <= 2e+25)) {
tmp = x / y;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1e+14) or not ((x / y) <= 2e+25): tmp = x / y else: tmp = 2.0 / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1e+14) || !(Float64(x / y) <= 2e+25)) tmp = Float64(x / y); else tmp = Float64(2.0 / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1e+14) || ~(((x / y) <= 2e+25))) tmp = x / y; else tmp = 2.0 / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1e+14], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2e+25]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(2.0 / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+14} \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{+25}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1e14 or 2.00000000000000018e25 < (/.f64 x y) Initial program 90.8%
Taylor expanded in x around inf 65.5%
if -1e14 < (/.f64 x y) < 2.00000000000000018e25Initial program 87.2%
Taylor expanded in t around 0 60.6%
associate-*r/60.6%
metadata-eval60.6%
Simplified60.6%
Taylor expanded in z around inf 22.1%
Final simplification42.8%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.8e+32) (not (<= t 3.3e-64))) (- (/ x y) 2.0) (/ (/ 2.0 t) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.8e+32) || !(t <= 3.3e-64)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 / t) / z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-4.8d+32)) .or. (.not. (t <= 3.3d-64))) then
tmp = (x / y) - 2.0d0
else
tmp = (2.0d0 / t) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.8e+32) || !(t <= 3.3e-64)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 / t) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4.8e+32) or not (t <= 3.3e-64): tmp = (x / y) - 2.0 else: tmp = (2.0 / t) / z return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4.8e+32) || !(t <= 3.3e-64)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(Float64(2.0 / t) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -4.8e+32) || ~((t <= 3.3e-64))) tmp = (x / y) - 2.0; else tmp = (2.0 / t) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.8e+32], N[Not[LessEqual[t, 3.3e-64]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+32} \lor \neg \left(t \leq 3.3 \cdot 10^{-64}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if t < -4.79999999999999983e32 or 3.2999999999999999e-64 < t Initial program 81.0%
Taylor expanded in t around inf 82.0%
if -4.79999999999999983e32 < t < 3.2999999999999999e-64Initial program 97.3%
Taylor expanded in t around 0 98.2%
associate-+r+98.2%
associate-*r/98.2%
metadata-eval98.2%
sub-neg98.2%
metadata-eval98.2%
Simplified98.2%
Taylor expanded in z around 0 52.2%
associate-/r*52.2%
Simplified52.2%
Final simplification67.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.2e+36) (not (<= t 2.85e-64))) (- (/ x y) 2.0) (/ 2.0 (* z t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.2e+36) || !(t <= 2.85e-64)) {
tmp = (x / y) - 2.0;
} 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) :: tmp
if ((t <= (-1.2d+36)) .or. (.not. (t <= 2.85d-64))) then
tmp = (x / y) - 2.0d0
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 tmp;
if ((t <= -1.2e+36) || !(t <= 2.85e-64)) {
tmp = (x / y) - 2.0;
} else {
tmp = 2.0 / (z * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.2e+36) or not (t <= 2.85e-64): tmp = (x / y) - 2.0 else: tmp = 2.0 / (z * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.2e+36) || !(t <= 2.85e-64)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(2.0 / Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.2e+36) || ~((t <= 2.85e-64))) tmp = (x / y) - 2.0; else tmp = 2.0 / (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.2e+36], N[Not[LessEqual[t, 2.85e-64]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+36} \lor \neg \left(t \leq 2.85 \cdot 10^{-64}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\end{array}
\end{array}
if t < -1.19999999999999996e36 or 2.8500000000000001e-64 < t Initial program 81.0%
Taylor expanded in t around inf 82.0%
if -1.19999999999999996e36 < t < 2.8500000000000001e-64Initial program 97.3%
Taylor expanded in t around 0 98.2%
associate-+r+98.2%
associate-*r/98.2%
metadata-eval98.2%
sub-neg98.2%
metadata-eval98.2%
Simplified98.2%
Taylor expanded in z around 0 52.2%
Final simplification67.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -5.5e-199) (not (<= t 2.6e-64))) (- (/ x y) 2.0) (/ 2.0 t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.5e-199) || !(t <= 2.6e-64)) {
tmp = (x / y) - 2.0;
} else {
tmp = 2.0 / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-5.5d-199)) .or. (.not. (t <= 2.6d-64))) then
tmp = (x / y) - 2.0d0
else
tmp = 2.0d0 / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.5e-199) || !(t <= 2.6e-64)) {
tmp = (x / y) - 2.0;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -5.5e-199) or not (t <= 2.6e-64): tmp = (x / y) - 2.0 else: tmp = 2.0 / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -5.5e-199) || !(t <= 2.6e-64)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(2.0 / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -5.5e-199) || ~((t <= 2.6e-64))) tmp = (x / y) - 2.0; else tmp = 2.0 / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -5.5e-199], N[Not[LessEqual[t, 2.6e-64]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(2.0 / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{-199} \lor \neg \left(t \leq 2.6 \cdot 10^{-64}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if t < -5.5000000000000001e-199 or 2.6e-64 < t Initial program 86.1%
Taylor expanded in t around inf 66.5%
if -5.5000000000000001e-199 < t < 2.6e-64Initial program 96.9%
Taylor expanded in t around 0 86.8%
associate-*r/86.8%
metadata-eval86.8%
Simplified86.8%
Taylor expanded in z around inf 31.5%
Final simplification57.3%
(FPCore (x y z t) :precision binary64 (/ 2.0 t))
double code(double x, double y, double z, double t) {
return 2.0 / t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 2.0d0 / t
end function
public static double code(double x, double y, double z, double t) {
return 2.0 / t;
}
def code(x, y, z, t): return 2.0 / t
function code(x, y, z, t) return Float64(2.0 / t) end
function tmp = code(x, y, z, t) tmp = 2.0 / t; end
code[x_, y_, z_, t_] := N[(2.0 / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{t}
\end{array}
Initial program 88.9%
Taylor expanded in t around 0 48.0%
associate-*r/48.0%
metadata-eval48.0%
Simplified48.0%
Taylor expanded in z around inf 15.4%
(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 2024137
(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))))