
(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 13 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))) (t_2 (/ t_1 (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_2 (- INFINITY))
(* (/ z t) (/ y (+ 1.0 (+ a (* y (/ b t))))))
(if (<= t_2 0.0)
(/ t_1 (+ (+ a 1.0) (/ y (/ t b))))
(if (<= t_2 1e+282)
t_2
(if (<= t_2 INFINITY)
(* (/ y t) (/ z (+ a (fma y (/ b t) 1.0))))
(+ (/ z b) (* (/ x b) (/ t y)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (z / t) * (y / (1.0 + (a + (y * (b / t)))));
} else if (t_2 <= 0.0) {
tmp = t_1 / ((a + 1.0) + (y / (t / b)));
} else if (t_2 <= 1e+282) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = (y / t) * (z / (a + fma(y, (b / t), 1.0)));
} else {
tmp = (z / b) + ((x / b) * (t / y));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(y * z) / t)) t_2 = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(z / t) * Float64(y / Float64(1.0 + Float64(a + Float64(y * Float64(b / t)))))); elseif (t_2 <= 0.0) tmp = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(y / Float64(t / b)))); elseif (t_2 <= 1e+282) tmp = t_2; elseif (t_2 <= Inf) tmp = Float64(Float64(y / t) * Float64(z / Float64(a + fma(y, Float64(b / t), 1.0)))); else tmp = Float64(Float64(z / b) + Float64(Float64(x / b) * Float64(t / y))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(z / t), $MachinePrecision] * N[(y / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+282], t$95$2, If[LessEqual[t$95$2, Infinity], N[(N[(y / t), $MachinePrecision] * N[(z / N[(a + N[(y * N[(b / t), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z / b), $MachinePrecision] + N[(N[(x / b), $MachinePrecision] * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
t_2 := \frac{t_1}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\frac{z}{t} \cdot \frac{y}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;\frac{t_1}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\
\mathbf{elif}\;t_2 \leq 10^{+282}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{a + \mathsf{fma}\left(y, \frac{b}{t}, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{x}{b} \cdot \frac{t}{y}\\
\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 28.9%
associate-/l*28.9%
Simplified28.9%
div-inv28.9%
associate-/l*64.6%
associate-/r/38.3%
+-commutative38.3%
associate-/r/64.6%
div-inv64.6%
clear-num64.6%
fma-def64.6%
Applied egg-rr64.6%
Taylor expanded in x around 0 40.3%
*-commutative40.3%
associate-+r+40.3%
+-commutative40.3%
associate-*r/40.3%
associate-+r+40.3%
fma-def40.3%
times-frac90.8%
fma-def90.8%
associate-+r+90.8%
associate-*r/90.8%
+-commutative90.8%
associate-+r+90.8%
associate-*r/90.8%
fma-def90.8%
Simplified90.8%
fma-udef90.8%
Applied egg-rr90.8%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0Initial program 83.4%
associate-/l*89.0%
Simplified89.0%
if 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1.00000000000000003e282Initial program 99.8%
if 1.00000000000000003e282 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 34.7%
+-commutative34.7%
associate-*l/58.4%
fma-def58.4%
associate-+l+58.4%
+-commutative58.4%
associate-*l/38.6%
fma-def38.6%
Simplified38.6%
Taylor expanded in z around inf 58.1%
times-frac88.0%
associate-+r+88.0%
associate-*r/88.0%
+-commutative88.0%
fma-def88.0%
+-commutative88.0%
Simplified88.0%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 0.0%
+-commutative0.0%
associate-*l/0.1%
fma-def0.1%
associate-+l+0.1%
+-commutative0.1%
associate-*l/5.0%
fma-def5.0%
Simplified5.0%
Taylor expanded in y around -inf 57.8%
+-commutative57.8%
associate-*r/57.8%
distribute-lft-out--57.8%
associate-*r*57.8%
metadata-eval57.8%
*-lft-identity57.8%
associate-/l*57.8%
associate-/l*62.3%
associate-/r*85.9%
unpow285.9%
Simplified85.9%
Taylor expanded in b around inf 95.2%
*-commutative95.2%
*-commutative95.2%
times-frac100.0%
Simplified100.0%
Final simplification93.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) t)))
(t_2 (/ t_1 (+ (+ a 1.0) (/ (* y b) t))))
(t_3 (* (/ z t) (/ y (+ 1.0 (+ a (* y (/ b t))))))))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 0.0)
(/ t_1 (+ (+ a 1.0) (/ y (/ t b))))
(if (<= t_2 1e+282)
t_2
(if (<= t_2 INFINITY) t_3 (+ (/ z b) (* (/ x b) (/ t y)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
double t_3 = (z / t) * (y / (1.0 + (a + (y * (b / t)))));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = t_1 / ((a + 1.0) + (y / (t / b)));
} else if (t_2 <= 1e+282) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = (z / b) + ((x / b) * (t / y));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
double t_3 = (z / t) * (y / (1.0 + (a + (y * (b / t)))));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = t_1 / ((a + 1.0) + (y / (t / b)));
} else if (t_2 <= 1e+282) {
tmp = t_2;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = (z / b) + ((x / b) * (t / y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + ((y * z) / t) t_2 = t_1 / ((a + 1.0) + ((y * b) / t)) t_3 = (z / t) * (y / (1.0 + (a + (y * (b / t))))) tmp = 0 if t_2 <= -math.inf: tmp = t_3 elif t_2 <= 0.0: tmp = t_1 / ((a + 1.0) + (y / (t / b))) elif t_2 <= 1e+282: tmp = t_2 elif t_2 <= math.inf: tmp = t_3 else: tmp = (z / b) + ((x / b) * (t / y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(y * z) / t)) t_2 = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) t_3 = Float64(Float64(z / t) * Float64(y / Float64(1.0 + Float64(a + Float64(y * Float64(b / t)))))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= 0.0) tmp = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(y / Float64(t / b)))); elseif (t_2 <= 1e+282) tmp = t_2; elseif (t_2 <= Inf) tmp = t_3; else tmp = Float64(Float64(z / b) + Float64(Float64(x / b) * Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + ((y * z) / t); t_2 = t_1 / ((a + 1.0) + ((y * b) / t)); t_3 = (z / t) * (y / (1.0 + (a + (y * (b / t))))); tmp = 0.0; if (t_2 <= -Inf) tmp = t_3; elseif (t_2 <= 0.0) tmp = t_1 / ((a + 1.0) + (y / (t / b))); elseif (t_2 <= 1e+282) tmp = t_2; elseif (t_2 <= Inf) tmp = t_3; else tmp = (z / b) + ((x / b) * (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z / t), $MachinePrecision] * N[(y / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, 0.0], N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+282], t$95$2, If[LessEqual[t$95$2, Infinity], t$95$3, N[(N[(z / b), $MachinePrecision] + N[(N[(x / b), $MachinePrecision] * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
t_2 := \frac{t_1}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_3 := \frac{z}{t} \cdot \frac{y}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;\frac{t_1}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\
\mathbf{elif}\;t_2 \leq 10^{+282}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{x}{b} \cdot \frac{t}{y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -inf.0 or 1.00000000000000003e282 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 31.8%
associate-/l*31.8%
Simplified31.8%
div-inv31.8%
associate-/l*61.5%
associate-/r/38.4%
+-commutative38.4%
associate-/r/61.5%
div-inv61.5%
clear-num61.5%
fma-def61.5%
Applied egg-rr61.5%
Taylor expanded in x around 0 49.2%
*-commutative49.2%
associate-+r+49.2%
+-commutative49.2%
associate-*r/49.1%
associate-+r+49.1%
fma-def49.1%
times-frac89.1%
fma-def89.1%
associate-+r+89.1%
associate-*r/89.1%
+-commutative89.1%
associate-+r+89.1%
associate-*r/89.1%
fma-def89.1%
Simplified89.1%
fma-udef89.1%
Applied egg-rr89.1%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0Initial program 83.4%
associate-/l*89.0%
Simplified89.0%
if 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1.00000000000000003e282Initial program 99.8%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 0.0%
+-commutative0.0%
associate-*l/0.1%
fma-def0.1%
associate-+l+0.1%
+-commutative0.1%
associate-*l/5.0%
fma-def5.0%
Simplified5.0%
Taylor expanded in y around -inf 57.8%
+-commutative57.8%
associate-*r/57.8%
distribute-lft-out--57.8%
associate-*r*57.8%
metadata-eval57.8%
*-lft-identity57.8%
associate-/l*57.8%
associate-/l*62.3%
associate-/r*85.9%
unpow285.9%
Simplified85.9%
Taylor expanded in b around inf 95.2%
*-commutative95.2%
*-commutative95.2%
times-frac100.0%
Simplified100.0%
Final simplification92.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.5e-99) (not (<= t 1.9e-68))) (/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* b (/ y t)))) (/ (+ z (/ (* x t) y)) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.5e-99) || !(t <= 1.9e-68)) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (b * (y / t)));
} else {
tmp = (z + ((x * t) / y)) / 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 <= (-2.5d-99)) .or. (.not. (t <= 1.9d-68))) then
tmp = (x + (y * (z / t))) / ((a + 1.0d0) + (b * (y / t)))
else
tmp = (z + ((x * t) / y)) / 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 <= -2.5e-99) || !(t <= 1.9e-68)) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (b * (y / t)));
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.5e-99) or not (t <= 1.9e-68): tmp = (x + (y * (z / t))) / ((a + 1.0) + (b * (y / t))) else: tmp = (z + ((x * t) / y)) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.5e-99) || !(t <= 1.9e-68)) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))); else tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -2.5e-99) || ~((t <= 1.9e-68))) tmp = (x + (y * (z / t))) / ((a + 1.0) + (b * (y / t))); else tmp = (z + ((x * t) / y)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.5e-99], N[Not[LessEqual[t, 1.9e-68]], $MachinePrecision]], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{-99} \lor \neg \left(t \leq 1.9 \cdot 10^{-68}\right):\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if t < -2.49999999999999985e-99 or 1.90000000000000019e-68 < t Initial program 81.5%
*-commutative81.5%
associate-/l*85.9%
associate-*l/90.5%
Simplified90.5%
associate-/r/90.1%
Applied egg-rr90.1%
if -2.49999999999999985e-99 < t < 1.90000000000000019e-68Initial program 63.2%
+-commutative63.2%
associate-*l/57.8%
fma-def57.8%
associate-+l+57.8%
+-commutative57.8%
associate-*l/51.1%
fma-def51.1%
Simplified51.1%
Taylor expanded in y around -inf 52.4%
+-commutative52.4%
associate-*r/52.4%
distribute-lft-out--52.4%
associate-*r*52.4%
metadata-eval52.4%
*-lft-identity52.4%
associate-/l*51.3%
associate-/l*48.4%
associate-/r*52.5%
unpow252.5%
Simplified52.5%
Taylor expanded in b around inf 69.8%
*-commutative69.8%
*-commutative69.8%
times-frac62.4%
Simplified62.4%
Taylor expanded in b around 0 69.9%
Final simplification82.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.26e+82)
(/ (+ z (/ (* x t) y)) b)
(if (<= y 3.5e+103)
(/ (+ x (/ z (/ t y))) (+ (+ a 1.0) (* b (/ y t))))
(/ (+ z (* x (/ t y))) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.26e+82) {
tmp = (z + ((x * t) / y)) / b;
} else if (y <= 3.5e+103) {
tmp = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t)));
} else {
tmp = (z + (x * (t / y))) / 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 <= (-1.26d+82)) then
tmp = (z + ((x * t) / y)) / b
else if (y <= 3.5d+103) then
tmp = (x + (z / (t / y))) / ((a + 1.0d0) + (b * (y / t)))
else
tmp = (z + (x * (t / y))) / 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 <= -1.26e+82) {
tmp = (z + ((x * t) / y)) / b;
} else if (y <= 3.5e+103) {
tmp = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t)));
} else {
tmp = (z + (x * (t / y))) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.26e+82: tmp = (z + ((x * t) / y)) / b elif y <= 3.5e+103: tmp = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t))) else: tmp = (z + (x * (t / y))) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.26e+82) tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); elseif (y <= 3.5e+103) tmp = Float64(Float64(x + Float64(z / Float64(t / y))) / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))); else tmp = Float64(Float64(z + Float64(x * Float64(t / y))) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.26e+82) tmp = (z + ((x * t) / y)) / b; elseif (y <= 3.5e+103) tmp = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t))); else tmp = (z + (x * (t / y))) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.26e+82], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[y, 3.5e+103], N[(N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(x * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.26 \cdot 10^{+82}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+103}:\\
\;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + x \cdot \frac{t}{y}}{b}\\
\end{array}
\end{array}
if y < -1.2600000000000001e82Initial program 39.6%
+-commutative39.6%
associate-*l/41.3%
fma-def41.3%
associate-+l+41.3%
+-commutative41.3%
associate-*l/38.0%
fma-def38.0%
Simplified38.0%
Taylor expanded in y around -inf 47.1%
+-commutative47.1%
associate-*r/47.1%
distribute-lft-out--47.1%
associate-*r*47.1%
metadata-eval47.1%
*-lft-identity47.1%
associate-/l*47.1%
associate-/l*42.9%
associate-/r*51.6%
unpow251.6%
Simplified51.6%
Taylor expanded in b around inf 65.6%
*-commutative65.6%
*-commutative65.6%
times-frac56.8%
Simplified56.8%
Taylor expanded in b around 0 67.7%
if -1.2600000000000001e82 < y < 3.5e103Initial program 91.3%
*-commutative91.3%
associate-/l*92.1%
associate-*l/93.2%
Simplified93.2%
if 3.5e103 < y Initial program 54.1%
+-commutative54.1%
associate-*l/53.7%
fma-def53.7%
associate-+l+53.7%
+-commutative53.7%
associate-*l/55.0%
fma-def55.0%
Simplified55.0%
Taylor expanded in y around -inf 50.7%
+-commutative50.7%
associate-*r/50.7%
distribute-lft-out--50.7%
associate-*r*50.7%
metadata-eval50.7%
*-lft-identity50.7%
associate-/l*54.3%
associate-/l*58.2%
associate-/r*62.0%
unpow262.0%
Simplified62.0%
Taylor expanded in b around inf 68.4%
*-commutative68.4%
*-commutative68.4%
times-frac69.7%
Simplified69.7%
Taylor expanded in b around 0 70.4%
+-commutative70.4%
*-commutative70.4%
associate-*r/74.0%
Simplified74.0%
Final simplification84.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -3.2e-25)
(/ (+ x (* y (/ z t))) (+ a 1.0))
(if (<= t 14000000.0)
(/ (+ z (/ (* x t) y)) b)
(+ (/ x (+ a 1.0)) (* (/ y t) (/ z (+ a 1.0)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.2e-25) {
tmp = (x + (y * (z / t))) / (a + 1.0);
} else if (t <= 14000000.0) {
tmp = (z + ((x * t) / y)) / b;
} else {
tmp = (x / (a + 1.0)) + ((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 (t <= (-3.2d-25)) then
tmp = (x + (y * (z / t))) / (a + 1.0d0)
else if (t <= 14000000.0d0) then
tmp = (z + ((x * t) / y)) / b
else
tmp = (x / (a + 1.0d0)) + ((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 (t <= -3.2e-25) {
tmp = (x + (y * (z / t))) / (a + 1.0);
} else if (t <= 14000000.0) {
tmp = (z + ((x * t) / y)) / b;
} else {
tmp = (x / (a + 1.0)) + ((y / t) * (z / (a + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.2e-25: tmp = (x + (y * (z / t))) / (a + 1.0) elif t <= 14000000.0: tmp = (z + ((x * t) / y)) / b else: tmp = (x / (a + 1.0)) + ((y / t) * (z / (a + 1.0))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.2e-25) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + 1.0)); elseif (t <= 14000000.0) tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); else tmp = Float64(Float64(x / Float64(a + 1.0)) + Float64(Float64(y / t) * Float64(z / Float64(a + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -3.2e-25) tmp = (x + (y * (z / t))) / (a + 1.0); elseif (t <= 14000000.0) tmp = (z + ((x * t) / y)) / b; else tmp = (x / (a + 1.0)) + ((y / t) * (z / (a + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.2e-25], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 14000000.0], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], N[(N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(y / t), $MachinePrecision] * N[(z / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{-25}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + 1}\\
\mathbf{elif}\;t \leq 14000000:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1} + \frac{y}{t} \cdot \frac{z}{a + 1}\\
\end{array}
\end{array}
if t < -3.2000000000000001e-25Initial program 84.4%
+-commutative84.4%
associate-*l/91.0%
fma-def91.0%
associate-+l+91.0%
+-commutative91.0%
associate-*l/95.0%
fma-def95.0%
Simplified95.0%
Taylor expanded in b around 0 75.6%
div-inv75.6%
Applied egg-rr75.6%
Taylor expanded in y around 0 75.6%
associate-*r/82.3%
Simplified82.3%
if -3.2000000000000001e-25 < t < 1.4e7Initial program 68.0%
+-commutative68.0%
associate-*l/63.0%
fma-def63.0%
associate-+l+63.0%
+-commutative63.0%
associate-*l/57.0%
fma-def57.0%
Simplified57.0%
Taylor expanded in y around -inf 51.6%
+-commutative51.6%
associate-*r/51.6%
distribute-lft-out--51.6%
associate-*r*51.6%
metadata-eval51.6%
*-lft-identity51.6%
associate-/l*50.8%
associate-/l*48.5%
associate-/r*54.0%
unpow254.0%
Simplified54.0%
Taylor expanded in b around inf 67.4%
*-commutative67.4%
*-commutative67.4%
times-frac62.5%
Simplified62.5%
Taylor expanded in b around 0 68.2%
if 1.4e7 < t Initial program 76.8%
+-commutative76.8%
associate-*l/83.4%
fma-def83.4%
associate-+l+83.4%
+-commutative83.4%
associate-*l/93.3%
fma-def93.3%
Simplified93.3%
Taylor expanded in b around 0 65.8%
Taylor expanded in y around 0 65.6%
times-frac74.1%
Simplified74.1%
Final simplification73.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.95e-33) (not (<= t 2700.0))) (/ (+ x (* y (/ z t))) (+ a 1.0)) (/ (+ z (/ (* x t) y)) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.95e-33) || !(t <= 2700.0)) {
tmp = (x + (y * (z / t))) / (a + 1.0);
} else {
tmp = (z + ((x * t) / y)) / 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 <= (-2.95d-33)) .or. (.not. (t <= 2700.0d0))) then
tmp = (x + (y * (z / t))) / (a + 1.0d0)
else
tmp = (z + ((x * t) / y)) / 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 <= -2.95e-33) || !(t <= 2700.0)) {
tmp = (x + (y * (z / t))) / (a + 1.0);
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.95e-33) or not (t <= 2700.0): tmp = (x + (y * (z / t))) / (a + 1.0) else: tmp = (z + ((x * t) / y)) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.95e-33) || !(t <= 2700.0)) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + 1.0)); else tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -2.95e-33) || ~((t <= 2700.0))) tmp = (x + (y * (z / t))) / (a + 1.0); else tmp = (z + ((x * t) / y)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.95e-33], N[Not[LessEqual[t, 2700.0]], $MachinePrecision]], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.95 \cdot 10^{-33} \lor \neg \left(t \leq 2700\right):\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if t < -2.94999999999999993e-33 or 2700 < t Initial program 81.0%
+-commutative81.0%
associate-*l/87.6%
fma-def87.6%
associate-+l+87.6%
+-commutative87.6%
associate-*l/94.2%
fma-def94.2%
Simplified94.2%
Taylor expanded in b around 0 71.3%
div-inv71.3%
Applied egg-rr71.3%
Taylor expanded in y around 0 71.3%
associate-*r/77.2%
Simplified77.2%
if -2.94999999999999993e-33 < t < 2700Initial program 68.0%
+-commutative68.0%
associate-*l/63.0%
fma-def63.0%
associate-+l+63.0%
+-commutative63.0%
associate-*l/57.0%
fma-def57.0%
Simplified57.0%
Taylor expanded in y around -inf 51.6%
+-commutative51.6%
associate-*r/51.6%
distribute-lft-out--51.6%
associate-*r*51.6%
metadata-eval51.6%
*-lft-identity51.6%
associate-/l*50.8%
associate-/l*48.5%
associate-/r*54.0%
unpow254.0%
Simplified54.0%
Taylor expanded in b around inf 67.4%
*-commutative67.4%
*-commutative67.4%
times-frac62.5%
Simplified62.5%
Taylor expanded in b around 0 68.2%
Final simplification72.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -4.6e+80)
(/ (+ z (/ (* x t) y)) b)
(if (<= y 1.46e+40)
(/ x (+ 1.0 (+ a (/ (* y b) t))))
(/ (+ z (* x (/ t y))) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.6e+80) {
tmp = (z + ((x * t) / y)) / b;
} else if (y <= 1.46e+40) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else {
tmp = (z + (x * (t / y))) / 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 <= (-4.6d+80)) then
tmp = (z + ((x * t) / y)) / b
else if (y <= 1.46d+40) then
tmp = x / (1.0d0 + (a + ((y * b) / t)))
else
tmp = (z + (x * (t / y))) / 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 <= -4.6e+80) {
tmp = (z + ((x * t) / y)) / b;
} else if (y <= 1.46e+40) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else {
tmp = (z + (x * (t / y))) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -4.6e+80: tmp = (z + ((x * t) / y)) / b elif y <= 1.46e+40: tmp = x / (1.0 + (a + ((y * b) / t))) else: tmp = (z + (x * (t / y))) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4.6e+80) tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); elseif (y <= 1.46e+40) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); else tmp = Float64(Float64(z + Float64(x * Float64(t / y))) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -4.6e+80) tmp = (z + ((x * t) / y)) / b; elseif (y <= 1.46e+40) tmp = x / (1.0 + (a + ((y * b) / t))); else tmp = (z + (x * (t / y))) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.6e+80], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[y, 1.46e+40], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(x * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+80}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{elif}\;y \leq 1.46 \cdot 10^{+40}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + x \cdot \frac{t}{y}}{b}\\
\end{array}
\end{array}
if y < -4.60000000000000008e80Initial program 39.6%
+-commutative39.6%
associate-*l/41.3%
fma-def41.3%
associate-+l+41.3%
+-commutative41.3%
associate-*l/38.0%
fma-def38.0%
Simplified38.0%
Taylor expanded in y around -inf 47.1%
+-commutative47.1%
associate-*r/47.1%
distribute-lft-out--47.1%
associate-*r*47.1%
metadata-eval47.1%
*-lft-identity47.1%
associate-/l*47.1%
associate-/l*42.9%
associate-/r*51.6%
unpow251.6%
Simplified51.6%
Taylor expanded in b around inf 65.6%
*-commutative65.6%
*-commutative65.6%
times-frac56.8%
Simplified56.8%
Taylor expanded in b around 0 67.7%
if -4.60000000000000008e80 < y < 1.46e40Initial program 93.2%
+-commutative93.2%
associate-*l/93.9%
fma-def93.9%
associate-+l+93.9%
+-commutative93.9%
associate-*l/94.5%
fma-def94.5%
Simplified94.5%
Taylor expanded in z around 0 74.0%
if 1.46e40 < y Initial program 56.0%
+-commutative56.0%
associate-*l/57.2%
fma-def57.2%
associate-+l+57.2%
+-commutative57.2%
associate-*l/59.8%
fma-def59.8%
Simplified59.8%
Taylor expanded in y around -inf 48.2%
+-commutative48.2%
associate-*r/48.2%
distribute-lft-out--48.2%
associate-*r*48.2%
metadata-eval48.2%
*-lft-identity48.2%
associate-/l*51.2%
associate-/l*57.5%
associate-/r*60.7%
unpow260.7%
Simplified60.7%
Taylor expanded in b around inf 66.2%
*-commutative66.2%
*-commutative66.2%
times-frac68.8%
Simplified68.8%
Taylor expanded in b around 0 67.9%
+-commutative67.9%
*-commutative67.9%
associate-*r/70.9%
Simplified70.9%
Final simplification72.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.25e+19) (not (<= y 5.6e-34))) (/ (+ z (* x (/ t y))) b) (/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.25e+19) || !(y <= 5.6e-34)) {
tmp = (z + (x * (t / y))) / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.25d+19)) .or. (.not. (y <= 5.6d-34))) then
tmp = (z + (x * (t / y))) / b
else
tmp = x / (a + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.25e+19) || !(y <= 5.6e-34)) {
tmp = (z + (x * (t / y))) / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.25e+19) or not (y <= 5.6e-34): tmp = (z + (x * (t / y))) / b else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.25e+19) || !(y <= 5.6e-34)) tmp = Float64(Float64(z + Float64(x * Float64(t / y))) / b); else tmp = Float64(x / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.25e+19) || ~((y <= 5.6e-34))) tmp = (z + (x * (t / y))) / b; else tmp = x / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.25e+19], N[Not[LessEqual[y, 5.6e-34]], $MachinePrecision]], N[(N[(z + N[(x * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+19} \lor \neg \left(y \leq 5.6 \cdot 10^{-34}\right):\\
\;\;\;\;\frac{z + x \cdot \frac{t}{y}}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -1.25e19 or 5.59999999999999994e-34 < y Initial program 57.1%
+-commutative57.1%
associate-*l/58.2%
fma-def58.2%
associate-+l+58.2%
+-commutative58.2%
associate-*l/59.0%
fma-def59.0%
Simplified59.0%
Taylor expanded in y around -inf 48.4%
+-commutative48.4%
associate-*r/48.4%
distribute-lft-out--48.4%
associate-*r*48.4%
metadata-eval48.4%
*-lft-identity48.4%
associate-/l*49.8%
associate-/l*51.4%
associate-/r*55.7%
unpow255.7%
Simplified55.7%
Taylor expanded in b around inf 63.6%
*-commutative63.6%
*-commutative63.6%
times-frac62.0%
Simplified62.0%
Taylor expanded in b around 0 65.1%
+-commutative65.1%
*-commutative65.1%
associate-*r/66.5%
Simplified66.5%
if -1.25e19 < y < 5.59999999999999994e-34Initial program 94.5%
+-commutative94.5%
associate-*l/95.3%
fma-def95.3%
associate-+l+95.3%
+-commutative95.3%
associate-*l/95.3%
fma-def95.3%
Simplified95.3%
Taylor expanded in y around 0 68.6%
Final simplification67.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.7e+23) (/ (+ z (/ (* x t) y)) b) (if (<= y 1.25e-33) (/ x (+ a 1.0)) (/ (+ z (* x (/ t y))) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.7e+23) {
tmp = (z + ((x * t) / y)) / b;
} else if (y <= 1.25e-33) {
tmp = x / (a + 1.0);
} else {
tmp = (z + (x * (t / y))) / 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.7d+23)) then
tmp = (z + ((x * t) / y)) / b
else if (y <= 1.25d-33) then
tmp = x / (a + 1.0d0)
else
tmp = (z + (x * (t / y))) / 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.7e+23) {
tmp = (z + ((x * t) / y)) / b;
} else if (y <= 1.25e-33) {
tmp = x / (a + 1.0);
} else {
tmp = (z + (x * (t / y))) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.7e+23: tmp = (z + ((x * t) / y)) / b elif y <= 1.25e-33: tmp = x / (a + 1.0) else: tmp = (z + (x * (t / y))) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.7e+23) tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); elseif (y <= 1.25e-33) tmp = Float64(x / Float64(a + 1.0)); else tmp = Float64(Float64(z + Float64(x * Float64(t / y))) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.7e+23) tmp = (z + ((x * t) / y)) / b; elseif (y <= 1.25e-33) tmp = x / (a + 1.0); else tmp = (z + (x * (t / y))) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.7e+23], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[y, 1.25e-33], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(x * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{+23}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-33}:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + x \cdot \frac{t}{y}}{b}\\
\end{array}
\end{array}
if y < -2.6999999999999999e23Initial program 48.2%
+-commutative48.2%
associate-*l/49.5%
fma-def49.5%
associate-+l+49.5%
+-commutative49.5%
associate-*l/48.5%
fma-def48.5%
Simplified48.5%
Taylor expanded in y around -inf 47.9%
+-commutative47.9%
associate-*r/47.9%
distribute-lft-out--47.9%
associate-*r*47.9%
metadata-eval47.9%
*-lft-identity47.9%
associate-/l*48.1%
associate-/l*44.8%
associate-/r*51.6%
unpow251.6%
Simplified51.6%
Taylor expanded in b around inf 62.6%
*-commutative62.6%
*-commutative62.6%
times-frac56.0%
Simplified56.0%
Taylor expanded in b around 0 64.3%
if -2.6999999999999999e23 < y < 1.25000000000000007e-33Initial program 94.5%
+-commutative94.5%
associate-*l/95.3%
fma-def95.3%
associate-+l+95.3%
+-commutative95.3%
associate-*l/95.3%
fma-def95.3%
Simplified95.3%
Taylor expanded in y around 0 68.6%
if 1.25000000000000007e-33 < y Initial program 63.6%
+-commutative63.6%
associate-*l/64.6%
fma-def64.6%
associate-+l+64.6%
+-commutative64.6%
associate-*l/66.6%
fma-def66.6%
Simplified66.6%
Taylor expanded in y around -inf 48.7%
+-commutative48.7%
associate-*r/48.7%
distribute-lft-out--48.7%
associate-*r*48.7%
metadata-eval48.7%
*-lft-identity48.7%
associate-/l*51.1%
associate-/l*56.2%
associate-/r*58.7%
unpow258.7%
Simplified58.7%
Taylor expanded in b around inf 64.3%
*-commutative64.3%
*-commutative64.3%
times-frac66.4%
Simplified66.4%
Taylor expanded in b around 0 65.7%
+-commutative65.7%
*-commutative65.7%
associate-*r/68.1%
Simplified68.1%
Final simplification67.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -6.5e+109)
(/ x a)
(if (<= a 1e-242)
(/ z b)
(if (<= a 3e-35) x (if (<= a 9e+30) (/ z b) (/ x a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -6.5e+109) {
tmp = x / a;
} else if (a <= 1e-242) {
tmp = z / b;
} else if (a <= 3e-35) {
tmp = x;
} else if (a <= 9e+30) {
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 <= (-6.5d+109)) then
tmp = x / a
else if (a <= 1d-242) then
tmp = z / b
else if (a <= 3d-35) then
tmp = x
else if (a <= 9d+30) 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 <= -6.5e+109) {
tmp = x / a;
} else if (a <= 1e-242) {
tmp = z / b;
} else if (a <= 3e-35) {
tmp = x;
} else if (a <= 9e+30) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -6.5e+109: tmp = x / a elif a <= 1e-242: tmp = z / b elif a <= 3e-35: tmp = x elif a <= 9e+30: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -6.5e+109) tmp = Float64(x / a); elseif (a <= 1e-242) tmp = Float64(z / b); elseif (a <= 3e-35) tmp = x; elseif (a <= 9e+30) 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 <= -6.5e+109) tmp = x / a; elseif (a <= 1e-242) tmp = z / b; elseif (a <= 3e-35) tmp = x; elseif (a <= 9e+30) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -6.5e+109], N[(x / a), $MachinePrecision], If[LessEqual[a, 1e-242], N[(z / b), $MachinePrecision], If[LessEqual[a, 3e-35], x, If[LessEqual[a, 9e+30], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.5 \cdot 10^{+109}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq 10^{-242}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq 3 \cdot 10^{-35}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 9 \cdot 10^{+30}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -6.5e109 or 8.9999999999999999e30 < a Initial program 74.5%
+-commutative74.5%
associate-*l/75.3%
fma-def75.3%
associate-+l+75.3%
+-commutative75.3%
associate-*l/76.6%
fma-def76.6%
Simplified76.6%
Taylor expanded in y around 0 56.6%
Taylor expanded in a around inf 56.6%
if -6.5e109 < a < 1e-242 or 2.99999999999999989e-35 < a < 8.9999999999999999e30Initial program 67.6%
+-commutative67.6%
associate-*l/68.3%
fma-def68.3%
associate-+l+68.3%
+-commutative68.3%
associate-*l/69.0%
fma-def69.0%
Simplified69.0%
Taylor expanded in y around inf 50.6%
if 1e-242 < a < 2.99999999999999989e-35Initial program 90.9%
+-commutative90.9%
associate-*l/93.1%
fma-def93.1%
associate-+l+93.1%
+-commutative93.1%
associate-*l/90.6%
fma-def90.7%
Simplified90.7%
Taylor expanded in y around 0 50.4%
Taylor expanded in a around 0 50.4%
Final simplification53.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y -3.6e+25) (/ z b) (if (<= y 1.02e+42) (/ x (+ a 1.0)) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.6e+25) {
tmp = z / b;
} else if (y <= 1.02e+42) {
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 (y <= (-3.6d+25)) then
tmp = z / b
else if (y <= 1.02d+42) 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 (y <= -3.6e+25) {
tmp = z / b;
} else if (y <= 1.02e+42) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3.6e+25: tmp = z / b elif y <= 1.02e+42: tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.6e+25) tmp = Float64(z / b); elseif (y <= 1.02e+42) 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 (y <= -3.6e+25) tmp = z / b; elseif (y <= 1.02e+42) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.6e+25], N[(z / b), $MachinePrecision], If[LessEqual[y, 1.02e+42], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{+25}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{+42}:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -3.60000000000000015e25 or 1.01999999999999996e42 < y Initial program 52.3%
+-commutative52.3%
associate-*l/53.5%
fma-def53.5%
associate-+l+53.5%
+-commutative53.5%
associate-*l/54.4%
fma-def54.4%
Simplified54.4%
Taylor expanded in y around inf 59.4%
if -3.60000000000000015e25 < y < 1.01999999999999996e42Initial program 94.4%
+-commutative94.4%
associate-*l/95.1%
fma-def95.1%
associate-+l+95.1%
+-commutative95.1%
associate-*l/95.1%
fma-def95.1%
Simplified95.1%
Taylor expanded in y around 0 65.2%
Final simplification62.5%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.15e+76) (/ x a) (if (<= a 8e-26) x (/ x a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.15e+76) {
tmp = x / a;
} else if (a <= 8e-26) {
tmp = x;
} 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.15d+76)) then
tmp = x / a
else if (a <= 8d-26) then
tmp = x
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.15e+76) {
tmp = x / a;
} else if (a <= 8e-26) {
tmp = x;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.15e+76: tmp = x / a elif a <= 8e-26: tmp = x else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.15e+76) tmp = Float64(x / a); elseif (a <= 8e-26) tmp = x; 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.15e+76) tmp = x / a; elseif (a <= 8e-26) tmp = x; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.15e+76], N[(x / a), $MachinePrecision], If[LessEqual[a, 8e-26], x, N[(x / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.15 \cdot 10^{+76}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq 8 \cdot 10^{-26}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -1.15000000000000001e76 or 8.0000000000000003e-26 < a Initial program 72.7%
+-commutative72.7%
associate-*l/74.1%
fma-def74.1%
associate-+l+74.1%
+-commutative74.1%
associate-*l/75.3%
fma-def75.3%
Simplified75.3%
Taylor expanded in y around 0 52.3%
Taylor expanded in a around inf 52.3%
if -1.15000000000000001e76 < a < 8.0000000000000003e-26Initial program 76.6%
+-commutative76.6%
associate-*l/77.0%
fma-def77.0%
associate-+l+77.0%
+-commutative77.0%
associate-*l/76.8%
fma-def76.8%
Simplified76.8%
Taylor expanded in y around 0 32.5%
Taylor expanded in a around 0 32.5%
Final simplification42.3%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 74.6%
+-commutative74.6%
associate-*l/75.6%
fma-def75.6%
associate-+l+75.6%
+-commutative75.6%
associate-*l/76.0%
fma-def76.0%
Simplified76.0%
Taylor expanded in y around 0 42.2%
Taylor expanded in a around 0 18.4%
Final simplification18.4%
(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 2023196
(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))))