
(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 16 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 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_1 (- INFINITY))
(/ z (* (fma y (/ b t) (+ a 1.0)) (/ t y)))
(if (<= t_1 -2e-193)
t_1
(if (<= t_1 1e-235)
(/ (fma y (/ z t) x) (fma b (/ y t) (+ a 1.0)))
(if (<= t_1 2e+292) t_1 (/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = z / (fma(y, (b / t), (a + 1.0)) * (t / y));
} else if (t_1 <= -2e-193) {
tmp = t_1;
} else if (t_1 <= 1e-235) {
tmp = fma(y, (z / t), x) / fma(b, (y / t), (a + 1.0));
} else if (t_1 <= 2e+292) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(z / Float64(fma(y, Float64(b / t), Float64(a + 1.0)) * Float64(t / y))); elseif (t_1 <= -2e-193) tmp = t_1; elseif (t_1 <= 1e-235) tmp = Float64(fma(y, Float64(z / t), x) / fma(b, Float64(y / t), Float64(a + 1.0))); elseif (t_1 <= 2e+292) tmp = t_1; else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, (-Infinity)], N[(z / N[(N[(y * N[(b / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision] * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-193], t$95$1, If[LessEqual[t$95$1, 1e-235], N[(N[(y * N[(z / t), $MachinePrecision] + x), $MachinePrecision] / N[(b * N[(y / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+292], t$95$1, N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{z}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right) \cdot \frac{t}{y}}\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-193}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 10^{-235}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(b, \frac{y}{t}, a + 1\right)}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+292}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 17.3%
*-commutative17.3%
associate-*l/58.6%
*-commutative58.6%
associate-*l/58.6%
Simplified58.6%
Taylor expanded in x around 0 52.2%
times-frac75.9%
associate-+r+75.9%
associate-/l*68.9%
+-commutative68.9%
associate-/l*75.9%
associate-*r/68.6%
fma-def68.6%
Simplified68.6%
clear-num68.9%
frac-times63.0%
*-un-lft-identity63.0%
+-commutative63.0%
Applied egg-rr63.0%
*-commutative63.0%
fma-def63.0%
*-commutative63.0%
associate-*l/74.9%
associate-*r/74.9%
+-commutative74.9%
fma-def74.9%
Simplified74.9%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -2.0000000000000001e-193 or 9.9999999999999996e-236 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2e292Initial program 99.7%
if -2.0000000000000001e-193 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 9.9999999999999996e-236Initial program 71.7%
+-commutative71.7%
associate-*r/74.9%
fma-def74.9%
+-commutative74.9%
associate-*l/82.8%
*-commutative82.8%
fma-def82.8%
Simplified82.8%
if 2e292 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 4.4%
*-commutative4.4%
associate-*l/13.8%
*-commutative13.8%
associate-*l/16.9%
Simplified16.9%
Taylor expanded in t around 0 84.9%
Final simplification92.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_1 (- INFINITY))
(/ z (* (fma y (/ b t) (+ a 1.0)) (/ t y)))
(if (<= t_1 -1e-161)
t_1
(if (<= t_1 1e-235)
(/ (+ x (/ y (/ t z))) (+ a (+ 1.0 (* b (/ y t)))))
(if (<= t_1 2e+292) t_1 (/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = z / (fma(y, (b / t), (a + 1.0)) * (t / y));
} else if (t_1 <= -1e-161) {
tmp = t_1;
} else if (t_1 <= 1e-235) {
tmp = (x + (y / (t / z))) / (a + (1.0 + (b * (y / t))));
} else if (t_1 <= 2e+292) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(z / Float64(fma(y, Float64(b / t), Float64(a + 1.0)) * Float64(t / y))); elseif (t_1 <= -1e-161) tmp = t_1; elseif (t_1 <= 1e-235) tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / Float64(a + Float64(1.0 + Float64(b * Float64(y / t))))); elseif (t_1 <= 2e+292) tmp = t_1; else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, (-Infinity)], N[(z / N[(N[(y * N[(b / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision] * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e-161], t$95$1, If[LessEqual[t$95$1, 1e-235], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+292], t$95$1, N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{z}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right) \cdot \frac{t}{y}}\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-161}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 10^{-235}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a + \left(1 + b \cdot \frac{y}{t}\right)}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+292}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 17.3%
*-commutative17.3%
associate-*l/58.6%
*-commutative58.6%
associate-*l/58.6%
Simplified58.6%
Taylor expanded in x around 0 52.2%
times-frac75.9%
associate-+r+75.9%
associate-/l*68.9%
+-commutative68.9%
associate-/l*75.9%
associate-*r/68.6%
fma-def68.6%
Simplified68.6%
clear-num68.9%
frac-times63.0%
*-un-lft-identity63.0%
+-commutative63.0%
Applied egg-rr63.0%
*-commutative63.0%
fma-def63.0%
*-commutative63.0%
associate-*l/74.9%
associate-*r/74.9%
+-commutative74.9%
fma-def74.9%
Simplified74.9%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1.00000000000000003e-161 or 9.9999999999999996e-236 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2e292Initial program 99.7%
if -1.00000000000000003e-161 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 9.9999999999999996e-236Initial program 73.5%
associate-/l*76.5%
associate-+l+76.5%
associate-/l*79.2%
Simplified79.2%
associate-/r/80.1%
Applied egg-rr83.9%
if 2e292 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 4.4%
*-commutative4.4%
associate-*l/13.8%
*-commutative13.8%
associate-*l/16.9%
Simplified16.9%
Taylor expanded in t around 0 84.9%
Final simplification92.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ 1.0 (* b (/ y t)))))
(t_2 (+ x (/ (* y z) t)))
(t_3 (/ t_2 a)))
(if (<= a -6e+18)
t_3
(if (<= a -1.35e-64)
(/ z b)
(if (<= a -4.2e-298)
(+ x (* z (/ y t)))
(if (<= a 1.15e-225)
t_1
(if (<= a 1.02e-103) t_2 (if (<= a 95.0) t_1 t_3))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 + (b * (y / t)));
double t_2 = x + ((y * z) / t);
double t_3 = t_2 / a;
double tmp;
if (a <= -6e+18) {
tmp = t_3;
} else if (a <= -1.35e-64) {
tmp = z / b;
} else if (a <= -4.2e-298) {
tmp = x + (z * (y / t));
} else if (a <= 1.15e-225) {
tmp = t_1;
} else if (a <= 1.02e-103) {
tmp = t_2;
} else if (a <= 95.0) {
tmp = 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 = x / (1.0d0 + (b * (y / t)))
t_2 = x + ((y * z) / t)
t_3 = t_2 / a
if (a <= (-6d+18)) then
tmp = t_3
else if (a <= (-1.35d-64)) then
tmp = z / b
else if (a <= (-4.2d-298)) then
tmp = x + (z * (y / t))
else if (a <= 1.15d-225) then
tmp = t_1
else if (a <= 1.02d-103) then
tmp = t_2
else if (a <= 95.0d0) then
tmp = 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 = x / (1.0 + (b * (y / t)));
double t_2 = x + ((y * z) / t);
double t_3 = t_2 / a;
double tmp;
if (a <= -6e+18) {
tmp = t_3;
} else if (a <= -1.35e-64) {
tmp = z / b;
} else if (a <= -4.2e-298) {
tmp = x + (z * (y / t));
} else if (a <= 1.15e-225) {
tmp = t_1;
} else if (a <= 1.02e-103) {
tmp = t_2;
} else if (a <= 95.0) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 + (b * (y / t))) t_2 = x + ((y * z) / t) t_3 = t_2 / a tmp = 0 if a <= -6e+18: tmp = t_3 elif a <= -1.35e-64: tmp = z / b elif a <= -4.2e-298: tmp = x + (z * (y / t)) elif a <= 1.15e-225: tmp = t_1 elif a <= 1.02e-103: tmp = t_2 elif a <= 95.0: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 + Float64(b * Float64(y / t)))) t_2 = Float64(x + Float64(Float64(y * z) / t)) t_3 = Float64(t_2 / a) tmp = 0.0 if (a <= -6e+18) tmp = t_3; elseif (a <= -1.35e-64) tmp = Float64(z / b); elseif (a <= -4.2e-298) tmp = Float64(x + Float64(z * Float64(y / t))); elseif (a <= 1.15e-225) tmp = t_1; elseif (a <= 1.02e-103) tmp = t_2; elseif (a <= 95.0) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 + (b * (y / t))); t_2 = x + ((y * z) / t); t_3 = t_2 / a; tmp = 0.0; if (a <= -6e+18) tmp = t_3; elseif (a <= -1.35e-64) tmp = z / b; elseif (a <= -4.2e-298) tmp = x + (z * (y / t)); elseif (a <= 1.15e-225) tmp = t_1; elseif (a <= 1.02e-103) tmp = t_2; elseif (a <= 95.0) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / a), $MachinePrecision]}, If[LessEqual[a, -6e+18], t$95$3, If[LessEqual[a, -1.35e-64], N[(z / b), $MachinePrecision], If[LessEqual[a, -4.2e-298], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.15e-225], t$95$1, If[LessEqual[a, 1.02e-103], t$95$2, If[LessEqual[a, 95.0], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 + b \cdot \frac{y}{t}}\\
t_2 := x + \frac{y \cdot z}{t}\\
t_3 := \frac{t\_2}{a}\\
\mathbf{if}\;a \leq -6 \cdot 10^{+18}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \leq -1.35 \cdot 10^{-64}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq -4.2 \cdot 10^{-298}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{-225}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.02 \cdot 10^{-103}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 95:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if a < -6e18 or 95 < a Initial program 78.7%
*-commutative78.7%
associate-*l/79.2%
*-commutative79.2%
associate-*l/78.3%
Simplified78.3%
Taylor expanded in a around inf 67.2%
if -6e18 < a < -1.34999999999999993e-64Initial program 62.9%
*-commutative62.9%
associate-*l/62.8%
*-commutative62.8%
associate-*l/62.5%
Simplified62.5%
Taylor expanded in t around 0 60.4%
if -1.34999999999999993e-64 < a < -4.2000000000000001e-298Initial program 78.1%
*-commutative78.1%
associate-*l/81.6%
*-commutative81.6%
associate-*l/79.8%
Simplified79.8%
Taylor expanded in b around 0 58.6%
Taylor expanded in a around 0 58.6%
associate-*r/62.1%
Simplified62.1%
Taylor expanded in y around 0 58.6%
associate-/l*62.0%
associate-/r/63.9%
Simplified63.9%
if -4.2000000000000001e-298 < a < 1.1499999999999999e-225 or 1.01999999999999998e-103 < a < 95Initial program 63.1%
*-commutative63.1%
associate-*l/63.3%
*-commutative63.3%
associate-*l/74.2%
Simplified74.2%
Taylor expanded in a around 0 61.4%
associate-*l/69.6%
*-commutative69.6%
clear-num69.6%
div-inv69.6%
add-cube-cbrt69.1%
*-un-lft-identity69.1%
times-frac69.1%
pow269.1%
Applied egg-rr69.1%
/-rgt-identity69.1%
associate-*r/69.1%
unpow269.1%
rem-3cbrt-lft69.6%
Simplified69.6%
Taylor expanded in x around inf 53.4%
*-commutative53.4%
associate-/l*59.1%
associate-/r/59.1%
Simplified59.1%
if 1.1499999999999999e-225 < a < 1.01999999999999998e-103Initial program 82.8%
*-commutative82.8%
associate-*l/75.5%
*-commutative75.5%
associate-*l/75.3%
Simplified75.3%
Taylor expanded in b around 0 62.5%
Taylor expanded in a around 0 62.5%
Final simplification64.6%
(FPCore (x y z t a b) :precision binary64 (if (<= (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))) 2e+292) (/ (+ x (* z (/ y t))) (+ a (+ 1.0 (* b (/ y t))))) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))) <= 2e+292) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (b * (y / 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 (((x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))) <= 2d+292) then
tmp = (x + (z * (y / t))) / (a + (1.0d0 + (b * (y / 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 (((x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))) <= 2e+292) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (b * (y / t))));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))) <= 2e+292: tmp = (x + (z * (y / t))) / (a + (1.0 + (b * (y / t)))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) <= 2e+292) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + Float64(1.0 + Float64(b * Float64(y / t))))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))) <= 2e+292) tmp = (x + (z * (y / t))) / (a + (1.0 + (b * (y / t)))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[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], 2e+292], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \leq 2 \cdot 10^{+292}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + \left(1 + b \cdot \frac{y}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2e292Initial program 86.3%
associate-/l*85.2%
associate-+l+85.2%
associate-/l*85.4%
Simplified85.4%
associate-/r/86.9%
Applied egg-rr86.9%
associate-/r/89.4%
Applied egg-rr89.4%
if 2e292 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 4.4%
*-commutative4.4%
associate-*l/13.8%
*-commutative13.8%
associate-*l/16.9%
Simplified16.9%
Taylor expanded in t around 0 84.9%
Final simplification88.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -1.25e+34)
(/ x a)
(if (<= a -1.1e-64)
(/ z b)
(if (<= a -3.3e-266)
x
(if (<= a 5.2e-169)
(/ z b)
(if (<= a 1.5e-138) x (if (<= a 5.5e+16) (/ z b) (/ x a))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.25e+34) {
tmp = x / a;
} else if (a <= -1.1e-64) {
tmp = z / b;
} else if (a <= -3.3e-266) {
tmp = x;
} else if (a <= 5.2e-169) {
tmp = z / b;
} else if (a <= 1.5e-138) {
tmp = x;
} else if (a <= 5.5e+16) {
tmp = z / b;
} else {
tmp = x / a;
}
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.25d+34)) then
tmp = x / a
else if (a <= (-1.1d-64)) then
tmp = z / b
else if (a <= (-3.3d-266)) then
tmp = x
else if (a <= 5.2d-169) then
tmp = z / b
else if (a <= 1.5d-138) then
tmp = x
else if (a <= 5.5d+16) then
tmp = z / b
else
tmp = x / a
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.25e+34) {
tmp = x / a;
} else if (a <= -1.1e-64) {
tmp = z / b;
} else if (a <= -3.3e-266) {
tmp = x;
} else if (a <= 5.2e-169) {
tmp = z / b;
} else if (a <= 1.5e-138) {
tmp = x;
} else if (a <= 5.5e+16) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.25e+34: tmp = x / a elif a <= -1.1e-64: tmp = z / b elif a <= -3.3e-266: tmp = x elif a <= 5.2e-169: tmp = z / b elif a <= 1.5e-138: tmp = x elif a <= 5.5e+16: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.25e+34) tmp = Float64(x / a); elseif (a <= -1.1e-64) tmp = Float64(z / b); elseif (a <= -3.3e-266) tmp = x; elseif (a <= 5.2e-169) tmp = Float64(z / b); elseif (a <= 1.5e-138) tmp = x; elseif (a <= 5.5e+16) tmp = Float64(z / b); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.25e+34) tmp = x / a; elseif (a <= -1.1e-64) tmp = z / b; elseif (a <= -3.3e-266) tmp = x; elseif (a <= 5.2e-169) tmp = z / b; elseif (a <= 1.5e-138) tmp = x; elseif (a <= 5.5e+16) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.25e+34], N[(x / a), $MachinePrecision], If[LessEqual[a, -1.1e-64], N[(z / b), $MachinePrecision], If[LessEqual[a, -3.3e-266], x, If[LessEqual[a, 5.2e-169], N[(z / b), $MachinePrecision], If[LessEqual[a, 1.5e-138], x, If[LessEqual[a, 5.5e+16], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.25 \cdot 10^{+34}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq -1.1 \cdot 10^{-64}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq -3.3 \cdot 10^{-266}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{-169}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{-138}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{+16}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -1.25e34 or 5.5e16 < a Initial program 77.6%
*-commutative77.6%
associate-*l/78.1%
*-commutative78.1%
associate-*l/77.9%
Simplified77.9%
Taylor expanded in x around inf 58.0%
Taylor expanded in a around inf 53.4%
if -1.25e34 < a < -1.1e-64 or -3.3000000000000003e-266 < a < 5.20000000000000028e-169 or 1.5e-138 < a < 5.5e16Initial program 68.6%
*-commutative68.6%
associate-*l/66.3%
*-commutative66.3%
associate-*l/69.8%
Simplified69.8%
Taylor expanded in t around 0 46.4%
if -1.1e-64 < a < -3.3000000000000003e-266 or 5.20000000000000028e-169 < a < 1.5e-138Initial program 83.9%
*-commutative83.9%
associate-*l/87.4%
*-commutative87.4%
associate-*l/85.6%
Simplified85.6%
Taylor expanded in t around inf 52.3%
Taylor expanded in a around 0 52.3%
Final simplification51.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (/ z b) (/ (* x t) (* y b))))
(t_2 (/ x (+ (+ a 1.0) (* y (/ b t))))))
(if (<= t -6.1e-30)
t_2
(if (<= t -2.7e-103)
t_1
(if (<= t -4.4e-161)
(/ x (+ 1.0 (+ a (/ (* y b) t))))
(if (<= t 3.9e-16) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z / b) + ((x * t) / (y * b));
double t_2 = x / ((a + 1.0) + (y * (b / t)));
double tmp;
if (t <= -6.1e-30) {
tmp = t_2;
} else if (t <= -2.7e-103) {
tmp = t_1;
} else if (t <= -4.4e-161) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (t <= 3.9e-16) {
tmp = 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 = (z / b) + ((x * t) / (y * b))
t_2 = x / ((a + 1.0d0) + (y * (b / t)))
if (t <= (-6.1d-30)) then
tmp = t_2
else if (t <= (-2.7d-103)) then
tmp = t_1
else if (t <= (-4.4d-161)) then
tmp = x / (1.0d0 + (a + ((y * b) / t)))
else if (t <= 3.9d-16) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z / b) + ((x * t) / (y * b));
double t_2 = x / ((a + 1.0) + (y * (b / t)));
double tmp;
if (t <= -6.1e-30) {
tmp = t_2;
} else if (t <= -2.7e-103) {
tmp = t_1;
} else if (t <= -4.4e-161) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (t <= 3.9e-16) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z / b) + ((x * t) / (y * b)) t_2 = x / ((a + 1.0) + (y * (b / t))) tmp = 0 if t <= -6.1e-30: tmp = t_2 elif t <= -2.7e-103: tmp = t_1 elif t <= -4.4e-161: tmp = x / (1.0 + (a + ((y * b) / t))) elif t <= 3.9e-16: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z / b) + Float64(Float64(x * t) / Float64(y * b))) t_2 = Float64(x / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))) tmp = 0.0 if (t <= -6.1e-30) tmp = t_2; elseif (t <= -2.7e-103) tmp = t_1; elseif (t <= -4.4e-161) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); elseif (t <= 3.9e-16) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z / b) + ((x * t) / (y * b)); t_2 = x / ((a + 1.0) + (y * (b / t))); tmp = 0.0; if (t <= -6.1e-30) tmp = t_2; elseif (t <= -2.7e-103) tmp = t_1; elseif (t <= -4.4e-161) tmp = x / (1.0 + (a + ((y * b) / t))); elseif (t <= 3.9e-16) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z / b), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.1e-30], t$95$2, If[LessEqual[t, -2.7e-103], t$95$1, If[LessEqual[t, -4.4e-161], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.9e-16], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
t_2 := \frac{x}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{if}\;t \leq -6.1 \cdot 10^{-30}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -2.7 \cdot 10^{-103}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -4.4 \cdot 10^{-161}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -6.09999999999999981e-30 or 3.89999999999999977e-16 < t Initial program 85.0%
*-commutative85.0%
associate-*l/90.8%
*-commutative90.8%
associate-*l/94.9%
Simplified94.9%
Taylor expanded in x around inf 72.8%
if -6.09999999999999981e-30 < t < -2.7000000000000001e-103 or -4.40000000000000004e-161 < t < 3.89999999999999977e-16Initial program 62.8%
associate-/l*54.7%
associate-+l+54.7%
associate-/l*50.5%
Simplified50.5%
associate-/r/52.9%
Applied egg-rr52.9%
associate-/r/58.3%
Applied egg-rr58.3%
Taylor expanded in b around inf 40.4%
times-frac33.2%
associate-*r/33.3%
Simplified33.3%
Taylor expanded in t around 0 65.4%
if -2.7000000000000001e-103 < t < -4.40000000000000004e-161Initial program 82.8%
*-commutative82.8%
associate-*l/91.1%
*-commutative91.1%
associate-*l/91.1%
Simplified91.1%
Taylor expanded in x around inf 56.9%
Final simplification69.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ a 1.0))))
(if (<= t -6.2e-18)
t_1
(if (<= t -3.2e-58)
(/ (* x t) (* y b))
(if (<= t -2.2e-135)
(* y (/ z (* t a)))
(if (<= t 1e-15) (/ 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);
double tmp;
if (t <= -6.2e-18) {
tmp = t_1;
} else if (t <= -3.2e-58) {
tmp = (x * t) / (y * b);
} else if (t <= -2.2e-135) {
tmp = y * (z / (t * a));
} else if (t <= 1e-15) {
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)
if (t <= (-6.2d-18)) then
tmp = t_1
else if (t <= (-3.2d-58)) then
tmp = (x * t) / (y * b)
else if (t <= (-2.2d-135)) then
tmp = y * (z / (t * a))
else if (t <= 1d-15) 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);
double tmp;
if (t <= -6.2e-18) {
tmp = t_1;
} else if (t <= -3.2e-58) {
tmp = (x * t) / (y * b);
} else if (t <= -2.2e-135) {
tmp = y * (z / (t * a));
} else if (t <= 1e-15) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (a + 1.0) tmp = 0 if t <= -6.2e-18: tmp = t_1 elif t <= -3.2e-58: tmp = (x * t) / (y * b) elif t <= -2.2e-135: tmp = y * (z / (t * a)) elif t <= 1e-15: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (t <= -6.2e-18) tmp = t_1; elseif (t <= -3.2e-58) tmp = Float64(Float64(x * t) / Float64(y * b)); elseif (t <= -2.2e-135) tmp = Float64(y * Float64(z / Float64(t * a))); elseif (t <= 1e-15) 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); tmp = 0.0; if (t <= -6.2e-18) tmp = t_1; elseif (t <= -3.2e-58) tmp = (x * t) / (y * b); elseif (t <= -2.2e-135) tmp = y * (z / (t * a)); elseif (t <= 1e-15) 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[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.2e-18], t$95$1, If[LessEqual[t, -3.2e-58], N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.2e-135], N[(y * N[(z / N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-15], N[(z / b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{a + 1}\\
\mathbf{if}\;t \leq -6.2 \cdot 10^{-18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -3.2 \cdot 10^{-58}:\\
\;\;\;\;\frac{x \cdot t}{y \cdot b}\\
\mathbf{elif}\;t \leq -2.2 \cdot 10^{-135}:\\
\;\;\;\;y \cdot \frac{z}{t \cdot a}\\
\mathbf{elif}\;t \leq 10^{-15}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.20000000000000014e-18 or 1.0000000000000001e-15 < t Initial program 84.5%
*-commutative84.5%
associate-*l/90.5%
*-commutative90.5%
associate-*l/94.7%
Simplified94.7%
Taylor expanded in t around inf 63.8%
if -6.20000000000000014e-18 < t < -3.2000000000000001e-58Initial program 99.6%
*-commutative99.6%
associate-*l/99.6%
*-commutative99.6%
associate-*l/99.4%
Simplified99.4%
Taylor expanded in x around inf 64.9%
Taylor expanded in b around inf 56.6%
if -3.2000000000000001e-58 < t < -2.2e-135Initial program 62.8%
*-commutative62.8%
associate-*l/62.9%
*-commutative62.9%
associate-*l/62.8%
Simplified62.8%
Taylor expanded in x around 0 47.4%
times-frac47.0%
associate-+r+47.0%
associate-/l*47.0%
+-commutative47.0%
associate-/l*47.0%
associate-*r/46.5%
fma-def46.5%
Simplified46.5%
Taylor expanded in a around inf 33.1%
expm1-log1p-u17.3%
expm1-udef4.1%
*-commutative4.1%
times-frac4.1%
Applied egg-rr4.1%
expm1-def17.2%
expm1-log1p32.7%
times-frac33.1%
associate-*r/40.4%
Simplified40.4%
if -2.2e-135 < t < 1.0000000000000001e-15Initial program 62.8%
*-commutative62.8%
associate-*l/54.6%
*-commutative54.6%
associate-*l/50.2%
Simplified50.2%
Taylor expanded in t around 0 56.0%
Final simplification59.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ a 1.0))))
(if (<= t -5.5e-18)
t_1
(if (<= t -3.2e-62)
(/ (* x t) (* y b))
(if (<= t -8.2e-150)
(* (/ y t) (/ z (+ a 1.0)))
(if (<= t 1.65e-13) (/ 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);
double tmp;
if (t <= -5.5e-18) {
tmp = t_1;
} else if (t <= -3.2e-62) {
tmp = (x * t) / (y * b);
} else if (t <= -8.2e-150) {
tmp = (y / t) * (z / (a + 1.0));
} else if (t <= 1.65e-13) {
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)
if (t <= (-5.5d-18)) then
tmp = t_1
else if (t <= (-3.2d-62)) then
tmp = (x * t) / (y * b)
else if (t <= (-8.2d-150)) then
tmp = (y / t) * (z / (a + 1.0d0))
else if (t <= 1.65d-13) 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);
double tmp;
if (t <= -5.5e-18) {
tmp = t_1;
} else if (t <= -3.2e-62) {
tmp = (x * t) / (y * b);
} else if (t <= -8.2e-150) {
tmp = (y / t) * (z / (a + 1.0));
} else if (t <= 1.65e-13) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (a + 1.0) tmp = 0 if t <= -5.5e-18: tmp = t_1 elif t <= -3.2e-62: tmp = (x * t) / (y * b) elif t <= -8.2e-150: tmp = (y / t) * (z / (a + 1.0)) elif t <= 1.65e-13: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (t <= -5.5e-18) tmp = t_1; elseif (t <= -3.2e-62) tmp = Float64(Float64(x * t) / Float64(y * b)); elseif (t <= -8.2e-150) tmp = Float64(Float64(y / t) * Float64(z / Float64(a + 1.0))); elseif (t <= 1.65e-13) 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); tmp = 0.0; if (t <= -5.5e-18) tmp = t_1; elseif (t <= -3.2e-62) tmp = (x * t) / (y * b); elseif (t <= -8.2e-150) tmp = (y / t) * (z / (a + 1.0)); elseif (t <= 1.65e-13) 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[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.5e-18], t$95$1, If[LessEqual[t, -3.2e-62], N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -8.2e-150], N[(N[(y / t), $MachinePrecision] * N[(z / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.65e-13], N[(z / b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{a + 1}\\
\mathbf{if}\;t \leq -5.5 \cdot 10^{-18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -3.2 \cdot 10^{-62}:\\
\;\;\;\;\frac{x \cdot t}{y \cdot b}\\
\mathbf{elif}\;t \leq -8.2 \cdot 10^{-150}:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{a + 1}\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{-13}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.5e-18 or 1.65e-13 < t Initial program 84.5%
*-commutative84.5%
associate-*l/90.5%
*-commutative90.5%
associate-*l/94.7%
Simplified94.7%
Taylor expanded in t around inf 63.8%
if -5.5e-18 < t < -3.20000000000000021e-62Initial program 93.0%
*-commutative93.0%
associate-*l/93.0%
*-commutative93.0%
associate-*l/92.7%
Simplified92.7%
Taylor expanded in x around inf 64.4%
Taylor expanded in b around inf 50.9%
if -3.20000000000000021e-62 < t < -8.1999999999999997e-150Initial program 65.6%
*-commutative65.6%
associate-*l/72.1%
*-commutative72.1%
associate-*l/72.1%
Simplified72.1%
Taylor expanded in x around 0 58.1%
times-frac64.5%
associate-+r+64.5%
associate-/l*64.5%
+-commutative64.5%
associate-/l*64.5%
associate-*r/64.5%
fma-def64.5%
Simplified64.5%
Taylor expanded in y around 0 38.2%
times-frac44.6%
Simplified44.6%
if -8.1999999999999997e-150 < t < 1.65e-13Initial program 62.2%
*-commutative62.2%
associate-*l/52.6%
*-commutative52.6%
associate-*l/48.0%
Simplified48.0%
Taylor expanded in t around 0 57.3%
Final simplification59.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ a 1.0))))
(if (<= t -1.45e-16)
t_1
(if (<= t -9.2e-63)
(/ x (+ 1.0 (* b (/ y t))))
(if (<= t -5.5e-183)
(* (/ y t) (/ z (+ a 1.0)))
(if (<= t 1.06e-15) (/ 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);
double tmp;
if (t <= -1.45e-16) {
tmp = t_1;
} else if (t <= -9.2e-63) {
tmp = x / (1.0 + (b * (y / t)));
} else if (t <= -5.5e-183) {
tmp = (y / t) * (z / (a + 1.0));
} else if (t <= 1.06e-15) {
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)
if (t <= (-1.45d-16)) then
tmp = t_1
else if (t <= (-9.2d-63)) then
tmp = x / (1.0d0 + (b * (y / t)))
else if (t <= (-5.5d-183)) then
tmp = (y / t) * (z / (a + 1.0d0))
else if (t <= 1.06d-15) 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);
double tmp;
if (t <= -1.45e-16) {
tmp = t_1;
} else if (t <= -9.2e-63) {
tmp = x / (1.0 + (b * (y / t)));
} else if (t <= -5.5e-183) {
tmp = (y / t) * (z / (a + 1.0));
} else if (t <= 1.06e-15) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (a + 1.0) tmp = 0 if t <= -1.45e-16: tmp = t_1 elif t <= -9.2e-63: tmp = x / (1.0 + (b * (y / t))) elif t <= -5.5e-183: tmp = (y / t) * (z / (a + 1.0)) elif t <= 1.06e-15: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (t <= -1.45e-16) tmp = t_1; elseif (t <= -9.2e-63) tmp = Float64(x / Float64(1.0 + Float64(b * Float64(y / t)))); elseif (t <= -5.5e-183) tmp = Float64(Float64(y / t) * Float64(z / Float64(a + 1.0))); elseif (t <= 1.06e-15) 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); tmp = 0.0; if (t <= -1.45e-16) tmp = t_1; elseif (t <= -9.2e-63) tmp = x / (1.0 + (b * (y / t))); elseif (t <= -5.5e-183) tmp = (y / t) * (z / (a + 1.0)); elseif (t <= 1.06e-15) 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[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.45e-16], t$95$1, If[LessEqual[t, -9.2e-63], N[(x / N[(1.0 + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -5.5e-183], N[(N[(y / t), $MachinePrecision] * N[(z / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.06e-15], N[(z / b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{a + 1}\\
\mathbf{if}\;t \leq -1.45 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -9.2 \cdot 10^{-63}:\\
\;\;\;\;\frac{x}{1 + b \cdot \frac{y}{t}}\\
\mathbf{elif}\;t \leq -5.5 \cdot 10^{-183}:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{a + 1}\\
\mathbf{elif}\;t \leq 1.06 \cdot 10^{-15}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.4499999999999999e-16 or 1.06000000000000007e-15 < t Initial program 84.5%
*-commutative84.5%
associate-*l/90.5%
*-commutative90.5%
associate-*l/94.7%
Simplified94.7%
Taylor expanded in t around inf 63.8%
if -1.4499999999999999e-16 < t < -9.2e-63Initial program 93.0%
*-commutative93.0%
associate-*l/93.0%
*-commutative93.0%
associate-*l/92.7%
Simplified92.7%
Taylor expanded in a around 0 79.3%
associate-*l/79.1%
*-commutative79.1%
clear-num79.0%
div-inv79.1%
add-cube-cbrt78.9%
*-un-lft-identity78.9%
times-frac79.0%
pow279.0%
Applied egg-rr79.0%
/-rgt-identity79.0%
associate-*r/78.9%
unpow278.9%
rem-3cbrt-lft79.1%
Simplified79.1%
Taylor expanded in x around inf 57.5%
*-commutative57.5%
associate-/l*57.4%
associate-/r/57.2%
Simplified57.2%
if -9.2e-63 < t < -5.4999999999999999e-183Initial program 61.7%
*-commutative61.7%
associate-*l/61.5%
*-commutative61.5%
associate-*l/61.4%
Simplified61.4%
Taylor expanded in x around 0 61.1%
times-frac60.9%
associate-+r+60.9%
associate-/l*60.8%
+-commutative60.8%
associate-/l*60.9%
associate-*r/60.5%
fma-def60.5%
Simplified60.5%
Taylor expanded in y around 0 36.9%
times-frac41.3%
Simplified41.3%
if -5.4999999999999999e-183 < t < 1.06000000000000007e-15Initial program 62.8%
*-commutative62.8%
associate-*l/53.7%
*-commutative53.7%
associate-*l/48.8%
Simplified48.8%
Taylor expanded in t around 0 58.7%
Final simplification60.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ a 1.0))))
(if (<= t -6e-17)
t_1
(if (<= t -1.1e-66)
(/ x (+ 1.0 (/ (* y b) t)))
(if (<= t -9.2e-183)
(* (/ y t) (/ z (+ a 1.0)))
(if (<= t 3.2e-14) (/ 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);
double tmp;
if (t <= -6e-17) {
tmp = t_1;
} else if (t <= -1.1e-66) {
tmp = x / (1.0 + ((y * b) / t));
} else if (t <= -9.2e-183) {
tmp = (y / t) * (z / (a + 1.0));
} else if (t <= 3.2e-14) {
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)
if (t <= (-6d-17)) then
tmp = t_1
else if (t <= (-1.1d-66)) then
tmp = x / (1.0d0 + ((y * b) / t))
else if (t <= (-9.2d-183)) then
tmp = (y / t) * (z / (a + 1.0d0))
else if (t <= 3.2d-14) 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);
double tmp;
if (t <= -6e-17) {
tmp = t_1;
} else if (t <= -1.1e-66) {
tmp = x / (1.0 + ((y * b) / t));
} else if (t <= -9.2e-183) {
tmp = (y / t) * (z / (a + 1.0));
} else if (t <= 3.2e-14) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (a + 1.0) tmp = 0 if t <= -6e-17: tmp = t_1 elif t <= -1.1e-66: tmp = x / (1.0 + ((y * b) / t)) elif t <= -9.2e-183: tmp = (y / t) * (z / (a + 1.0)) elif t <= 3.2e-14: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (t <= -6e-17) tmp = t_1; elseif (t <= -1.1e-66) tmp = Float64(x / Float64(1.0 + Float64(Float64(y * b) / t))); elseif (t <= -9.2e-183) tmp = Float64(Float64(y / t) * Float64(z / Float64(a + 1.0))); elseif (t <= 3.2e-14) 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); tmp = 0.0; if (t <= -6e-17) tmp = t_1; elseif (t <= -1.1e-66) tmp = x / (1.0 + ((y * b) / t)); elseif (t <= -9.2e-183) tmp = (y / t) * (z / (a + 1.0)); elseif (t <= 3.2e-14) 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[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6e-17], t$95$1, If[LessEqual[t, -1.1e-66], N[(x / N[(1.0 + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -9.2e-183], N[(N[(y / t), $MachinePrecision] * N[(z / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e-14], N[(z / b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{a + 1}\\
\mathbf{if}\;t \leq -6 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.1 \cdot 10^{-66}:\\
\;\;\;\;\frac{x}{1 + \frac{y \cdot b}{t}}\\
\mathbf{elif}\;t \leq -9.2 \cdot 10^{-183}:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{a + 1}\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-14}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.00000000000000012e-17 or 3.2000000000000002e-14 < t Initial program 84.5%
*-commutative84.5%
associate-*l/90.5%
*-commutative90.5%
associate-*l/94.7%
Simplified94.7%
Taylor expanded in t around inf 63.8%
if -6.00000000000000012e-17 < t < -1.1000000000000001e-66Initial program 93.0%
*-commutative93.0%
associate-*l/93.0%
*-commutative93.0%
associate-*l/92.7%
Simplified92.7%
Taylor expanded in x around inf 64.4%
Taylor expanded in a around 0 57.5%
if -1.1000000000000001e-66 < t < -9.20000000000000064e-183Initial program 61.7%
*-commutative61.7%
associate-*l/61.5%
*-commutative61.5%
associate-*l/61.4%
Simplified61.4%
Taylor expanded in x around 0 61.1%
times-frac60.9%
associate-+r+60.9%
associate-/l*60.8%
+-commutative60.8%
associate-/l*60.9%
associate-*r/60.5%
fma-def60.5%
Simplified60.5%
Taylor expanded in y around 0 36.9%
times-frac41.3%
Simplified41.3%
if -9.20000000000000064e-183 < t < 3.2000000000000002e-14Initial program 62.8%
*-commutative62.8%
associate-*l/53.7%
*-commutative53.7%
associate-*l/48.8%
Simplified48.8%
Taylor expanded in t around 0 58.7%
Final simplification60.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.05e+20) (not (<= y 7.5e+18))) (+ (/ z b) (* (/ t b) (/ x y))) (/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.05e+20) || !(y <= 7.5e+18)) {
tmp = (z / b) + ((t / b) * (x / y));
} 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 <= (-1.05d+20)) .or. (.not. (y <= 7.5d+18))) then
tmp = (z / b) + ((t / b) * (x / y))
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 <= -1.05e+20) || !(y <= 7.5e+18)) {
tmp = (z / b) + ((t / b) * (x / y));
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.05e+20) or not (y <= 7.5e+18): tmp = (z / b) + ((t / b) * (x / y)) else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.05e+20) || !(y <= 7.5e+18)) tmp = Float64(Float64(z / b) + Float64(Float64(t / b) * Float64(x / y))); 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 <= -1.05e+20) || ~((y <= 7.5e+18))) tmp = (z / b) + ((t / b) * (x / y)); else tmp = x / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.05e+20], N[Not[LessEqual[y, 7.5e+18]], $MachinePrecision]], N[(N[(z / b), $MachinePrecision] + N[(N[(t / b), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+20} \lor \neg \left(y \leq 7.5 \cdot 10^{+18}\right):\\
\;\;\;\;\frac{z}{b} + \frac{t}{b} \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -1.05e20 or 7.5e18 < y Initial program 55.0%
associate-/l*61.8%
associate-+l+61.8%
associate-/l*66.9%
Simplified66.9%
associate-/r/64.7%
Applied egg-rr64.7%
associate-/r/63.6%
Applied egg-rr63.6%
Taylor expanded in b around inf 30.6%
times-frac37.2%
associate-*r/38.8%
Simplified38.8%
Taylor expanded in t around 0 55.3%
+-commutative55.3%
times-frac61.1%
Simplified61.1%
if -1.05e20 < y < 7.5e18Initial program 93.0%
*-commutative93.0%
associate-*l/87.6%
*-commutative87.6%
associate-*l/84.6%
Simplified84.6%
Taylor expanded in t around inf 62.7%
Final simplification62.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.7e+32) (not (<= y 1.7e-41))) (+ (/ z b) (* (/ t b) (/ x y))) (/ x (+ 1.0 (+ a (/ (* y b) t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.7e+32) || !(y <= 1.7e-41)) {
tmp = (z / b) + ((t / b) * (x / y));
} else {
tmp = x / (1.0 + (a + ((y * b) / t)));
}
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.7d+32)) .or. (.not. (y <= 1.7d-41))) then
tmp = (z / b) + ((t / b) * (x / y))
else
tmp = x / (1.0d0 + (a + ((y * b) / t)))
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.7e+32) || !(y <= 1.7e-41)) {
tmp = (z / b) + ((t / b) * (x / y));
} else {
tmp = x / (1.0 + (a + ((y * b) / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.7e+32) or not (y <= 1.7e-41): tmp = (z / b) + ((t / b) * (x / y)) else: tmp = x / (1.0 + (a + ((y * b) / t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.7e+32) || !(y <= 1.7e-41)) tmp = Float64(Float64(z / b) + Float64(Float64(t / b) * Float64(x / y))); else tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.7e+32) || ~((y <= 1.7e-41))) tmp = (z / b) + ((t / b) * (x / y)); else tmp = x / (1.0 + (a + ((y * b) / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.7e+32], N[Not[LessEqual[y, 1.7e-41]], $MachinePrecision]], N[(N[(z / b), $MachinePrecision] + N[(N[(t / b), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+32} \lor \neg \left(y \leq 1.7 \cdot 10^{-41}\right):\\
\;\;\;\;\frac{z}{b} + \frac{t}{b} \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\end{array}
\end{array}
if y < -1.69999999999999989e32 or 1.6999999999999999e-41 < y Initial program 57.4%
associate-/l*63.0%
associate-+l+63.0%
associate-/l*67.7%
Simplified67.7%
associate-/r/65.7%
Applied egg-rr65.7%
associate-/r/64.6%
Applied egg-rr64.6%
Taylor expanded in b around inf 30.1%
times-frac36.3%
associate-*r/37.8%
Simplified37.8%
Taylor expanded in t around 0 54.0%
+-commutative54.0%
times-frac59.4%
Simplified59.4%
if -1.69999999999999989e32 < y < 1.6999999999999999e-41Initial program 93.3%
*-commutative93.3%
associate-*l/88.2%
*-commutative88.2%
associate-*l/85.1%
Simplified85.1%
Taylor expanded in x around inf 72.0%
Final simplification65.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -4.4e+137) (not (<= y 1.18e+26))) (+ (/ z b) (* (/ t b) (/ x y))) (/ (+ x (/ (* y z) t)) (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4.4e+137) || !(y <= 1.18e+26)) {
tmp = (z / b) + ((t / b) * (x / y));
} else {
tmp = (x + ((y * z) / 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 <= (-4.4d+137)) .or. (.not. (y <= 1.18d+26))) then
tmp = (z / b) + ((t / b) * (x / y))
else
tmp = (x + ((y * z) / 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 <= -4.4e+137) || !(y <= 1.18e+26)) {
tmp = (z / b) + ((t / b) * (x / y));
} else {
tmp = (x + ((y * z) / t)) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -4.4e+137) or not (y <= 1.18e+26): tmp = (z / b) + ((t / b) * (x / y)) else: tmp = (x + ((y * z) / t)) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -4.4e+137) || !(y <= 1.18e+26)) tmp = Float64(Float64(z / b) + Float64(Float64(t / b) * Float64(x / y))); else tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -4.4e+137) || ~((y <= 1.18e+26))) tmp = (z / b) + ((t / b) * (x / y)); else tmp = (x + ((y * z) / t)) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -4.4e+137], N[Not[LessEqual[y, 1.18e+26]], $MachinePrecision]], N[(N[(z / b), $MachinePrecision] + N[(N[(t / b), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{+137} \lor \neg \left(y \leq 1.18 \cdot 10^{+26}\right):\\
\;\;\;\;\frac{z}{b} + \frac{t}{b} \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\end{array}
\end{array}
if y < -4.40000000000000031e137 or 1.18e26 < y Initial program 48.8%
associate-/l*54.7%
associate-+l+54.7%
associate-/l*59.3%
Simplified59.3%
associate-/r/56.8%
Applied egg-rr56.8%
associate-/r/55.3%
Applied egg-rr55.3%
Taylor expanded in b around inf 28.7%
times-frac36.1%
associate-*r/38.3%
Simplified38.3%
Taylor expanded in t around 0 61.3%
+-commutative61.3%
times-frac66.9%
Simplified66.9%
if -4.40000000000000031e137 < y < 1.18e26Initial program 89.4%
*-commutative89.4%
associate-*l/86.6%
*-commutative86.6%
associate-*l/85.3%
Simplified85.3%
Taylor expanded in b around 0 73.7%
Final simplification71.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -5.5e-31) (not (<= t 6.2e-15))) (/ x (+ a 1.0)) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -5.5e-31) || !(t <= 6.2e-15)) {
tmp = x / (a + 1.0);
} 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.5d-31)) .or. (.not. (t <= 6.2d-15))) then
tmp = x / (a + 1.0d0)
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.5e-31) || !(t <= 6.2e-15)) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -5.5e-31) or not (t <= 6.2e-15): tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -5.5e-31) || !(t <= 6.2e-15)) tmp = Float64(x / Float64(a + 1.0)); 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.5e-31) || ~((t <= 6.2e-15))) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -5.5e-31], N[Not[LessEqual[t, 6.2e-15]], $MachinePrecision]], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{-31} \lor \neg \left(t \leq 6.2 \cdot 10^{-15}\right):\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -5.49999999999999958e-31 or 6.1999999999999998e-15 < t Initial program 85.0%
*-commutative85.0%
associate-*l/90.8%
*-commutative90.8%
associate-*l/94.9%
Simplified94.9%
Taylor expanded in t around inf 62.3%
if -5.49999999999999958e-31 < t < 6.1999999999999998e-15Initial program 64.8%
*-commutative64.8%
associate-*l/57.9%
*-commutative57.9%
associate-*l/54.3%
Simplified54.3%
Taylor expanded in t around 0 52.1%
Final simplification57.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.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 <= -1.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 <= (-1.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 <= -1.0) || !(a <= 1.0)) {
tmp = x / a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.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 <= -1.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 <= -1.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, -1.0], N[Not[LessEqual[a, 1.0]], $MachinePrecision]], N[(x / a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \lor \neg \left(a \leq 1\right):\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1 or 1 < a Initial program 79.1%
*-commutative79.1%
associate-*l/79.5%
*-commutative79.5%
associate-*l/78.7%
Simplified78.7%
Taylor expanded in x around inf 57.2%
Taylor expanded in a around inf 51.0%
if -1 < a < 1Initial program 72.9%
*-commutative72.9%
associate-*l/72.9%
*-commutative72.9%
associate-*l/75.1%
Simplified75.1%
Taylor expanded in t around inf 37.0%
Taylor expanded in a around 0 36.1%
Final simplification43.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 76.1%
*-commutative76.1%
associate-*l/76.3%
*-commutative76.3%
associate-*l/76.9%
Simplified76.9%
Taylor expanded in t around inf 44.7%
Taylor expanded in a around 0 19.5%
Final simplification19.5%
(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 2024031
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:herbie-target
(if (< t -1.3659085366310088e-271) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b))))) (if (< t 3.036967103737246e-130) (/ z b) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))