
(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 12 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 (+ a t_1)))
(if (<= t_2 (- INFINITY))
(* z (+ (/ x (* z t_3)) (/ y (* t t_3))))
(if (<= t_2 2e+284) t_2 (/ 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 = a + t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = z * ((x / (z * t_3)) + (y / (t * t_3)));
} else if (t_2 <= 2e+284) {
tmp = t_2;
} 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 = a + t_1;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = z * ((x / (z * t_3)) + (y / (t * t_3)));
} else if (t_2 <= 2e+284) {
tmp = t_2;
} 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 = a + t_1 tmp = 0 if t_2 <= -math.inf: tmp = z * ((x / (z * t_3)) + (y / (t * t_3))) elif t_2 <= 2e+284: tmp = t_2 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(a + t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(z * Float64(Float64(x / Float64(z * t_3)) + Float64(y / Float64(t * t_3)))); elseif (t_2 <= 2e+284) tmp = t_2; 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 = a + t_1; tmp = 0.0; if (t_2 <= -Inf) tmp = z * ((x / (z * t_3)) + (y / (t * t_3))); elseif (t_2 <= 2e+284) tmp = t_2; 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[(a + t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], 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, 2e+284], t$95$2, 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 := a + t\_1\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;z \cdot \left(\frac{x}{z \cdot t\_3} + \frac{y}{t \cdot t\_3}\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+284}:\\
\;\;\;\;t\_2\\
\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.0Initial program 39.7%
associate-/l*53.4%
associate-/l*53.4%
Simplified53.4%
Taylor expanded in a around inf 53.4%
Taylor expanded in z around inf 92.6%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2.00000000000000016e284Initial program 91.6%
if 2.00000000000000016e284 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 11.6%
+-commutative11.6%
associate-/l*11.9%
fma-define11.9%
+-commutative11.9%
associate-/l*20.1%
fma-define20.1%
Simplified20.1%
Taylor expanded in y around inf 91.1%
Final simplification91.5%
(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 (- INFINITY))
(/ (* y z) (+ (* y b) (* t a)))
(if (<= t_1 2e+284) 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 <= -((double) INFINITY)) {
tmp = (y * z) / ((y * b) + (t * a));
} else if (t_1 <= 2e+284) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (y * z) / ((y * b) + (t * a));
} else if (t_1 <= 2e+284) {
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 <= -math.inf: tmp = (y * z) / ((y * b) + (t * a)) elif t_1 <= 2e+284: 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 <= Float64(-Inf)) tmp = Float64(Float64(y * z) / Float64(Float64(y * b) + Float64(t * a))); elseif (t_1 <= 2e+284) 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 <= -Inf) tmp = (y * z) / ((y * b) + (t * a)); elseif (t_1 <= 2e+284) 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, (-Infinity)], N[(N[(y * z), $MachinePrecision] / N[(N[(y * b), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+284], 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 -\infty:\\
\;\;\;\;\frac{y \cdot z}{y \cdot b + t \cdot a}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+284}:\\
\;\;\;\;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))) < -inf.0Initial program 39.7%
associate-/l*53.4%
associate-/l*53.4%
Simplified53.4%
Taylor expanded in a around inf 53.4%
Taylor expanded in x around 0 72.0%
Taylor expanded in t around 0 72.1%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2.00000000000000016e284Initial program 91.6%
if 2.00000000000000016e284 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 11.6%
+-commutative11.6%
associate-/l*11.9%
fma-define11.9%
+-commutative11.9%
associate-/l*20.1%
fma-define20.1%
Simplified20.1%
Taylor expanded in y around inf 91.1%
Final simplification90.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (/ (+ 1.0 (/ (/ (* x t) y) z)) b))))
(if (<= y -5600000000000.0)
t_1
(if (<= y -7.8e-205)
(/ x (+ 1.0 (+ a (/ (* y b) t))))
(if (<= y 4.2e+86) (/ (+ x (* z (/ 1.0 (/ t y)))) (+ a 1.0)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * ((1.0 + (((x * t) / y) / z)) / b);
double tmp;
if (y <= -5600000000000.0) {
tmp = t_1;
} else if (y <= -7.8e-205) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (y <= 4.2e+86) {
tmp = (x + (z * (1.0 / (t / y)))) / (a + 1.0);
} 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 = z * ((1.0d0 + (((x * t) / y) / z)) / b)
if (y <= (-5600000000000.0d0)) then
tmp = t_1
else if (y <= (-7.8d-205)) then
tmp = x / (1.0d0 + (a + ((y * b) / t)))
else if (y <= 4.2d+86) then
tmp = (x + (z * (1.0d0 / (t / y)))) / (a + 1.0d0)
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 = z * ((1.0 + (((x * t) / y) / z)) / b);
double tmp;
if (y <= -5600000000000.0) {
tmp = t_1;
} else if (y <= -7.8e-205) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (y <= 4.2e+86) {
tmp = (x + (z * (1.0 / (t / y)))) / (a + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * ((1.0 + (((x * t) / y) / z)) / b) tmp = 0 if y <= -5600000000000.0: tmp = t_1 elif y <= -7.8e-205: tmp = x / (1.0 + (a + ((y * b) / t))) elif y <= 4.2e+86: tmp = (x + (z * (1.0 / (t / y)))) / (a + 1.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(Float64(1.0 + Float64(Float64(Float64(x * t) / y) / z)) / b)) tmp = 0.0 if (y <= -5600000000000.0) tmp = t_1; elseif (y <= -7.8e-205) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); elseif (y <= 4.2e+86) tmp = Float64(Float64(x + Float64(z * Float64(1.0 / Float64(t / y)))) / Float64(a + 1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * ((1.0 + (((x * t) / y) / z)) / b); tmp = 0.0; if (y <= -5600000000000.0) tmp = t_1; elseif (y <= -7.8e-205) tmp = x / (1.0 + (a + ((y * b) / t))); elseif (y <= 4.2e+86) tmp = (x + (z * (1.0 / (t / y)))) / (a + 1.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(N[(1.0 + N[(N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5600000000000.0], t$95$1, If[LessEqual[y, -7.8e-205], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e+86], N[(N[(x + N[(z * N[(1.0 / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{1 + \frac{\frac{x \cdot t}{y}}{z}}{b}\\
\mathbf{if}\;y \leq -5600000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -7.8 \cdot 10^{-205}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+86}:\\
\;\;\;\;\frac{x + z \cdot \frac{1}{\frac{t}{y}}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.6e12 or 4.1999999999999998e86 < y Initial program 48.9%
associate-/l*50.7%
associate-/l*59.1%
Simplified59.1%
Taylor expanded in a around inf 48.2%
Taylor expanded in z around inf 48.1%
Taylor expanded in b around inf 70.5%
associate-/r*71.4%
Simplified71.4%
if -5.6e12 < y < -7.80000000000000036e-205Initial program 95.7%
+-commutative95.7%
associate-/l*89.4%
fma-define89.4%
+-commutative89.4%
associate-/l*85.0%
fma-define85.0%
Simplified85.0%
Taylor expanded in z around 0 73.8%
if -7.80000000000000036e-205 < y < 4.1999999999999998e86Initial program 94.0%
+-commutative94.0%
associate-/l*89.0%
fma-define89.0%
+-commutative89.0%
associate-/l*85.0%
fma-define85.0%
Simplified85.0%
Taylor expanded in b around 0 80.5%
*-commutative94.0%
associate-/l*93.9%
Applied egg-rr80.5%
clear-num80.6%
inv-pow80.6%
Applied egg-rr80.6%
unpow-180.6%
Simplified80.6%
Final simplification75.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (/ (+ 1.0 (/ (/ (* x t) y) z)) b))))
(if (<= y -1000000000000.0)
t_1
(if (<= y -1.28e-204)
(/ x (+ 1.0 (+ a (/ (* y b) t))))
(if (<= y 4.5e+86) (/ (+ x (/ (* y z) t)) (+ a 1.0)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * ((1.0 + (((x * t) / y) / z)) / b);
double tmp;
if (y <= -1000000000000.0) {
tmp = t_1;
} else if (y <= -1.28e-204) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (y <= 4.5e+86) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} 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 = z * ((1.0d0 + (((x * t) / y) / z)) / b)
if (y <= (-1000000000000.0d0)) then
tmp = t_1
else if (y <= (-1.28d-204)) then
tmp = x / (1.0d0 + (a + ((y * b) / t)))
else if (y <= 4.5d+86) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
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 = z * ((1.0 + (((x * t) / y) / z)) / b);
double tmp;
if (y <= -1000000000000.0) {
tmp = t_1;
} else if (y <= -1.28e-204) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (y <= 4.5e+86) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * ((1.0 + (((x * t) / y) / z)) / b) tmp = 0 if y <= -1000000000000.0: tmp = t_1 elif y <= -1.28e-204: tmp = x / (1.0 + (a + ((y * b) / t))) elif y <= 4.5e+86: tmp = (x + ((y * z) / t)) / (a + 1.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(Float64(1.0 + Float64(Float64(Float64(x * t) / y) / z)) / b)) tmp = 0.0 if (y <= -1000000000000.0) tmp = t_1; elseif (y <= -1.28e-204) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); elseif (y <= 4.5e+86) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * ((1.0 + (((x * t) / y) / z)) / b); tmp = 0.0; if (y <= -1000000000000.0) tmp = t_1; elseif (y <= -1.28e-204) tmp = x / (1.0 + (a + ((y * b) / t))); elseif (y <= 4.5e+86) tmp = (x + ((y * z) / t)) / (a + 1.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(N[(1.0 + N[(N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1000000000000.0], t$95$1, If[LessEqual[y, -1.28e-204], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e+86], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{1 + \frac{\frac{x \cdot t}{y}}{z}}{b}\\
\mathbf{if}\;y \leq -1000000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.28 \cdot 10^{-204}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+86}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1e12 or 4.49999999999999993e86 < y Initial program 48.9%
associate-/l*50.7%
associate-/l*59.1%
Simplified59.1%
Taylor expanded in a around inf 48.2%
Taylor expanded in z around inf 48.1%
Taylor expanded in b around inf 70.5%
associate-/r*71.4%
Simplified71.4%
if -1e12 < y < -1.28000000000000004e-204Initial program 95.7%
+-commutative95.7%
associate-/l*89.4%
fma-define89.4%
+-commutative89.4%
associate-/l*85.0%
fma-define85.0%
Simplified85.0%
Taylor expanded in z around 0 73.8%
if -1.28000000000000004e-204 < y < 4.49999999999999993e86Initial program 94.0%
+-commutative94.0%
associate-/l*89.0%
fma-define89.0%
+-commutative89.0%
associate-/l*85.0%
fma-define85.0%
Simplified85.0%
Taylor expanded in b around 0 80.5%
Final simplification75.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.9e+58) (not (<= y 2.2e+88))) (* z (/ (+ 1.0 (/ (/ (* x t) y) z)) b)) (/ (+ x (* z (/ y 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 <= -3.9e+58) || !(y <= 2.2e+88)) {
tmp = z * ((1.0 + (((x * t) / y) / z)) / b);
} else {
tmp = (x + (z * (y / 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 <= (-3.9d+58)) .or. (.not. (y <= 2.2d+88))) then
tmp = z * ((1.0d0 + (((x * t) / y) / z)) / b)
else
tmp = (x + (z * (y / 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 <= -3.9e+58) || !(y <= 2.2e+88)) {
tmp = z * ((1.0 + (((x * t) / y) / z)) / b);
} else {
tmp = (x + (z * (y / t))) / (((y * b) / t) + (a + 1.0));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3.9e+58) or not (y <= 2.2e+88): tmp = z * ((1.0 + (((x * t) / y) / z)) / b) else: tmp = (x + (z * (y / t))) / (((y * b) / t) + (a + 1.0)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.9e+58) || !(y <= 2.2e+88)) tmp = Float64(z * Float64(Float64(1.0 + Float64(Float64(Float64(x * t) / y) / z)) / b)); else tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(Float64(Float64(y * 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 <= -3.9e+58) || ~((y <= 2.2e+88))) tmp = z * ((1.0 + (((x * t) / y) / z)) / b); else tmp = (x + (z * (y / t))) / (((y * b) / t) + (a + 1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.9e+58], N[Not[LessEqual[y, 2.2e+88]], $MachinePrecision]], N[(z * N[(N[(1.0 + N[(N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.9 \cdot 10^{+58} \lor \neg \left(y \leq 2.2 \cdot 10^{+88}\right):\\
\;\;\;\;z \cdot \frac{1 + \frac{\frac{x \cdot t}{y}}{z}}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\end{array}
\end{array}
if y < -3.9000000000000001e58 or 2.20000000000000009e88 < y Initial program 42.0%
associate-/l*44.1%
associate-/l*53.9%
Simplified53.9%
Taylor expanded in a around inf 42.1%
Taylor expanded in z around inf 40.2%
Taylor expanded in b around inf 72.3%
associate-/r*73.3%
Simplified73.3%
if -3.9000000000000001e58 < y < 2.20000000000000009e88Initial program 93.9%
*-commutative93.9%
associate-/l*93.9%
Applied egg-rr93.9%
Final simplification86.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.25e-26) (not (<= t 2.4e-174))) (/ (+ x (* y (/ z t))) (+ (* y (/ b t)) (+ a 1.0))) (* z (/ (+ 1.0 (/ (/ (* x t) y) z)) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.25e-26) || !(t <= 2.4e-174)) {
tmp = (x + (y * (z / t))) / ((y * (b / t)) + (a + 1.0));
} else {
tmp = z * ((1.0 + (((x * t) / y) / 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 <= (-1.25d-26)) .or. (.not. (t <= 2.4d-174))) then
tmp = (x + (y * (z / t))) / ((y * (b / t)) + (a + 1.0d0))
else
tmp = z * ((1.0d0 + (((x * t) / y) / 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 <= -1.25e-26) || !(t <= 2.4e-174)) {
tmp = (x + (y * (z / t))) / ((y * (b / t)) + (a + 1.0));
} else {
tmp = z * ((1.0 + (((x * t) / y) / z)) / b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.25e-26) or not (t <= 2.4e-174): tmp = (x + (y * (z / t))) / ((y * (b / t)) + (a + 1.0)) else: tmp = z * ((1.0 + (((x * t) / y) / z)) / b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.25e-26) || !(t <= 2.4e-174)) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(y * Float64(b / t)) + Float64(a + 1.0))); else tmp = Float64(z * Float64(Float64(1.0 + Float64(Float64(Float64(x * t) / y) / z)) / b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.25e-26) || ~((t <= 2.4e-174))) tmp = (x + (y * (z / t))) / ((y * (b / t)) + (a + 1.0)); else tmp = z * ((1.0 + (((x * t) / y) / z)) / b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.25e-26], N[Not[LessEqual[t, 2.4e-174]], $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], N[(z * N[(N[(1.0 + N[(N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{-26} \lor \neg \left(t \leq 2.4 \cdot 10^{-174}\right):\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{y \cdot \frac{b}{t} + \left(a + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{1 + \frac{\frac{x \cdot t}{y}}{z}}{b}\\
\end{array}
\end{array}
if t < -1.25000000000000005e-26 or 2.4e-174 < t Initial program 83.4%
associate-/l*83.4%
associate-/l*88.7%
Simplified88.7%
if -1.25000000000000005e-26 < t < 2.4e-174Initial program 57.4%
associate-/l*51.2%
associate-/l*46.1%
Simplified46.1%
Taylor expanded in a around inf 43.0%
Taylor expanded in z around inf 63.9%
Taylor expanded in b around inf 70.1%
associate-/r*73.5%
Simplified73.5%
Final simplification83.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.08e+49)
(/ z b)
(if (<= y -1.22e-204)
(/ x (+ 1.0 (+ a (/ (* y b) t))))
(if (<= y 2.15e+86) (/ (+ x (/ (* y z) t)) (+ a 1.0)) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.08e+49) {
tmp = z / b;
} else if (y <= -1.22e-204) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (y <= 2.15e+86) {
tmp = (x + ((y * z) / 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 <= (-1.08d+49)) then
tmp = z / b
else if (y <= (-1.22d-204)) then
tmp = x / (1.0d0 + (a + ((y * b) / t)))
else if (y <= 2.15d+86) then
tmp = (x + ((y * z) / 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 <= -1.08e+49) {
tmp = z / b;
} else if (y <= -1.22e-204) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (y <= 2.15e+86) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.08e+49: tmp = z / b elif y <= -1.22e-204: tmp = x / (1.0 + (a + ((y * b) / t))) elif y <= 2.15e+86: tmp = (x + ((y * z) / t)) / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.08e+49) tmp = Float64(z / b); elseif (y <= -1.22e-204) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); elseif (y <= 2.15e+86) tmp = Float64(Float64(x + Float64(Float64(y * z) / 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 <= -1.08e+49) tmp = z / b; elseif (y <= -1.22e-204) tmp = x / (1.0 + (a + ((y * b) / t))); elseif (y <= 2.15e+86) tmp = (x + ((y * z) / t)) / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.08e+49], N[(z / b), $MachinePrecision], If[LessEqual[y, -1.22e-204], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.15e+86], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.08 \cdot 10^{+49}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -1.22 \cdot 10^{-204}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{+86}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.08000000000000001e49 or 2.1500000000000001e86 < y Initial program 44.2%
+-commutative44.2%
associate-/l*46.2%
fma-define46.2%
+-commutative46.2%
associate-/l*55.7%
fma-define55.7%
Simplified55.7%
Taylor expanded in y around inf 67.1%
if -1.08000000000000001e49 < y < -1.22000000000000005e-204Initial program 93.5%
+-commutative93.5%
associate-/l*88.6%
fma-define88.6%
+-commutative88.6%
associate-/l*85.3%
fma-define85.3%
Simplified85.3%
Taylor expanded in z around 0 69.6%
if -1.22000000000000005e-204 < y < 2.1500000000000001e86Initial program 94.0%
+-commutative94.0%
associate-/l*89.0%
fma-define89.0%
+-commutative89.0%
associate-/l*85.0%
fma-define85.0%
Simplified85.0%
Taylor expanded in b around 0 80.5%
Final simplification72.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -6.5e+49)
(/ z b)
(if (<= y -4.6e-205)
(/ x (+ 1.0 (+ a (/ (* y b) t))))
(if (<= y 3.2e+86) (/ (+ x (* z (/ y t))) (+ a 1.0)) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -6.5e+49) {
tmp = z / b;
} else if (y <= -4.6e-205) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (y <= 3.2e+86) {
tmp = (x + (z * (y / 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 <= (-6.5d+49)) then
tmp = z / b
else if (y <= (-4.6d-205)) then
tmp = x / (1.0d0 + (a + ((y * b) / t)))
else if (y <= 3.2d+86) then
tmp = (x + (z * (y / 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 <= -6.5e+49) {
tmp = z / b;
} else if (y <= -4.6e-205) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (y <= 3.2e+86) {
tmp = (x + (z * (y / t))) / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -6.5e+49: tmp = z / b elif y <= -4.6e-205: tmp = x / (1.0 + (a + ((y * b) / t))) elif y <= 3.2e+86: tmp = (x + (z * (y / t))) / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -6.5e+49) tmp = Float64(z / b); elseif (y <= -4.6e-205) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); elseif (y <= 3.2e+86) tmp = Float64(Float64(x + Float64(z * Float64(y / 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 <= -6.5e+49) tmp = z / b; elseif (y <= -4.6e-205) tmp = x / (1.0 + (a + ((y * b) / t))); elseif (y <= 3.2e+86) tmp = (x + (z * (y / t))) / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -6.5e+49], N[(z / b), $MachinePrecision], If[LessEqual[y, -4.6e-205], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e+86], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+49}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -4.6 \cdot 10^{-205}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+86}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -6.5000000000000005e49 or 3.2e86 < y Initial program 44.2%
+-commutative44.2%
associate-/l*46.2%
fma-define46.2%
+-commutative46.2%
associate-/l*55.7%
fma-define55.7%
Simplified55.7%
Taylor expanded in y around inf 67.1%
if -6.5000000000000005e49 < y < -4.5999999999999998e-205Initial program 93.5%
+-commutative93.5%
associate-/l*88.6%
fma-define88.6%
+-commutative88.6%
associate-/l*85.3%
fma-define85.3%
Simplified85.3%
Taylor expanded in z around 0 69.6%
if -4.5999999999999998e-205 < y < 3.2e86Initial program 94.0%
+-commutative94.0%
associate-/l*89.0%
fma-define89.0%
+-commutative89.0%
associate-/l*85.0%
fma-define85.0%
Simplified85.0%
Taylor expanded in b around 0 80.5%
*-commutative94.0%
associate-/l*93.9%
Applied egg-rr80.5%
Final simplification72.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -7.2e+49) (not (<= y 2.15e+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 ((y <= -7.2e+49) || !(y <= 2.15e+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 ((y <= (-7.2d+49)) .or. (.not. (y <= 2.15d+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 ((y <= -7.2e+49) || !(y <= 2.15e+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 (y <= -7.2e+49) or not (y <= 2.15e+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 ((y <= -7.2e+49) || !(y <= 2.15e+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 ((y <= -7.2e+49) || ~((y <= 2.15e+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[Or[LessEqual[y, -7.2e+49], N[Not[LessEqual[y, 2.15e+86]], $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 -7.2 \cdot 10^{+49} \lor \neg \left(y \leq 2.15 \cdot 10^{+86}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\end{array}
\end{array}
if y < -7.19999999999999993e49 or 2.1500000000000001e86 < y Initial program 44.2%
+-commutative44.2%
associate-/l*46.2%
fma-define46.2%
+-commutative46.2%
associate-/l*55.7%
fma-define55.7%
Simplified55.7%
Taylor expanded in y around inf 67.1%
if -7.19999999999999993e49 < y < 2.1500000000000001e86Initial program 93.8%
+-commutative93.8%
associate-/l*88.8%
fma-define88.8%
+-commutative88.8%
associate-/l*85.1%
fma-define85.1%
Simplified85.1%
Taylor expanded in z around 0 67.3%
Final simplification67.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -380000000.0) (not (<= y 3e+34))) (/ z b) (/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -380000000.0) || !(y <= 3e+34)) {
tmp = z / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-380000000.0d0)) .or. (.not. (y <= 3d+34))) then
tmp = z / b
else
tmp = x / (a + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -380000000.0) || !(y <= 3e+34)) {
tmp = z / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -380000000.0) or not (y <= 3e+34): tmp = z / b else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -380000000.0) || !(y <= 3e+34)) tmp = Float64(z / b); else tmp = Float64(x / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -380000000.0) || ~((y <= 3e+34))) tmp = z / b; else tmp = x / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -380000000.0], N[Not[LessEqual[y, 3e+34]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -380000000 \lor \neg \left(y \leq 3 \cdot 10^{+34}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -3.8e8 or 3.00000000000000018e34 < y Initial program 51.9%
+-commutative51.9%
associate-/l*53.5%
fma-define53.5%
+-commutative53.5%
associate-/l*61.0%
fma-define61.0%
Simplified61.0%
Taylor expanded in y around inf 61.7%
if -3.8e8 < y < 3.00000000000000018e34Initial program 96.2%
+-commutative96.2%
associate-/l*90.3%
fma-define90.3%
+-commutative90.3%
associate-/l*85.8%
fma-define85.8%
Simplified85.8%
Taylor expanded in y around 0 61.2%
Final simplification61.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.1e-116) (not (<= y 4.2e+33))) (/ z b) (/ x a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.1e-116) || !(y <= 4.2e+33)) {
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 ((y <= (-2.1d-116)) .or. (.not. (y <= 4.2d+33))) 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 ((y <= -2.1e-116) || !(y <= 4.2e+33)) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.1e-116) or not (y <= 4.2e+33): tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.1e-116) || !(y <= 4.2e+33)) 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 ((y <= -2.1e-116) || ~((y <= 4.2e+33))) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.1e-116], N[Not[LessEqual[y, 4.2e+33]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-116} \lor \neg \left(y \leq 4.2 \cdot 10^{+33}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if y < -2.0999999999999999e-116 or 4.2000000000000001e33 < y Initial program 60.1%
+-commutative60.1%
associate-/l*59.6%
fma-define59.6%
+-commutative59.6%
associate-/l*65.1%
fma-define65.1%
Simplified65.1%
Taylor expanded in y around inf 56.4%
if -2.0999999999999999e-116 < y < 4.2000000000000001e33Initial program 96.9%
associate-/l*91.9%
associate-/l*87.0%
Simplified87.0%
Taylor expanded in a around inf 51.5%
Taylor expanded in y around 0 34.3%
Final simplification48.0%
(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 74.0%
associate-/l*71.9%
associate-/l*73.4%
Simplified73.4%
Taylor expanded in a around inf 50.4%
Taylor expanded in y around 0 20.3%
(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 2024160
(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))))