
(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 15 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 (/ (* y b) t))
(t_2 (/ (+ x (/ (* y z) t)) (+ t_1 (+ a 1.0))))
(t_3 (+ 1.0 (+ a t_1)))
(t_4 (* z (+ (/ x (* z t_3)) (/ y (* t t_3))))))
(if (<= t_2 (- INFINITY))
t_4
(if (<= t_2 5e+260) t_2 (if (<= t_2 INFINITY) t_4 (/ z b))))))
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)) / (t_1 + (a + 1.0));
double t_3 = 1.0 + (a + t_1);
double t_4 = z * ((x / (z * t_3)) + (y / (t * t_3)));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_4;
} else if (t_2 <= 5e+260) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_4;
} 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 = (y * b) / t;
double t_2 = (x + ((y * z) / t)) / (t_1 + (a + 1.0));
double t_3 = 1.0 + (a + t_1);
double t_4 = z * ((x / (z * t_3)) + (y / (t * t_3)));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_4;
} else if (t_2 <= 5e+260) {
tmp = t_2;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_4;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y * b) / t t_2 = (x + ((y * z) / t)) / (t_1 + (a + 1.0)) t_3 = 1.0 + (a + t_1) t_4 = z * ((x / (z * t_3)) + (y / (t * t_3))) tmp = 0 if t_2 <= -math.inf: tmp = t_4 elif t_2 <= 5e+260: tmp = t_2 elif t_2 <= math.inf: tmp = t_4 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * b) / t) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(t_1 + Float64(a + 1.0))) t_3 = Float64(1.0 + Float64(a + t_1)) t_4 = Float64(z * Float64(Float64(x / Float64(z * t_3)) + Float64(y / Float64(t * t_3)))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_4; elseif (t_2 <= 5e+260) tmp = t_2; elseif (t_2 <= Inf) tmp = t_4; else tmp = Float64(z / b); 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_1 + (a + 1.0)); t_3 = 1.0 + (a + t_1); t_4 = z * ((x / (z * t_3)) + (y / (t * t_3))); tmp = 0.0; if (t_2 <= -Inf) tmp = t_4; elseif (t_2 <= 5e+260) tmp = t_2; elseif (t_2 <= Inf) tmp = t_4; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(N[(x / N[(z * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$4, If[LessEqual[t$95$2, 5e+260], t$95$2, If[LessEqual[t$95$2, Infinity], t$95$4, N[(z / b), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{t\_1 + \left(a + 1\right)}\\
t_3 := 1 + \left(a + t\_1\right)\\
t_4 := z \cdot \left(\frac{x}{z \cdot t\_3} + \frac{y}{t \cdot t\_3}\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+260}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_4\\
\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))) < -inf.0 or 4.9999999999999996e260 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 22.6%
+-commutative22.6%
associate-/l*48.4%
fma-define48.4%
+-commutative48.4%
associate-/l*48.4%
fma-define48.4%
Simplified48.4%
Taylor expanded in z around inf 95.1%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 4.9999999999999996e260Initial program 89.5%
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%
+-commutative0.0%
associate-/l*0.1%
fma-define0.1%
+-commutative0.1%
associate-/l*2.9%
fma-define2.9%
Simplified2.9%
Taylor expanded in y around inf 97.3%
Final simplification91.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0))))) (if (<= t_1 1e+304) 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)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= 1e+304) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0d0))
if (t_1 <= 1d+304) then
tmp = t_1
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 t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= 1e+304) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)) tmp = 0 if t_1 <= 1e+304: 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(Float64(y * b) / t) + Float64(a + 1.0))) tmp = 0.0 if (t_1 <= 1e+304) tmp = t_1; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)); tmp = 0.0; if (t_1 <= 1e+304) tmp = t_1; else tmp = z / b; end tmp_2 = 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[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+304], t$95$1, N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{if}\;t\_1 \leq 10^{+304}:\\
\;\;\;\;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.9999999999999994e303Initial program 86.5%
if 9.9999999999999994e303 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 3.2%
+-commutative3.2%
associate-/l*11.8%
fma-define11.8%
+-commutative11.8%
associate-/l*13.9%
fma-define13.9%
Simplified13.9%
Taylor expanded in y around inf 85.0%
Final simplification86.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y (/ z t)))))
(if (<= y -7.2e+177)
(/ z b)
(if (<= y -5e+59)
(/ t_1 (+ (* y (/ b t)) (+ a 1.0)))
(if (<= y 5e+14)
(/ (+ x (/ (* y z) t)) (+ (* b (/ y t)) (+ a 1.0)))
(if (<= y 1.42e+250) (/ t_1 (+ (/ y (/ t b)) (+ a 1.0))) (/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * (z / t));
double tmp;
if (y <= -7.2e+177) {
tmp = z / b;
} else if (y <= -5e+59) {
tmp = t_1 / ((y * (b / t)) + (a + 1.0));
} else if (y <= 5e+14) {
tmp = (x + ((y * z) / t)) / ((b * (y / t)) + (a + 1.0));
} else if (y <= 1.42e+250) {
tmp = t_1 / ((y / (t / b)) + (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) :: t_1
real(8) :: tmp
t_1 = x + (y * (z / t))
if (y <= (-7.2d+177)) then
tmp = z / b
else if (y <= (-5d+59)) then
tmp = t_1 / ((y * (b / t)) + (a + 1.0d0))
else if (y <= 5d+14) then
tmp = (x + ((y * z) / t)) / ((b * (y / t)) + (a + 1.0d0))
else if (y <= 1.42d+250) then
tmp = t_1 / ((y / (t / b)) + (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 t_1 = x + (y * (z / t));
double tmp;
if (y <= -7.2e+177) {
tmp = z / b;
} else if (y <= -5e+59) {
tmp = t_1 / ((y * (b / t)) + (a + 1.0));
} else if (y <= 5e+14) {
tmp = (x + ((y * z) / t)) / ((b * (y / t)) + (a + 1.0));
} else if (y <= 1.42e+250) {
tmp = t_1 / ((y / (t / b)) + (a + 1.0));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * (z / t)) tmp = 0 if y <= -7.2e+177: tmp = z / b elif y <= -5e+59: tmp = t_1 / ((y * (b / t)) + (a + 1.0)) elif y <= 5e+14: tmp = (x + ((y * z) / t)) / ((b * (y / t)) + (a + 1.0)) elif y <= 1.42e+250: tmp = t_1 / ((y / (t / b)) + (a + 1.0)) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * Float64(z / t))) tmp = 0.0 if (y <= -7.2e+177) tmp = Float64(z / b); elseif (y <= -5e+59) tmp = Float64(t_1 / Float64(Float64(y * Float64(b / t)) + Float64(a + 1.0))); elseif (y <= 5e+14) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(b * Float64(y / t)) + Float64(a + 1.0))); elseif (y <= 1.42e+250) tmp = Float64(t_1 / Float64(Float64(y / Float64(t / b)) + Float64(a + 1.0))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * (z / t)); tmp = 0.0; if (y <= -7.2e+177) tmp = z / b; elseif (y <= -5e+59) tmp = t_1 / ((y * (b / t)) + (a + 1.0)); elseif (y <= 5e+14) tmp = (x + ((y * z) / t)) / ((b * (y / t)) + (a + 1.0)); elseif (y <= 1.42e+250) tmp = t_1 / ((y / (t / b)) + (a + 1.0)); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.2e+177], N[(z / b), $MachinePrecision], If[LessEqual[y, -5e+59], N[(t$95$1 / N[(N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e+14], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.42e+250], N[(t$95$1 / N[(N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{t}\\
\mathbf{if}\;y \leq -7.2 \cdot 10^{+177}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -5 \cdot 10^{+59}:\\
\;\;\;\;\frac{t\_1}{y \cdot \frac{b}{t} + \left(a + 1\right)}\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+14}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{b \cdot \frac{y}{t} + \left(a + 1\right)}\\
\mathbf{elif}\;y \leq 1.42 \cdot 10^{+250}:\\
\;\;\;\;\frac{t\_1}{\frac{y}{\frac{t}{b}} + \left(a + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -7.20000000000000005e177 or 1.42000000000000005e250 < y Initial program 29.2%
+-commutative29.2%
associate-/l*31.0%
fma-define31.0%
+-commutative31.0%
associate-/l*31.0%
fma-define31.0%
Simplified31.0%
Taylor expanded in y around inf 81.7%
if -7.20000000000000005e177 < y < -4.9999999999999997e59Initial program 59.8%
associate-/l*70.9%
associate-/l*88.0%
Simplified88.0%
if -4.9999999999999997e59 < y < 5e14Initial program 88.4%
*-commutative88.4%
associate-/l*88.4%
Applied egg-rr88.4%
if 5e14 < y < 1.42000000000000005e250Initial program 68.3%
associate-/l*75.6%
associate-/l*82.8%
Simplified82.8%
clear-num82.8%
un-div-inv82.9%
Applied egg-rr82.9%
Final simplification86.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.45e+176)
(/ z b)
(if (<= y -1.36e-70)
(/ (+ x (* y (/ z t))) (+ a (* y (/ b t))))
(if (<= y 2.7e+161) (/ (+ x (* z (* y (/ 1.0 t)))) (+ a 1.0)) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.45e+176) {
tmp = z / b;
} else if (y <= -1.36e-70) {
tmp = (x + (y * (z / t))) / (a + (y * (b / t)));
} else if (y <= 2.7e+161) {
tmp = (x + (z * (y * (1.0 / t)))) / (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 (y <= (-2.45d+176)) then
tmp = z / b
else if (y <= (-1.36d-70)) then
tmp = (x + (y * (z / t))) / (a + (y * (b / t)))
else if (y <= 2.7d+161) then
tmp = (x + (z * (y * (1.0d0 / t)))) / (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 (y <= -2.45e+176) {
tmp = z / b;
} else if (y <= -1.36e-70) {
tmp = (x + (y * (z / t))) / (a + (y * (b / t)));
} else if (y <= 2.7e+161) {
tmp = (x + (z * (y * (1.0 / t)))) / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.45e+176: tmp = z / b elif y <= -1.36e-70: tmp = (x + (y * (z / t))) / (a + (y * (b / t))) elif y <= 2.7e+161: tmp = (x + (z * (y * (1.0 / t)))) / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.45e+176) tmp = Float64(z / b); elseif (y <= -1.36e-70) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + Float64(y * Float64(b / t)))); elseif (y <= 2.7e+161) tmp = Float64(Float64(x + Float64(z * Float64(y * Float64(1.0 / t)))) / 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 (y <= -2.45e+176) tmp = z / b; elseif (y <= -1.36e-70) tmp = (x + (y * (z / t))) / (a + (y * (b / t))); elseif (y <= 2.7e+161) tmp = (x + (z * (y * (1.0 / t)))) / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.45e+176], N[(z / b), $MachinePrecision], If[LessEqual[y, -1.36e-70], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e+161], N[(N[(x + N[(z * N[(y * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.45 \cdot 10^{+176}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -1.36 \cdot 10^{-70}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + y \cdot \frac{b}{t}}\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+161}:\\
\;\;\;\;\frac{x + z \cdot \left(y \cdot \frac{1}{t}\right)}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -2.45e176 or 2.6999999999999998e161 < y Initial program 34.5%
+-commutative34.5%
associate-/l*37.5%
fma-define37.5%
+-commutative37.5%
associate-/l*40.5%
fma-define40.5%
Simplified40.5%
Taylor expanded in y around inf 74.8%
if -2.45e176 < y < -1.36000000000000001e-70Initial program 75.6%
associate-/l*80.8%
associate-/l*88.8%
Simplified88.8%
Taylor expanded in a around inf 75.7%
if -1.36000000000000001e-70 < y < 2.6999999999999998e161Initial program 86.0%
+-commutative86.0%
associate-/l*79.0%
fma-define79.1%
+-commutative79.1%
associate-/l*74.9%
fma-define74.9%
Simplified74.9%
Taylor expanded in b around 0 71.1%
associate-*r/66.8%
*-commutative66.8%
div-inv66.8%
associate-*l*72.1%
Applied egg-rr72.1%
Final simplification73.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.7e+179) (not (<= y 1.35e+247))) (/ z b) (/ (+ x (* y (/ z t))) (+ (/ y (/ t b)) (+ a 1.0)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.7e+179) || !(y <= 1.35e+247)) {
tmp = z / b;
} else {
tmp = (x + (y * (z / t))) / ((y / (t / b)) + (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 <= (-2.7d+179)) .or. (.not. (y <= 1.35d+247))) then
tmp = z / b
else
tmp = (x + (y * (z / t))) / ((y / (t / b)) + (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 <= -2.7e+179) || !(y <= 1.35e+247)) {
tmp = z / b;
} else {
tmp = (x + (y * (z / t))) / ((y / (t / b)) + (a + 1.0));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.7e+179) or not (y <= 1.35e+247): tmp = z / b else: tmp = (x + (y * (z / t))) / ((y / (t / b)) + (a + 1.0)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.7e+179) || !(y <= 1.35e+247)) tmp = Float64(z / b); else tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(y / Float64(t / b)) + Float64(a + 1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.7e+179) || ~((y <= 1.35e+247))) tmp = z / b; else tmp = (x + (y * (z / t))) / ((y / (t / b)) + (a + 1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.7e+179], N[Not[LessEqual[y, 1.35e+247]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{+179} \lor \neg \left(y \leq 1.35 \cdot 10^{+247}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\frac{y}{\frac{t}{b}} + \left(a + 1\right)}\\
\end{array}
\end{array}
if y < -2.69999999999999982e179 or 1.35e247 < y Initial program 29.2%
+-commutative29.2%
associate-/l*31.0%
fma-define31.0%
+-commutative31.0%
associate-/l*31.0%
fma-define31.0%
Simplified31.0%
Taylor expanded in y around inf 81.7%
if -2.69999999999999982e179 < y < 1.35e247Initial program 82.2%
associate-/l*78.3%
associate-/l*77.5%
Simplified77.5%
clear-num77.4%
un-div-inv78.2%
Applied egg-rr78.2%
Final simplification78.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3e+177) (not (<= y 3.5e+242))) (/ z b) (/ (+ x (* y (/ z t))) (+ (* y (/ b t)) (+ a 1.0)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3e+177) || !(y <= 3.5e+242)) {
tmp = z / b;
} else {
tmp = (x + (y * (z / t))) / ((y * (b / 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 <= (-3d+177)) .or. (.not. (y <= 3.5d+242))) then
tmp = z / b
else
tmp = (x + (y * (z / t))) / ((y * (b / 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 <= -3e+177) || !(y <= 3.5e+242)) {
tmp = z / b;
} else {
tmp = (x + (y * (z / t))) / ((y * (b / t)) + (a + 1.0));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3e+177) or not (y <= 3.5e+242): tmp = z / b else: tmp = (x + (y * (z / t))) / ((y * (b / t)) + (a + 1.0)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3e+177) || !(y <= 3.5e+242)) tmp = Float64(z / b); else tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(y * Float64(b / t)) + Float64(a + 1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -3e+177) || ~((y <= 3.5e+242))) tmp = z / b; else tmp = (x + (y * (z / t))) / ((y * (b / t)) + (a + 1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3e+177], N[Not[LessEqual[y, 3.5e+242]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+177} \lor \neg \left(y \leq 3.5 \cdot 10^{+242}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{y \cdot \frac{b}{t} + \left(a + 1\right)}\\
\end{array}
\end{array}
if y < -3e177 or 3.4999999999999999e242 < y Initial program 29.2%
+-commutative29.2%
associate-/l*31.0%
fma-define31.0%
+-commutative31.0%
associate-/l*31.0%
fma-define31.0%
Simplified31.0%
Taylor expanded in y around inf 81.7%
if -3e177 < y < 3.4999999999999999e242Initial program 82.2%
associate-/l*78.3%
associate-/l*77.5%
Simplified77.5%
Final simplification78.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -5.2e+79)
(/ z b)
(if (<= y 1.4e-42)
(/ (+ x (/ (* y z) t)) (+ a 1.0))
(if (<= y 6e+153) (/ x (+ (/ y (/ t b)) (+ a 1.0))) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -5.2e+79) {
tmp = z / b;
} else if (y <= 1.4e-42) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (y <= 6e+153) {
tmp = x / ((y / (t / b)) + (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 (y <= (-5.2d+79)) then
tmp = z / b
else if (y <= 1.4d-42) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else if (y <= 6d+153) then
tmp = x / ((y / (t / b)) + (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 (y <= -5.2e+79) {
tmp = z / b;
} else if (y <= 1.4e-42) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (y <= 6e+153) {
tmp = x / ((y / (t / b)) + (a + 1.0));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -5.2e+79: tmp = z / b elif y <= 1.4e-42: tmp = (x + ((y * z) / t)) / (a + 1.0) elif y <= 6e+153: tmp = x / ((y / (t / b)) + (a + 1.0)) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -5.2e+79) tmp = Float64(z / b); elseif (y <= 1.4e-42) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); elseif (y <= 6e+153) tmp = Float64(x / Float64(Float64(y / Float64(t / b)) + 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 (y <= -5.2e+79) tmp = z / b; elseif (y <= 1.4e-42) tmp = (x + ((y * z) / t)) / (a + 1.0); elseif (y <= 6e+153) tmp = x / ((y / (t / b)) + (a + 1.0)); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -5.2e+79], N[(z / b), $MachinePrecision], If[LessEqual[y, 1.4e-42], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e+153], N[(x / N[(N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{+79}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-42}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+153}:\\
\;\;\;\;\frac{x}{\frac{y}{\frac{t}{b}} + \left(a + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -5.20000000000000029e79 or 6.00000000000000037e153 < y Initial program 39.0%
+-commutative39.0%
associate-/l*44.8%
fma-define44.8%
+-commutative44.8%
associate-/l*50.7%
fma-define50.7%
Simplified50.7%
Taylor expanded in y around inf 68.2%
if -5.20000000000000029e79 < y < 1.39999999999999999e-42Initial program 90.8%
+-commutative90.8%
associate-/l*81.2%
fma-define81.2%
+-commutative81.2%
associate-/l*75.7%
fma-define75.7%
Simplified75.7%
Taylor expanded in b around 0 75.8%
if 1.39999999999999999e-42 < y < 6.00000000000000037e153Initial program 75.7%
clear-num75.6%
associate-/r/75.6%
Applied egg-rr75.6%
Taylor expanded in x around inf 61.3%
associate-*l/61.4%
*-un-lft-identity61.4%
associate-*r/63.7%
clear-num63.7%
un-div-inv63.7%
Applied egg-rr63.7%
Final simplification71.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.4e+92) (not (<= y 6.5e+162))) (/ z b) (/ (+ x (* z (* y (/ 1.0 t)))) (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.4e+92) || !(y <= 6.5e+162)) {
tmp = z / b;
} else {
tmp = (x + (z * (y * (1.0 / 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 <= (-3.4d+92)) .or. (.not. (y <= 6.5d+162))) then
tmp = z / b
else
tmp = (x + (z * (y * (1.0d0 / 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 <= -3.4e+92) || !(y <= 6.5e+162)) {
tmp = z / b;
} else {
tmp = (x + (z * (y * (1.0 / t)))) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3.4e+92) or not (y <= 6.5e+162): tmp = z / b else: tmp = (x + (z * (y * (1.0 / t)))) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.4e+92) || !(y <= 6.5e+162)) tmp = Float64(z / b); else tmp = Float64(Float64(x + Float64(z * Float64(y * Float64(1.0 / t)))) / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -3.4e+92) || ~((y <= 6.5e+162))) tmp = z / b; else tmp = (x + (z * (y * (1.0 / t)))) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.4e+92], N[Not[LessEqual[y, 6.5e+162]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(N[(x + N[(z * N[(y * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+92} \lor \neg \left(y \leq 6.5 \cdot 10^{+162}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + z \cdot \left(y \cdot \frac{1}{t}\right)}{a + 1}\\
\end{array}
\end{array}
if y < -3.3999999999999998e92 or 6.5000000000000004e162 < y Initial program 40.3%
+-commutative40.3%
associate-/l*43.9%
fma-define43.9%
+-commutative43.9%
associate-/l*50.0%
fma-define50.0%
Simplified50.0%
Taylor expanded in y around inf 69.5%
if -3.3999999999999998e92 < y < 6.5000000000000004e162Initial program 85.9%
+-commutative85.9%
associate-/l*80.3%
fma-define80.3%
+-commutative80.3%
associate-/l*76.6%
fma-define76.6%
Simplified76.6%
Taylor expanded in b around 0 69.5%
associate-*r/66.2%
*-commutative66.2%
div-inv66.3%
associate-*l*70.9%
Applied egg-rr70.9%
Final simplification70.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -8.5e+88) (not (<= y 9.5e+153))) (/ z b) (/ (+ x (/ y (/ t z))) (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -8.5e+88) || !(y <= 9.5e+153)) {
tmp = z / b;
} else {
tmp = (x + (y / (t / z))) / (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 <= (-8.5d+88)) .or. (.not. (y <= 9.5d+153))) then
tmp = z / b
else
tmp = (x + (y / (t / z))) / (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 <= -8.5e+88) || !(y <= 9.5e+153)) {
tmp = z / b;
} else {
tmp = (x + (y / (t / z))) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -8.5e+88) or not (y <= 9.5e+153): tmp = z / b else: tmp = (x + (y / (t / z))) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -8.5e+88) || !(y <= 9.5e+153)) tmp = Float64(z / b); else tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -8.5e+88) || ~((y <= 9.5e+153))) tmp = z / b; else tmp = (x + (y / (t / z))) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -8.5e+88], N[Not[LessEqual[y, 9.5e+153]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{+88} \lor \neg \left(y \leq 9.5 \cdot 10^{+153}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a + 1}\\
\end{array}
\end{array}
if y < -8.5000000000000005e88 or 9.4999999999999995e153 < y Initial program 39.4%
+-commutative39.4%
associate-/l*44.1%
fma-define44.1%
+-commutative44.1%
associate-/l*50.0%
fma-define50.0%
Simplified50.0%
Taylor expanded in y around inf 69.1%
if -8.5000000000000005e88 < y < 9.4999999999999995e153Initial program 86.8%
+-commutative86.8%
associate-/l*80.6%
fma-define80.6%
+-commutative80.6%
associate-/l*76.9%
fma-define76.9%
Simplified76.9%
Taylor expanded in b around 0 70.3%
associate-*r/66.4%
*-commutative66.4%
div-inv66.4%
associate-*l*71.1%
Applied egg-rr71.1%
associate-*r*66.4%
div-inv66.4%
*-commutative66.4%
clear-num66.4%
un-div-inv66.6%
Applied egg-rr66.6%
Final simplification67.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -9.2e+86) (not (<= y 8.2e+161))) (/ z b) (/ (+ 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 <= -9.2e+86) || !(y <= 8.2e+161)) {
tmp = z / b;
} 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 <= (-9.2d+86)) .or. (.not. (y <= 8.2d+161))) then
tmp = z / b
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 <= -9.2e+86) || !(y <= 8.2e+161)) {
tmp = z / b;
} else {
tmp = (x + (y * (z / t))) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -9.2e+86) or not (y <= 8.2e+161): tmp = z / b else: tmp = (x + (y * (z / t))) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -9.2e+86) || !(y <= 8.2e+161)) tmp = Float64(z / b); else tmp = Float64(Float64(x + Float64(y * Float64(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 <= -9.2e+86) || ~((y <= 8.2e+161))) tmp = z / b; 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, -9.2e+86], N[Not[LessEqual[y, 8.2e+161]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.2 \cdot 10^{+86} \lor \neg \left(y \leq 8.2 \cdot 10^{+161}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + 1}\\
\end{array}
\end{array}
if y < -9.19999999999999958e86 or 8.2000000000000002e161 < y Initial program 40.3%
+-commutative40.3%
associate-/l*43.9%
fma-define43.9%
+-commutative43.9%
associate-/l*50.0%
fma-define50.0%
Simplified50.0%
Taylor expanded in y around inf 69.5%
if -9.19999999999999958e86 < y < 8.2000000000000002e161Initial program 85.9%
+-commutative85.9%
associate-/l*80.3%
fma-define80.3%
+-commutative80.3%
associate-/l*76.6%
fma-define76.6%
Simplified76.6%
Taylor expanded in b around 0 69.5%
associate-*r/66.2%
*-commutative66.2%
Applied egg-rr66.2%
Final simplification67.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.7e+93) (not (<= y 5.8e+153))) (/ z b) (/ 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 <= -3.7e+93) || !(y <= 5.8e+153)) {
tmp = z / b;
} 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 <= (-3.7d+93)) .or. (.not. (y <= 5.8d+153))) then
tmp = z / b
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 <= -3.7e+93) || !(y <= 5.8e+153)) {
tmp = z / b;
} else {
tmp = x / (1.0 + (a + ((y * b) / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3.7e+93) or not (y <= 5.8e+153): tmp = z / b else: tmp = x / (1.0 + (a + ((y * b) / t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.7e+93) || !(y <= 5.8e+153)) tmp = Float64(z / b); 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 <= -3.7e+93) || ~((y <= 5.8e+153))) tmp = z / b; 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, -3.7e+93], N[Not[LessEqual[y, 5.8e+153]], $MachinePrecision]], N[(z / b), $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 -3.7 \cdot 10^{+93} \lor \neg \left(y \leq 5.8 \cdot 10^{+153}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\end{array}
\end{array}
if y < -3.69999999999999987e93 or 5.80000000000000004e153 < y Initial program 39.9%
+-commutative39.9%
associate-/l*44.6%
fma-define44.6%
+-commutative44.6%
associate-/l*49.4%
fma-define49.4%
Simplified49.4%
Taylor expanded in y around inf 69.9%
if -3.69999999999999987e93 < y < 5.80000000000000004e153Initial program 86.3%
+-commutative86.3%
associate-/l*80.2%
fma-define80.2%
+-commutative80.2%
associate-/l*77.1%
fma-define77.0%
Simplified77.0%
Taylor expanded in z around 0 61.1%
Final simplification63.8%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.35) (/ x (+ (/ y (/ t b)) (+ a 1.0))) (if (<= t 1.6e-86) (/ z b) (/ x (+ 1.0 (+ a (/ (* y b) t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.35) {
tmp = x / ((y / (t / b)) + (a + 1.0));
} else if (t <= 1.6e-86) {
tmp = z / b;
} 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 (t <= (-1.35d0)) then
tmp = x / ((y / (t / b)) + (a + 1.0d0))
else if (t <= 1.6d-86) then
tmp = z / b
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 (t <= -1.35) {
tmp = x / ((y / (t / b)) + (a + 1.0));
} else if (t <= 1.6e-86) {
tmp = z / b;
} else {
tmp = x / (1.0 + (a + ((y * b) / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.35: tmp = x / ((y / (t / b)) + (a + 1.0)) elif t <= 1.6e-86: tmp = z / b else: tmp = x / (1.0 + (a + ((y * b) / t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.35) tmp = Float64(x / Float64(Float64(y / Float64(t / b)) + Float64(a + 1.0))); elseif (t <= 1.6e-86) tmp = Float64(z / b); 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 (t <= -1.35) tmp = x / ((y / (t / b)) + (a + 1.0)); elseif (t <= 1.6e-86) tmp = z / b; else tmp = x / (1.0 + (a + ((y * b) / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.35], N[(x / N[(N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.6e-86], N[(z / b), $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}\;t \leq -1.35:\\
\;\;\;\;\frac{x}{\frac{y}{\frac{t}{b}} + \left(a + 1\right)}\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{-86}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\end{array}
\end{array}
if t < -1.3500000000000001Initial program 79.9%
clear-num79.8%
associate-/r/79.8%
Applied egg-rr79.8%
Taylor expanded in x around inf 74.5%
associate-*l/74.5%
*-un-lft-identity74.5%
associate-*r/81.7%
clear-num81.6%
un-div-inv81.7%
Applied egg-rr81.7%
if -1.3500000000000001 < t < 1.60000000000000003e-86Initial program 59.0%
+-commutative59.0%
associate-/l*48.5%
fma-define48.5%
+-commutative48.5%
associate-/l*43.2%
fma-define43.2%
Simplified43.2%
Taylor expanded in y around inf 55.8%
if 1.60000000000000003e-86 < t Initial program 87.1%
+-commutative87.1%
associate-/l*89.8%
fma-define89.8%
+-commutative89.8%
associate-/l*89.8%
fma-define89.8%
Simplified89.8%
Taylor expanded in z around 0 64.3%
Final simplification64.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3.1e+58) (not (<= t 4.8e-86))) (/ x (+ a 1.0)) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.1e+58) || !(t <= 4.8e-86)) {
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 <= (-3.1d+58)) .or. (.not. (t <= 4.8d-86))) 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 <= -3.1e+58) || !(t <= 4.8e-86)) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3.1e+58) or not (t <= 4.8e-86): tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3.1e+58) || !(t <= 4.8e-86)) 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 <= -3.1e+58) || ~((t <= 4.8e-86))) 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, -3.1e+58], N[Not[LessEqual[t, 4.8e-86]], $MachinePrecision]], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{+58} \lor \neg \left(t \leq 4.8 \cdot 10^{-86}\right):\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -3.0999999999999999e58 or 4.80000000000000026e-86 < t Initial program 83.8%
+-commutative83.8%
associate-/l*88.4%
fma-define88.4%
+-commutative88.4%
associate-/l*92.3%
fma-define92.3%
Simplified92.3%
Taylor expanded in y around 0 65.1%
if -3.0999999999999999e58 < t < 4.80000000000000026e-86Initial program 60.4%
+-commutative60.4%
associate-/l*50.6%
fma-define50.6%
+-commutative50.6%
associate-/l*45.7%
fma-define45.7%
Simplified45.7%
Taylor expanded in y around inf 54.4%
Final simplification59.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -8.1e+71) (not (<= t 3.5e+84))) (/ x a) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -8.1e+71) || !(t <= 3.5e+84)) {
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 ((t <= (-8.1d+71)) .or. (.not. (t <= 3.5d+84))) 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 ((t <= -8.1e+71) || !(t <= 3.5e+84)) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -8.1e+71) or not (t <= 3.5e+84): tmp = x / a else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -8.1e+71) || !(t <= 3.5e+84)) 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 ((t <= -8.1e+71) || ~((t <= 3.5e+84))) tmp = x / a; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -8.1e+71], N[Not[LessEqual[t, 3.5e+84]], $MachinePrecision]], N[(x / a), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.1 \cdot 10^{+71} \lor \neg \left(t \leq 3.5 \cdot 10^{+84}\right):\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -8.10000000000000039e71 or 3.4999999999999999e84 < t Initial program 83.3%
associate-/l*88.5%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in a around inf 67.4%
Taylor expanded in y around 0 51.8%
if -8.10000000000000039e71 < t < 3.4999999999999999e84Initial program 65.4%
+-commutative65.4%
associate-/l*58.2%
fma-define58.2%
+-commutative58.2%
associate-/l*53.6%
fma-define53.6%
Simplified53.6%
Taylor expanded in y around inf 49.6%
Final simplification50.4%
(FPCore (x y z t a b) :precision binary64 (/ x a))
double code(double x, double y, double z, double t, double a, double b) {
return x / a;
}
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 / a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x / a;
}
def code(x, y, z, t, a, b): return x / a
function code(x, y, z, t, a, b) return Float64(x / a) end
function tmp = code(x, y, z, t, a, b) tmp = x / a; end
code[x_, y_, z_, t_, a_, b_] := N[(x / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{a}
\end{array}
Initial program 71.8%
associate-/l*69.1%
associate-/l*68.4%
Simplified68.4%
Taylor expanded in a around inf 50.4%
Taylor expanded in y around 0 26.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 2024145
(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))))