
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ a 1.0) (/ (* y b) t))) (t_2 (/ (+ x (/ (* y z) t)) t_1)))
(if (<= t_2 1e-298)
(/ (+ x (/ y (/ t z))) (+ (+ a 1.0) (* y (/ b t))))
(if (<= t_2 2e+288)
t_2
(if (<= t_2 INFINITY) (* y (/ z (* t t_1))) (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + 1.0) + ((y * b) / t);
double t_2 = (x + ((y * z) / t)) / t_1;
double tmp;
if (t_2 <= 1e-298) {
tmp = (x + (y / (t / z))) / ((a + 1.0) + (y * (b / t)));
} else if (t_2 <= 2e+288) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = y * (z / (t * t_1));
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + 1.0) + ((y * b) / t);
double t_2 = (x + ((y * z) / t)) / t_1;
double tmp;
if (t_2 <= 1e-298) {
tmp = (x + (y / (t / z))) / ((a + 1.0) + (y * (b / t)));
} else if (t_2 <= 2e+288) {
tmp = t_2;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = y * (z / (t * t_1));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + 1.0) + ((y * b) / t) t_2 = (x + ((y * z) / t)) / t_1 tmp = 0 if t_2 <= 1e-298: tmp = (x + (y / (t / z))) / ((a + 1.0) + (y * (b / t))) elif t_2 <= 2e+288: tmp = t_2 elif t_2 <= math.inf: tmp = y * (z / (t * t_1)) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t)) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / t_1) tmp = 0.0 if (t_2 <= 1e-298) tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); elseif (t_2 <= 2e+288) tmp = t_2; elseif (t_2 <= Inf) tmp = Float64(y * Float64(z / Float64(t * t_1))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + 1.0) + ((y * b) / t); t_2 = (x + ((y * z) / t)) / t_1; tmp = 0.0; if (t_2 <= 1e-298) tmp = (x + (y / (t / z))) / ((a + 1.0) + (y * (b / t))); elseif (t_2 <= 2e+288) tmp = t_2; elseif (t_2 <= Inf) tmp = y * (z / (t * t_1)); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, 1e-298], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+288], t$95$2, If[LessEqual[t$95$2, Infinity], N[(y * N[(z / N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + 1\right) + \frac{y \cdot b}{t}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{t\_1}\\
\mathbf{if}\;t\_2 \leq 10^{-298}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+288}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;y \cdot \frac{z}{t \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 9.99999999999999912e-299Initial program 77.6%
associate-/l*81.5%
associate-/l*85.4%
Simplified85.4%
clear-num85.3%
un-div-inv86.0%
Applied egg-rr86.0%
if 9.99999999999999912e-299 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2e288Initial program 99.7%
if 2e288 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 45.5%
associate-/l*59.0%
associate-/l*58.8%
Simplified58.8%
Taylor expanded in x around 0 72.3%
associate-/l*91.0%
associate-+r+91.0%
*-commutative91.0%
Simplified91.0%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 0.0%
associate-/l*0.5%
associate-/l*14.7%
Simplified14.7%
Taylor expanded in y around inf 96.8%
Final simplification92.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (/ b t))) (t_2 (/ (+ x (/ y (/ t z))) (+ a t_1))))
(if (<= a -520000.0)
t_2
(if (<= a -1.85e-34)
(/ (* x (+ (/ t y) (/ z x))) b)
(if (<= a 1.05e-43) (/ (+ x (* y (/ z t))) (+ 1.0 t_1)) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b / t);
double t_2 = (x + (y / (t / z))) / (a + t_1);
double tmp;
if (a <= -520000.0) {
tmp = t_2;
} else if (a <= -1.85e-34) {
tmp = (x * ((t / y) + (z / x))) / b;
} else if (a <= 1.05e-43) {
tmp = (x + (y * (z / t))) / (1.0 + t_1);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y * (b / t)
t_2 = (x + (y / (t / z))) / (a + t_1)
if (a <= (-520000.0d0)) then
tmp = t_2
else if (a <= (-1.85d-34)) then
tmp = (x * ((t / y) + (z / x))) / b
else if (a <= 1.05d-43) then
tmp = (x + (y * (z / t))) / (1.0d0 + t_1)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b / t);
double t_2 = (x + (y / (t / z))) / (a + t_1);
double tmp;
if (a <= -520000.0) {
tmp = t_2;
} else if (a <= -1.85e-34) {
tmp = (x * ((t / y) + (z / x))) / b;
} else if (a <= 1.05e-43) {
tmp = (x + (y * (z / t))) / (1.0 + t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * (b / t) t_2 = (x + (y / (t / z))) / (a + t_1) tmp = 0 if a <= -520000.0: tmp = t_2 elif a <= -1.85e-34: tmp = (x * ((t / y) + (z / x))) / b elif a <= 1.05e-43: tmp = (x + (y * (z / t))) / (1.0 + t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(b / t)) t_2 = Float64(Float64(x + Float64(y / Float64(t / z))) / Float64(a + t_1)) tmp = 0.0 if (a <= -520000.0) tmp = t_2; elseif (a <= -1.85e-34) tmp = Float64(Float64(x * Float64(Float64(t / y) + Float64(z / x))) / b); elseif (a <= 1.05e-43) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(1.0 + t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y * (b / t); t_2 = (x + (y / (t / z))) / (a + t_1); tmp = 0.0; if (a <= -520000.0) tmp = t_2; elseif (a <= -1.85e-34) tmp = (x * ((t / y) + (z / x))) / b; elseif (a <= 1.05e-43) tmp = (x + (y * (z / t))) / (1.0 + t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -520000.0], t$95$2, If[LessEqual[a, -1.85e-34], N[(N[(x * N[(N[(t / y), $MachinePrecision] + N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[a, 1.05e-43], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{b}{t}\\
t_2 := \frac{x + \frac{y}{\frac{t}{z}}}{a + t\_1}\\
\mathbf{if}\;a \leq -520000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -1.85 \cdot 10^{-34}:\\
\;\;\;\;\frac{x \cdot \left(\frac{t}{y} + \frac{z}{x}\right)}{b}\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{-43}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{1 + t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -5.2e5 or 1.05e-43 < a Initial program 77.7%
associate-/l*77.7%
associate-/l*80.5%
Simplified80.5%
clear-num80.5%
un-div-inv81.2%
Applied egg-rr81.2%
Taylor expanded in a around inf 80.2%
if -5.2e5 < a < -1.84999999999999994e-34Initial program 54.7%
associate-/l*54.8%
associate-/l*46.3%
Simplified46.3%
Taylor expanded in x around inf 64.5%
associate-+r+64.5%
*-commutative64.5%
*-commutative64.5%
associate-+r+64.5%
*-commutative64.5%
Simplified64.5%
Taylor expanded in b around inf 90.9%
if -1.84999999999999994e-34 < a < 1.05e-43Initial program 71.3%
associate-/l*75.8%
associate-/l*78.5%
Simplified78.5%
Taylor expanded in a around 0 78.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (/ b t))) (t_2 (+ x (* y (/ z t)))) (t_3 (/ t_2 (+ a t_1))))
(if (<= a -45000.0)
t_3
(if (<= a -1.85e-34)
(/ (* x (+ (/ t y) (/ z x))) b)
(if (<= a 1.05e-43) (/ t_2 (+ 1.0 t_1)) t_3)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b / t);
double t_2 = x + (y * (z / t));
double t_3 = t_2 / (a + t_1);
double tmp;
if (a <= -45000.0) {
tmp = t_3;
} else if (a <= -1.85e-34) {
tmp = (x * ((t / y) + (z / x))) / b;
} else if (a <= 1.05e-43) {
tmp = t_2 / (1.0 + t_1);
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = y * (b / t)
t_2 = x + (y * (z / t))
t_3 = t_2 / (a + t_1)
if (a <= (-45000.0d0)) then
tmp = t_3
else if (a <= (-1.85d-34)) then
tmp = (x * ((t / y) + (z / x))) / b
else if (a <= 1.05d-43) then
tmp = t_2 / (1.0d0 + t_1)
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b / t);
double t_2 = x + (y * (z / t));
double t_3 = t_2 / (a + t_1);
double tmp;
if (a <= -45000.0) {
tmp = t_3;
} else if (a <= -1.85e-34) {
tmp = (x * ((t / y) + (z / x))) / b;
} else if (a <= 1.05e-43) {
tmp = t_2 / (1.0 + t_1);
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * (b / t) t_2 = x + (y * (z / t)) t_3 = t_2 / (a + t_1) tmp = 0 if a <= -45000.0: tmp = t_3 elif a <= -1.85e-34: tmp = (x * ((t / y) + (z / x))) / b elif a <= 1.05e-43: tmp = t_2 / (1.0 + t_1) else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(b / t)) t_2 = Float64(x + Float64(y * Float64(z / t))) t_3 = Float64(t_2 / Float64(a + t_1)) tmp = 0.0 if (a <= -45000.0) tmp = t_3; elseif (a <= -1.85e-34) tmp = Float64(Float64(x * Float64(Float64(t / y) + Float64(z / x))) / b); elseif (a <= 1.05e-43) tmp = Float64(t_2 / Float64(1.0 + t_1)); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y * (b / t); t_2 = x + (y * (z / t)); t_3 = t_2 / (a + t_1); tmp = 0.0; if (a <= -45000.0) tmp = t_3; elseif (a <= -1.85e-34) tmp = (x * ((t / y) + (z / x))) / b; elseif (a <= 1.05e-43) tmp = t_2 / (1.0 + t_1); else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -45000.0], t$95$3, If[LessEqual[a, -1.85e-34], N[(N[(x * N[(N[(t / y), $MachinePrecision] + N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[a, 1.05e-43], N[(t$95$2 / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{b}{t}\\
t_2 := x + y \cdot \frac{z}{t}\\
t_3 := \frac{t\_2}{a + t\_1}\\
\mathbf{if}\;a \leq -45000:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \leq -1.85 \cdot 10^{-34}:\\
\;\;\;\;\frac{x \cdot \left(\frac{t}{y} + \frac{z}{x}\right)}{b}\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{-43}:\\
\;\;\;\;\frac{t\_2}{1 + t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if a < -45000 or 1.05e-43 < a Initial program 77.7%
associate-/l*77.7%
associate-/l*80.5%
Simplified80.5%
Taylor expanded in a around inf 79.6%
if -45000 < a < -1.84999999999999994e-34Initial program 54.7%
associate-/l*54.8%
associate-/l*46.3%
Simplified46.3%
Taylor expanded in x around inf 64.5%
associate-+r+64.5%
*-commutative64.5%
*-commutative64.5%
associate-+r+64.5%
*-commutative64.5%
Simplified64.5%
Taylor expanded in b around inf 90.9%
if -1.84999999999999994e-34 < a < 1.05e-43Initial program 71.3%
associate-/l*75.8%
associate-/l*78.5%
Simplified78.5%
Taylor expanded in a around 0 78.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (* z (/ y t))) (+ a 1.0))))
(if (<= a -2.7e+14)
t_1
(if (<= a -1.85e-34)
(/ (* x (+ (/ t y) (/ z x))) b)
(if (<= a 5.4e+26)
(/ (+ x (* y (/ z t))) (+ 1.0 (* y (/ b t))))
t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (z * (y / t))) / (a + 1.0);
double tmp;
if (a <= -2.7e+14) {
tmp = t_1;
} else if (a <= -1.85e-34) {
tmp = (x * ((t / y) + (z / x))) / b;
} else if (a <= 5.4e+26) {
tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (z * (y / t))) / (a + 1.0d0)
if (a <= (-2.7d+14)) then
tmp = t_1
else if (a <= (-1.85d-34)) then
tmp = (x * ((t / y) + (z / x))) / b
else if (a <= 5.4d+26) then
tmp = (x + (y * (z / t))) / (1.0d0 + (y * (b / t)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (z * (y / t))) / (a + 1.0);
double tmp;
if (a <= -2.7e+14) {
tmp = t_1;
} else if (a <= -1.85e-34) {
tmp = (x * ((t / y) + (z / x))) / b;
} else if (a <= 5.4e+26) {
tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + (z * (y / t))) / (a + 1.0) tmp = 0 if a <= -2.7e+14: tmp = t_1 elif a <= -1.85e-34: tmp = (x * ((t / y) + (z / x))) / b elif a <= 5.4e+26: tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + 1.0)) tmp = 0.0 if (a <= -2.7e+14) tmp = t_1; elseif (a <= -1.85e-34) tmp = Float64(Float64(x * Float64(Float64(t / y) + Float64(z / x))) / b); elseif (a <= 5.4e+26) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(1.0 + Float64(y * Float64(b / t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + (z * (y / t))) / (a + 1.0); tmp = 0.0; if (a <= -2.7e+14) tmp = t_1; elseif (a <= -1.85e-34) tmp = (x * ((t / y) + (z / x))) / b; elseif (a <= 5.4e+26) tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.7e+14], t$95$1, If[LessEqual[a, -1.85e-34], N[(N[(x * N[(N[(t / y), $MachinePrecision] + N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[a, 5.4e+26], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + z \cdot \frac{y}{t}}{a + 1}\\
\mathbf{if}\;a \leq -2.7 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.85 \cdot 10^{-34}:\\
\;\;\;\;\frac{x \cdot \left(\frac{t}{y} + \frac{z}{x}\right)}{b}\\
\mathbf{elif}\;a \leq 5.4 \cdot 10^{+26}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{1 + y \cdot \frac{b}{t}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.7e14 or 5.4e26 < a Initial program 78.7%
associate-/l*78.7%
associate-/l*80.2%
Simplified80.2%
Taylor expanded in b around 0 69.4%
*-commutative69.4%
associate-/l*72.7%
Applied egg-rr72.7%
if -2.7e14 < a < -1.84999999999999994e-34Initial program 64.4%
associate-/l*64.4%
associate-/l*57.8%
Simplified57.8%
Taylor expanded in x around inf 71.8%
associate-+r+71.8%
*-commutative71.8%
*-commutative71.8%
associate-+r+71.8%
*-commutative71.8%
Simplified71.8%
Taylor expanded in b around inf 86.5%
if -1.84999999999999994e-34 < a < 5.4e26Initial program 70.2%
associate-/l*74.3%
associate-/l*78.5%
Simplified78.5%
Taylor expanded in a around 0 77.5%
Final simplification75.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (* y (/ z t))) a)))
(if (<= a -68000000000000.0)
t_1
(if (<= a -8e-71)
(/ z b)
(if (<= a 4.2e-209)
(+ x (/ (* y z) t))
(if (<= a 5.2e+32) (/ z b) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (y * (z / t))) / a;
double tmp;
if (a <= -68000000000000.0) {
tmp = t_1;
} else if (a <= -8e-71) {
tmp = z / b;
} else if (a <= 4.2e-209) {
tmp = x + ((y * z) / t);
} else if (a <= 5.2e+32) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (y * (z / t))) / a
if (a <= (-68000000000000.0d0)) then
tmp = t_1
else if (a <= (-8d-71)) then
tmp = z / b
else if (a <= 4.2d-209) then
tmp = x + ((y * z) / t)
else if (a <= 5.2d+32) then
tmp = z / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (y * (z / t))) / a;
double tmp;
if (a <= -68000000000000.0) {
tmp = t_1;
} else if (a <= -8e-71) {
tmp = z / b;
} else if (a <= 4.2e-209) {
tmp = x + ((y * z) / t);
} else if (a <= 5.2e+32) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + (y * (z / t))) / a tmp = 0 if a <= -68000000000000.0: tmp = t_1 elif a <= -8e-71: tmp = z / b elif a <= 4.2e-209: tmp = x + ((y * z) / t) elif a <= 5.2e+32: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(y * Float64(z / t))) / a) tmp = 0.0 if (a <= -68000000000000.0) tmp = t_1; elseif (a <= -8e-71) tmp = Float64(z / b); elseif (a <= 4.2e-209) tmp = Float64(x + Float64(Float64(y * z) / t)); elseif (a <= 5.2e+32) tmp = Float64(z / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + (y * (z / t))) / a; tmp = 0.0; if (a <= -68000000000000.0) tmp = t_1; elseif (a <= -8e-71) tmp = z / b; elseif (a <= 4.2e-209) tmp = x + ((y * z) / t); elseif (a <= 5.2e+32) tmp = z / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[a, -68000000000000.0], t$95$1, If[LessEqual[a, -8e-71], N[(z / b), $MachinePrecision], If[LessEqual[a, 4.2e-209], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.2e+32], N[(z / b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + y \cdot \frac{z}{t}}{a}\\
\mathbf{if}\;a \leq -68000000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -8 \cdot 10^{-71}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{-209}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{+32}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -6.8e13 or 5.2000000000000004e32 < a Initial program 78.7%
associate-/l*78.7%
associate-/l*80.2%
Simplified80.2%
clear-num80.2%
un-div-inv80.9%
Applied egg-rr80.9%
Taylor expanded in a around inf 80.8%
Taylor expanded in a around inf 69.4%
associate-/l*70.4%
Simplified70.4%
if -6.8e13 < a < -7.9999999999999993e-71 or 4.19999999999999991e-209 < a < 5.2000000000000004e32Initial program 63.0%
associate-/l*64.6%
associate-/l*69.1%
Simplified69.1%
Taylor expanded in y around inf 66.9%
if -7.9999999999999993e-71 < a < 4.19999999999999991e-209Initial program 76.0%
associate-/l*81.7%
associate-/l*83.3%
Simplified83.3%
Taylor expanded in b around 0 54.9%
Taylor expanded in a around 0 54.9%
Final simplification65.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (* y (/ z t))) a)))
(if (<= a -4.9e+14)
t_1
(if (<= a -2.35e-189)
(/ z b)
(if (<= a 3.7e-188)
(/ x (+ 1.0 (/ y (/ t b))))
(if (<= a 1.05e+28) (/ z b) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (y * (z / t))) / a;
double tmp;
if (a <= -4.9e+14) {
tmp = t_1;
} else if (a <= -2.35e-189) {
tmp = z / b;
} else if (a <= 3.7e-188) {
tmp = x / (1.0 + (y / (t / b)));
} else if (a <= 1.05e+28) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (y * (z / t))) / a
if (a <= (-4.9d+14)) then
tmp = t_1
else if (a <= (-2.35d-189)) then
tmp = z / b
else if (a <= 3.7d-188) then
tmp = x / (1.0d0 + (y / (t / b)))
else if (a <= 1.05d+28) then
tmp = z / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (y * (z / t))) / a;
double tmp;
if (a <= -4.9e+14) {
tmp = t_1;
} else if (a <= -2.35e-189) {
tmp = z / b;
} else if (a <= 3.7e-188) {
tmp = x / (1.0 + (y / (t / b)));
} else if (a <= 1.05e+28) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + (y * (z / t))) / a tmp = 0 if a <= -4.9e+14: tmp = t_1 elif a <= -2.35e-189: tmp = z / b elif a <= 3.7e-188: tmp = x / (1.0 + (y / (t / b))) elif a <= 1.05e+28: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(y * Float64(z / t))) / a) tmp = 0.0 if (a <= -4.9e+14) tmp = t_1; elseif (a <= -2.35e-189) tmp = Float64(z / b); elseif (a <= 3.7e-188) tmp = Float64(x / Float64(1.0 + Float64(y / Float64(t / b)))); elseif (a <= 1.05e+28) tmp = Float64(z / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + (y * (z / t))) / a; tmp = 0.0; if (a <= -4.9e+14) tmp = t_1; elseif (a <= -2.35e-189) tmp = z / b; elseif (a <= 3.7e-188) tmp = x / (1.0 + (y / (t / b))); elseif (a <= 1.05e+28) tmp = z / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[a, -4.9e+14], t$95$1, If[LessEqual[a, -2.35e-189], N[(z / b), $MachinePrecision], If[LessEqual[a, 3.7e-188], N[(x / N[(1.0 + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.05e+28], N[(z / b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + y \cdot \frac{z}{t}}{a}\\
\mathbf{if}\;a \leq -4.9 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.35 \cdot 10^{-189}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq 3.7 \cdot 10^{-188}:\\
\;\;\;\;\frac{x}{1 + \frac{y}{\frac{t}{b}}}\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{+28}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.9e14 or 1.04999999999999995e28 < a Initial program 78.7%
associate-/l*78.7%
associate-/l*80.2%
Simplified80.2%
clear-num80.2%
un-div-inv80.9%
Applied egg-rr80.9%
Taylor expanded in a around inf 80.8%
Taylor expanded in a around inf 69.4%
associate-/l*70.4%
Simplified70.4%
if -4.9e14 < a < -2.3499999999999998e-189 or 3.69999999999999972e-188 < a < 1.04999999999999995e28Initial program 62.5%
associate-/l*65.9%
associate-/l*69.4%
Simplified69.4%
Taylor expanded in y around inf 60.8%
if -2.3499999999999998e-189 < a < 3.69999999999999972e-188Initial program 82.7%
associate-/l*86.9%
associate-/l*89.1%
Simplified89.1%
Taylor expanded in a around 0 89.1%
Taylor expanded in x around inf 59.4%
clear-num59.5%
un-div-inv59.5%
Applied egg-rr59.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -5.8e-205) (not (<= t 3.6e-145))) (/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t)))) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -5.8e-205) || !(t <= 3.6e-145)) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-5.8d-205)) .or. (.not. (t <= 3.6d-145))) then
tmp = (x + (y * (z / t))) / ((a + 1.0d0) + (y * (b / t)))
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -5.8e-205) || !(t <= 3.6e-145)) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -5.8e-205) or not (t <= 3.6e-145): tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -5.8e-205) || !(t <= 3.6e-145)) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -5.8e-205) || ~((t <= 3.6e-145))) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -5.8e-205], N[Not[LessEqual[t, 3.6e-145]], $MachinePrecision]], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{-205} \lor \neg \left(t \leq 3.6 \cdot 10^{-145}\right):\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -5.80000000000000036e-205 or 3.6e-145 < t Initial program 79.9%
associate-/l*83.6%
associate-/l*86.4%
Simplified86.4%
if -5.80000000000000036e-205 < t < 3.6e-145Initial program 49.5%
associate-/l*43.6%
associate-/l*43.4%
Simplified43.4%
Taylor expanded in y around inf 83.1%
Final simplification85.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ a 1.0) (* y (/ b t)))))
(if (<= t -4.4e-204)
(/ (+ x (* y (/ z t))) t_1)
(if (<= t 1.4e-158) (/ z b) (/ (+ x (/ y (/ t z))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + 1.0) + (y * (b / t));
double tmp;
if (t <= -4.4e-204) {
tmp = (x + (y * (z / t))) / t_1;
} else if (t <= 1.4e-158) {
tmp = z / b;
} else {
tmp = (x + (y / (t / z))) / t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (a + 1.0d0) + (y * (b / t))
if (t <= (-4.4d-204)) then
tmp = (x + (y * (z / t))) / t_1
else if (t <= 1.4d-158) then
tmp = z / b
else
tmp = (x + (y / (t / z))) / t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + 1.0) + (y * (b / t));
double tmp;
if (t <= -4.4e-204) {
tmp = (x + (y * (z / t))) / t_1;
} else if (t <= 1.4e-158) {
tmp = z / b;
} else {
tmp = (x + (y / (t / z))) / t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + 1.0) + (y * (b / t)) tmp = 0 if t <= -4.4e-204: tmp = (x + (y * (z / t))) / t_1 elif t <= 1.4e-158: tmp = z / b else: tmp = (x + (y / (t / z))) / t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + 1.0) + Float64(y * Float64(b / t))) tmp = 0.0 if (t <= -4.4e-204) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / t_1); elseif (t <= 1.4e-158) tmp = Float64(z / b); else tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + 1.0) + (y * (b / t)); tmp = 0.0; if (t <= -4.4e-204) tmp = (x + (y * (z / t))) / t_1; elseif (t <= 1.4e-158) tmp = z / b; else tmp = (x + (y / (t / z))) / t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.4e-204], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t, 1.4e-158], N[(z / b), $MachinePrecision], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + 1\right) + y \cdot \frac{b}{t}\\
\mathbf{if}\;t \leq -4.4 \cdot 10^{-204}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{t\_1}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-158}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{t\_1}\\
\end{array}
\end{array}
if t < -4.3999999999999997e-204Initial program 80.2%
associate-/l*82.7%
associate-/l*86.0%
Simplified86.0%
if -4.3999999999999997e-204 < t < 1.40000000000000001e-158Initial program 47.4%
associate-/l*43.3%
associate-/l*43.1%
Simplified43.1%
Taylor expanded in y around inf 84.5%
if 1.40000000000000001e-158 < t Initial program 79.9%
associate-/l*84.1%
associate-/l*86.2%
Simplified86.2%
clear-num86.2%
un-div-inv87.2%
Applied egg-rr87.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ (+ a 1.0) (* y (/ b t))))))
(if (<= t -4.8e-24)
t_1
(if (<= t -1.85e-65)
(* (/ z t) (/ y (+ a 1.0)))
(if (<= t 2.35e-144) (/ z b) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / ((a + 1.0) + (y * (b / t)));
double tmp;
if (t <= -4.8e-24) {
tmp = t_1;
} else if (t <= -1.85e-65) {
tmp = (z / t) * (y / (a + 1.0));
} else if (t <= 2.35e-144) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / ((a + 1.0d0) + (y * (b / t)))
if (t <= (-4.8d-24)) then
tmp = t_1
else if (t <= (-1.85d-65)) then
tmp = (z / t) * (y / (a + 1.0d0))
else if (t <= 2.35d-144) then
tmp = z / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / ((a + 1.0) + (y * (b / t)));
double tmp;
if (t <= -4.8e-24) {
tmp = t_1;
} else if (t <= -1.85e-65) {
tmp = (z / t) * (y / (a + 1.0));
} else if (t <= 2.35e-144) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / ((a + 1.0) + (y * (b / t))) tmp = 0 if t <= -4.8e-24: tmp = t_1 elif t <= -1.85e-65: tmp = (z / t) * (y / (a + 1.0)) elif t <= 2.35e-144: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))) tmp = 0.0 if (t <= -4.8e-24) tmp = t_1; elseif (t <= -1.85e-65) tmp = Float64(Float64(z / t) * Float64(y / Float64(a + 1.0))); elseif (t <= 2.35e-144) tmp = Float64(z / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / ((a + 1.0) + (y * (b / t))); tmp = 0.0; if (t <= -4.8e-24) tmp = t_1; elseif (t <= -1.85e-65) tmp = (z / t) * (y / (a + 1.0)); elseif (t <= 2.35e-144) tmp = z / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.8e-24], t$95$1, If[LessEqual[t, -1.85e-65], N[(N[(z / t), $MachinePrecision] * N[(y / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.35e-144], N[(z / b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.85 \cdot 10^{-65}:\\
\;\;\;\;\frac{z}{t} \cdot \frac{y}{a + 1}\\
\mathbf{elif}\;t \leq 2.35 \cdot 10^{-144}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.7999999999999996e-24 or 2.3500000000000001e-144 < t Initial program 80.5%
associate-/l*86.1%
associate-/l*91.7%
Simplified91.7%
Taylor expanded in x around inf 62.8%
if -4.7999999999999996e-24 < t < -1.85e-65Initial program 87.0%
associate-/l*87.2%
associate-/l*80.8%
Simplified80.8%
Taylor expanded in b around 0 86.9%
Taylor expanded in x around 0 80.4%
*-commutative80.4%
times-frac80.7%
+-commutative80.7%
Applied egg-rr80.7%
if -1.85e-65 < t < 2.3500000000000001e-144Initial program 60.2%
associate-/l*55.7%
associate-/l*53.4%
Simplified53.4%
Taylor expanded in y around inf 70.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.9e+108) (not (<= y 2.35e+24))) (/ (* x (+ (/ t y) (/ z x))) b) (/ (+ x (* z (/ y t))) (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.9e+108) || !(y <= 2.35e+24)) {
tmp = (x * ((t / y) + (z / x))) / b;
} else {
tmp = (x + (z * (y / t))) / (a + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.9d+108)) .or. (.not. (y <= 2.35d+24))) then
tmp = (x * ((t / y) + (z / x))) / b
else
tmp = (x + (z * (y / t))) / (a + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.9e+108) || !(y <= 2.35e+24)) {
tmp = (x * ((t / y) + (z / x))) / b;
} else {
tmp = (x + (z * (y / t))) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.9e+108) or not (y <= 2.35e+24): tmp = (x * ((t / y) + (z / x))) / b else: tmp = (x + (z * (y / t))) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.9e+108) || !(y <= 2.35e+24)) tmp = Float64(Float64(x * Float64(Float64(t / y) + Float64(z / x))) / b); else tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.9e+108) || ~((y <= 2.35e+24))) tmp = (x * ((t / y) + (z / x))) / b; else tmp = (x + (z * (y / t))) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.9e+108], N[Not[LessEqual[y, 2.35e+24]], $MachinePrecision]], N[(N[(x * N[(N[(t / y), $MachinePrecision] + N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+108} \lor \neg \left(y \leq 2.35 \cdot 10^{+24}\right):\\
\;\;\;\;\frac{x \cdot \left(\frac{t}{y} + \frac{z}{x}\right)}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\
\end{array}
\end{array}
if y < -1.90000000000000004e108 or 2.35e24 < y Initial program 52.5%
associate-/l*59.1%
associate-/l*65.7%
Simplified65.7%
Taylor expanded in x around inf 50.3%
associate-+r+50.3%
*-commutative50.3%
*-commutative50.3%
associate-+r+50.3%
*-commutative50.3%
Simplified50.3%
Taylor expanded in b around inf 65.0%
if -1.90000000000000004e108 < y < 2.35e24Initial program 92.3%
associate-/l*90.1%
associate-/l*88.8%
Simplified88.8%
Taylor expanded in b around 0 78.9%
*-commutative78.9%
associate-/l*79.3%
Applied egg-rr79.3%
Final simplification72.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -9e+104) (not (<= y 1.2e+18))) (/ z b) (/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -9e+104) || !(y <= 1.2e+18)) {
tmp = z / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-9d+104)) .or. (.not. (y <= 1.2d+18))) then
tmp = z / b
else
tmp = x / (a + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -9e+104) || !(y <= 1.2e+18)) {
tmp = z / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -9e+104) or not (y <= 1.2e+18): tmp = z / b else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -9e+104) || !(y <= 1.2e+18)) tmp = Float64(z / b); else tmp = Float64(x / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -9e+104) || ~((y <= 1.2e+18))) tmp = z / b; else tmp = x / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -9e+104], N[Not[LessEqual[y, 1.2e+18]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+104} \lor \neg \left(y \leq 1.2 \cdot 10^{+18}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -8.9999999999999997e104 or 1.2e18 < y Initial program 54.0%
associate-/l*60.3%
associate-/l*66.6%
Simplified66.6%
Taylor expanded in y around inf 60.1%
if -8.9999999999999997e104 < y < 1.2e18Initial program 92.6%
associate-/l*90.4%
associate-/l*89.0%
Simplified89.0%
Taylor expanded in y around 0 59.0%
Final simplification59.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.8e+49) (not (<= a 1.1e+52))) (/ x a) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.8e+49) || !(a <= 1.1e+52)) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-1.8d+49)) .or. (.not. (a <= 1.1d+52))) then
tmp = x / a
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.8e+49) || !(a <= 1.1e+52)) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.8e+49) or not (a <= 1.1e+52): tmp = x / a else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.8e+49) || !(a <= 1.1e+52)) tmp = Float64(x / a); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.8e+49) || ~((a <= 1.1e+52))) tmp = x / a; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.8e+49], N[Not[LessEqual[a, 1.1e+52]], $MachinePrecision]], N[(x / a), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{+49} \lor \neg \left(a \leq 1.1 \cdot 10^{+52}\right):\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if a < -1.79999999999999998e49 or 1.1e52 < a Initial program 80.3%
associate-/l*78.7%
associate-/l*79.5%
Simplified79.5%
Taylor expanded in x around inf 53.0%
Taylor expanded in a around inf 51.4%
if -1.79999999999999998e49 < a < 1.1e52Initial program 69.1%
associate-/l*73.8%
associate-/l*77.2%
Simplified77.2%
Taylor expanded in y around inf 51.3%
Final simplification51.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -200.0) (not (<= a 1.0))) (/ x a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -200.0) || !(a <= 1.0)) {
tmp = x / a;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-200.0d0)) .or. (.not. (a <= 1.0d0))) then
tmp = x / a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -200.0) || !(a <= 1.0)) {
tmp = x / a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -200.0) or not (a <= 1.0): tmp = x / a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -200.0) || !(a <= 1.0)) tmp = Float64(x / a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -200.0) || ~((a <= 1.0))) tmp = x / a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -200.0], N[Not[LessEqual[a, 1.0]], $MachinePrecision]], N[(x / a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -200 \lor \neg \left(a \leq 1\right):\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -200 or 1 < a Initial program 79.0%
associate-/l*79.0%
associate-/l*81.2%
Simplified81.2%
Taylor expanded in x around inf 51.0%
Taylor expanded in a around inf 45.7%
if -200 < a < 1Initial program 68.6%
associate-/l*72.5%
associate-/l*74.9%
Simplified74.9%
Taylor expanded in a around 0 74.6%
Taylor expanded in x around inf 42.4%
Taylor expanded in y around 0 28.9%
Final simplification37.7%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 74.1%
associate-/l*75.9%
associate-/l*78.2%
Simplified78.2%
Taylor expanded in a around 0 46.5%
Taylor expanded in x around inf 26.6%
Taylor expanded in y around 0 15.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))
(if (< t -1.3659085366310088e-271)
t_1
(if (< t 3.036967103737246e-130) (/ z b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))));
double tmp;
if (t < -1.3659085366310088e-271) {
tmp = t_1;
} else if (t < 3.036967103737246e-130) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 * ((x + ((y / t) * z)) * (1.0d0 / ((a + 1.0d0) + ((y / t) * b))))
if (t < (-1.3659085366310088d-271)) then
tmp = t_1
else if (t < 3.036967103737246d-130) then
tmp = z / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))));
double tmp;
if (t < -1.3659085366310088e-271) {
tmp = t_1;
} else if (t < 3.036967103737246e-130) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b)))) tmp = 0 if t < -1.3659085366310088e-271: tmp = t_1 elif t < 3.036967103737246e-130: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(1.0 * Float64(Float64(x + Float64(Float64(y / t) * z)) * Float64(1.0 / Float64(Float64(a + 1.0) + Float64(Float64(y / t) * b))))) tmp = 0.0 if (t < -1.3659085366310088e-271) tmp = t_1; elseif (t < 3.036967103737246e-130) tmp = Float64(z / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b)))); tmp = 0.0; if (t < -1.3659085366310088e-271) tmp = t_1; elseif (t < 3.036967103737246e-130) tmp = z / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 * N[(N[(x + N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y / t), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.3659085366310088e-271], t$95$1, If[Less[t, 3.036967103737246e-130], N[(z / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 \cdot \left(\left(x + \frac{y}{t} \cdot z\right) \cdot \frac{1}{\left(a + 1\right) + \frac{y}{t} \cdot b}\right)\\
\mathbf{if}\;t < -1.3659085366310088 \cdot 10^{-271}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < 3.036967103737246 \cdot 10^{-130}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024114
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:alt
(! :herbie-platform default (if (< t -1707385670788761/12500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))) (if (< t 1518483551868623/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ z b) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))))))
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))