
(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 (/ (* y b) t))
(t_2 (+ x (/ (* y z) t)))
(t_3 (/ t_2 (+ (+ a 1.0) t_1)))
(t_4 (+ 1.0 (+ a t_1))))
(if (<= t_3 -1e-279)
(+ (/ (* y z) (* t t_4)) (/ x t_4))
(if (<= t_3 0.0)
(/ t_2 (+ (+ a 1.0) (/ y (/ t b))))
(if (<= t_3 5e+302)
(/ (fma (/ y t) z x) (+ a (fma (/ y t) b 1.0)))
(/ 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);
double t_3 = t_2 / ((a + 1.0) + t_1);
double t_4 = 1.0 + (a + t_1);
double tmp;
if (t_3 <= -1e-279) {
tmp = ((y * z) / (t * t_4)) + (x / t_4);
} else if (t_3 <= 0.0) {
tmp = t_2 / ((a + 1.0) + (y / (t / b)));
} else if (t_3 <= 5e+302) {
tmp = fma((y / t), z, x) / (a + fma((y / t), b, 1.0));
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * b) / t) t_2 = Float64(x + Float64(Float64(y * z) / t)) t_3 = Float64(t_2 / Float64(Float64(a + 1.0) + t_1)) t_4 = Float64(1.0 + Float64(a + t_1)) tmp = 0.0 if (t_3 <= -1e-279) tmp = Float64(Float64(Float64(y * z) / Float64(t * t_4)) + Float64(x / t_4)); elseif (t_3 <= 0.0) tmp = Float64(t_2 / Float64(Float64(a + 1.0) + Float64(y / Float64(t / b)))); elseif (t_3 <= 5e+302) tmp = Float64(fma(Float64(y / t), z, x) / Float64(a + fma(Float64(y / t), b, 1.0))); else tmp = Float64(z / b); end return 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[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / N[(N[(a + 1.0), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e-279], N[(N[(N[(y * z), $MachinePrecision] / N[(t * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(x / t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 0.0], N[(t$95$2 / N[(N[(a + 1.0), $MachinePrecision] + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+302], N[(N[(N[(y / t), $MachinePrecision] * z + x), $MachinePrecision] / N[(a + N[(N[(y / t), $MachinePrecision] * b + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := x + \frac{y \cdot z}{t}\\
t_3 := \frac{t_2}{\left(a + 1\right) + t_1}\\
t_4 := 1 + \left(a + t_1\right)\\
\mathbf{if}\;t_3 \leq -1 \cdot 10^{-279}:\\
\;\;\;\;\frac{y \cdot z}{t \cdot t_4} + \frac{x}{t_4}\\
\mathbf{elif}\;t_3 \leq 0:\\
\;\;\;\;\frac{t_2}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\
\mathbf{elif}\;t_3 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{a + \mathsf{fma}\left(\frac{y}{t}, b, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1.00000000000000006e-279Initial program 89.5%
*-commutative89.5%
associate-/l*93.0%
associate-*l/91.6%
Simplified91.6%
Taylor expanded in x around 0 94.0%
if -1.00000000000000006e-279 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -0.0Initial program 69.4%
associate-/l*86.1%
Simplified86.1%
if -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 5e302Initial program 98.7%
+-commutative98.7%
associate-*l/99.7%
fma-def99.7%
associate-+l+99.7%
+-commutative99.7%
associate-*l/99.7%
fma-def99.7%
Simplified99.7%
if 5e302 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 10.2%
*-commutative10.2%
associate-/l*10.4%
associate-*l/1.2%
Simplified1.2%
Taylor expanded in t around 0 92.8%
Final simplification94.5%
(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 (/ (+ x (/ z (/ t y))) (+ (+ a 1.0) (* b (/ y t))))))
(if (<= t_2 -2.5e-170)
t_3
(if (<= t_2 0.0)
(/ t_1 (+ (+ a 1.0) (* y (/ b t))))
(if (<= t_2 5e+302) t_3 (/ z b))))))
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 = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t)));
double tmp;
if (t_2 <= -2.5e-170) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = t_1 / ((a + 1.0) + (y * (b / t)));
} else if (t_2 <= 5e+302) {
tmp = t_3;
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = x + ((y * z) / t)
t_2 = t_1 / ((a + 1.0d0) + ((y * b) / t))
t_3 = (x + (z / (t / y))) / ((a + 1.0d0) + (b * (y / t)))
if (t_2 <= (-2.5d-170)) then
tmp = t_3
else if (t_2 <= 0.0d0) then
tmp = t_1 / ((a + 1.0d0) + (y * (b / t)))
else if (t_2 <= 5d+302) then
tmp = t_3
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
double t_3 = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t)));
double tmp;
if (t_2 <= -2.5e-170) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = t_1 / ((a + 1.0) + (y * (b / t)));
} else if (t_2 <= 5e+302) {
tmp = t_3;
} else {
tmp = z / b;
}
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 = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t))) tmp = 0 if t_2 <= -2.5e-170: tmp = t_3 elif t_2 <= 0.0: tmp = t_1 / ((a + 1.0) + (y * (b / t))) elif t_2 <= 5e+302: tmp = t_3 else: tmp = z / b 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(x + Float64(z / Float64(t / y))) / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))) tmp = 0.0 if (t_2 <= -2.5e-170) tmp = t_3; elseif (t_2 <= 0.0) tmp = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); elseif (t_2 <= 5e+302) tmp = t_3; 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); t_2 = t_1 / ((a + 1.0) + ((y * b) / t)); t_3 = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t))); tmp = 0.0; if (t_2 <= -2.5e-170) tmp = t_3; elseif (t_2 <= 0.0) tmp = t_1 / ((a + 1.0) + (y * (b / t))); elseif (t_2 <= 5e+302) tmp = t_3; else tmp = z / b; 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[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2.5e-170], t$95$3, If[LessEqual[t$95$2, 0.0], N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+302], t$95$3, N[(z / b), $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{x + \frac{z}{\frac{t}{y}}}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\mathbf{if}\;t_2 \leq -2.5 \cdot 10^{-170}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;\frac{t_1}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -2.50000000000000005e-170 or -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 5e302Initial program 93.8%
*-commutative93.8%
associate-/l*96.8%
associate-*l/96.1%
Simplified96.1%
if -2.50000000000000005e-170 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -0.0Initial program 77.0%
associate-/l*88.0%
Simplified88.0%
div-inv88.1%
clear-num88.1%
Applied egg-rr88.1%
if 5e302 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 10.2%
*-commutative10.2%
associate-/l*10.4%
associate-*l/1.2%
Simplified1.2%
Taylor expanded in t around 0 92.8%
Final simplification93.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* y b) t))
(t_2 (+ x (/ (* y z) t)))
(t_3 (/ t_2 (+ (+ a 1.0) t_1)))
(t_4 (+ 1.0 (+ a t_1))))
(if (<= t_3 -1e-279)
(+ (/ (* y z) (* t t_4)) (/ x t_4))
(if (<= t_3 0.0)
(/ t_2 (+ (+ a 1.0) (/ y (/ t b))))
(if (<= t_3 5e+302)
(/ (+ x (/ z (/ t y))) (+ (+ a 1.0) (* b (/ y t))))
(/ 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);
double t_3 = t_2 / ((a + 1.0) + t_1);
double t_4 = 1.0 + (a + t_1);
double tmp;
if (t_3 <= -1e-279) {
tmp = ((y * z) / (t * t_4)) + (x / t_4);
} else if (t_3 <= 0.0) {
tmp = t_2 / ((a + 1.0) + (y / (t / b)));
} else if (t_3 <= 5e+302) {
tmp = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t)));
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (y * b) / t
t_2 = x + ((y * z) / t)
t_3 = t_2 / ((a + 1.0d0) + t_1)
t_4 = 1.0d0 + (a + t_1)
if (t_3 <= (-1d-279)) then
tmp = ((y * z) / (t * t_4)) + (x / t_4)
else if (t_3 <= 0.0d0) then
tmp = t_2 / ((a + 1.0d0) + (y / (t / b)))
else if (t_3 <= 5d+302) then
tmp = (x + (z / (t / y))) / ((a + 1.0d0) + (b * (y / t)))
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = x + ((y * z) / t);
double t_3 = t_2 / ((a + 1.0) + t_1);
double t_4 = 1.0 + (a + t_1);
double tmp;
if (t_3 <= -1e-279) {
tmp = ((y * z) / (t * t_4)) + (x / t_4);
} else if (t_3 <= 0.0) {
tmp = t_2 / ((a + 1.0) + (y / (t / b)));
} else if (t_3 <= 5e+302) {
tmp = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t)));
} 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_3 = t_2 / ((a + 1.0) + t_1) t_4 = 1.0 + (a + t_1) tmp = 0 if t_3 <= -1e-279: tmp = ((y * z) / (t * t_4)) + (x / t_4) elif t_3 <= 0.0: tmp = t_2 / ((a + 1.0) + (y / (t / b))) elif t_3 <= 5e+302: tmp = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * b) / t) t_2 = Float64(x + Float64(Float64(y * z) / t)) t_3 = Float64(t_2 / Float64(Float64(a + 1.0) + t_1)) t_4 = Float64(1.0 + Float64(a + t_1)) tmp = 0.0 if (t_3 <= -1e-279) tmp = Float64(Float64(Float64(y * z) / Float64(t * t_4)) + Float64(x / t_4)); elseif (t_3 <= 0.0) tmp = Float64(t_2 / Float64(Float64(a + 1.0) + Float64(y / Float64(t / b)))); elseif (t_3 <= 5e+302) tmp = Float64(Float64(x + Float64(z / Float64(t / y))) / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y * b) / t; t_2 = x + ((y * z) / t); t_3 = t_2 / ((a + 1.0) + t_1); t_4 = 1.0 + (a + t_1); tmp = 0.0; if (t_3 <= -1e-279) tmp = ((y * z) / (t * t_4)) + (x / t_4); elseif (t_3 <= 0.0) tmp = t_2 / ((a + 1.0) + (y / (t / b))); elseif (t_3 <= 5e+302) tmp = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t))); 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[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / N[(N[(a + 1.0), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e-279], N[(N[(N[(y * z), $MachinePrecision] / N[(t * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(x / t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 0.0], N[(t$95$2 / N[(N[(a + 1.0), $MachinePrecision] + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+302], 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[(z / b), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := x + \frac{y \cdot z}{t}\\
t_3 := \frac{t_2}{\left(a + 1\right) + t_1}\\
t_4 := 1 + \left(a + t_1\right)\\
\mathbf{if}\;t_3 \leq -1 \cdot 10^{-279}:\\
\;\;\;\;\frac{y \cdot z}{t \cdot t_4} + \frac{x}{t_4}\\
\mathbf{elif}\;t_3 \leq 0:\\
\;\;\;\;\frac{t_2}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\
\mathbf{elif}\;t_3 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1.00000000000000006e-279Initial program 89.5%
*-commutative89.5%
associate-/l*93.0%
associate-*l/91.6%
Simplified91.6%
Taylor expanded in x around 0 94.0%
if -1.00000000000000006e-279 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -0.0Initial program 69.4%
associate-/l*86.1%
Simplified86.1%
if -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 5e302Initial program 98.7%
*-commutative98.7%
associate-/l*99.7%
associate-*l/99.7%
Simplified99.7%
if 5e302 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 10.2%
*-commutative10.2%
associate-/l*10.4%
associate-*l/1.2%
Simplified1.2%
Taylor expanded in t around 0 92.8%
Final simplification94.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -8.8e+259)
(/ z b)
(if (<= y 3.7e+139)
(/ (+ x (/ z (/ t y))) (+ (+ a 1.0) (* b (/ y t))))
(/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -8.8e+259) {
tmp = z / b;
} else if (y <= 3.7e+139) {
tmp = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t)));
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-8.8d+259)) then
tmp = z / b
else if (y <= 3.7d+139) then
tmp = (x + (z / (t / y))) / ((a + 1.0d0) + (b * (y / t)))
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -8.8e+259) {
tmp = z / b;
} else if (y <= 3.7e+139) {
tmp = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t)));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -8.8e+259: tmp = z / b elif y <= 3.7e+139: tmp = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -8.8e+259) tmp = Float64(z / b); elseif (y <= 3.7e+139) tmp = Float64(Float64(x + Float64(z / Float64(t / y))) / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -8.8e+259) tmp = z / b; elseif (y <= 3.7e+139) tmp = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -8.8e+259], N[(z / b), $MachinePrecision], If[LessEqual[y, 3.7e+139], 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[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.8 \cdot 10^{+259}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{+139}:\\
\;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -8.79999999999999965e259 or 3.69999999999999992e139 < y Initial program 40.6%
*-commutative40.6%
associate-/l*33.7%
associate-*l/31.4%
Simplified31.4%
Taylor expanded in t around 0 72.6%
if -8.79999999999999965e259 < y < 3.69999999999999992e139Initial program 88.9%
*-commutative88.9%
associate-/l*90.3%
associate-*l/92.6%
Simplified92.6%
Final simplification88.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.6e+179)
(/ z b)
(if (<= y -7.7e-56)
(/ x (+ (+ a 1.0) (/ y (/ t b))))
(if (<= y 1.65e+55)
(/ (+ x (/ (* y z) t)) (+ a 1.0))
(if (<= y 1.75e+158) (/ x (+ (+ a 1.0) (* b (/ y t)))) (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.6e+179) {
tmp = z / b;
} else if (y <= -7.7e-56) {
tmp = x / ((a + 1.0) + (y / (t / b)));
} else if (y <= 1.65e+55) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (y <= 1.75e+158) {
tmp = x / ((a + 1.0) + (b * (y / t)));
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.6d+179)) then
tmp = z / b
else if (y <= (-7.7d-56)) then
tmp = x / ((a + 1.0d0) + (y / (t / b)))
else if (y <= 1.65d+55) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else if (y <= 1.75d+158) then
tmp = x / ((a + 1.0d0) + (b * (y / t)))
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.6e+179) {
tmp = z / b;
} else if (y <= -7.7e-56) {
tmp = x / ((a + 1.0) + (y / (t / b)));
} else if (y <= 1.65e+55) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (y <= 1.75e+158) {
tmp = x / ((a + 1.0) + (b * (y / t)));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.6e+179: tmp = z / b elif y <= -7.7e-56: tmp = x / ((a + 1.0) + (y / (t / b))) elif y <= 1.65e+55: tmp = (x + ((y * z) / t)) / (a + 1.0) elif y <= 1.75e+158: tmp = x / ((a + 1.0) + (b * (y / t))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.6e+179) tmp = Float64(z / b); elseif (y <= -7.7e-56) tmp = Float64(x / Float64(Float64(a + 1.0) + Float64(y / Float64(t / b)))); elseif (y <= 1.65e+55) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); elseif (y <= 1.75e+158) tmp = Float64(x / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.6e+179) tmp = z / b; elseif (y <= -7.7e-56) tmp = x / ((a + 1.0) + (y / (t / b))); elseif (y <= 1.65e+55) tmp = (x + ((y * z) / t)) / (a + 1.0); elseif (y <= 1.75e+158) tmp = x / ((a + 1.0) + (b * (y / t))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.6e+179], N[(z / b), $MachinePrecision], If[LessEqual[y, -7.7e-56], N[(x / N[(N[(a + 1.0), $MachinePrecision] + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e+55], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e+158], N[(x / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+179}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -7.7 \cdot 10^{-56}:\\
\;\;\;\;\frac{x}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{+55}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{+158}:\\
\;\;\;\;\frac{x}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.6000000000000001e179 or 1.7500000000000001e158 < y Initial program 38.9%
*-commutative38.9%
associate-/l*35.5%
associate-*l/38.0%
Simplified38.0%
Taylor expanded in t around 0 72.4%
if -1.6000000000000001e179 < y < -7.70000000000000037e-56Initial program 81.3%
*-commutative81.3%
associate-/l*81.3%
associate-*l/81.1%
Simplified81.1%
Taylor expanded in x around inf 67.9%
Taylor expanded in y around 0 67.9%
associate-/l*68.0%
Simplified68.0%
if -7.70000000000000037e-56 < y < 1.65e55Initial program 97.2%
*-commutative97.2%
associate-/l*97.8%
associate-*l/97.8%
Simplified97.8%
Taylor expanded in b around 0 77.9%
if 1.65e55 < y < 1.7500000000000001e158Initial program 54.4%
*-commutative54.4%
associate-/l*57.6%
associate-*l/71.3%
Simplified71.3%
Taylor expanded in x around inf 82.6%
Final simplification75.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -1.0)
(/ x a)
(if (<= a -1.75e-133)
x
(if (<= a -1.05e-246)
(/ z b)
(if (<= a 2.8e-193)
x
(if (<= a 1.6e-110)
(/ z b)
(if (<= a 1.1e-56) x (if (<= a 6.8e+19) (/ z b) (/ x a)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.0) {
tmp = x / a;
} else if (a <= -1.75e-133) {
tmp = x;
} else if (a <= -1.05e-246) {
tmp = z / b;
} else if (a <= 2.8e-193) {
tmp = x;
} else if (a <= 1.6e-110) {
tmp = z / b;
} else if (a <= 1.1e-56) {
tmp = x;
} else if (a <= 6.8e+19) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-1.0d0)) then
tmp = x / a
else if (a <= (-1.75d-133)) then
tmp = x
else if (a <= (-1.05d-246)) then
tmp = z / b
else if (a <= 2.8d-193) then
tmp = x
else if (a <= 1.6d-110) then
tmp = z / b
else if (a <= 1.1d-56) then
tmp = x
else if (a <= 6.8d+19) then
tmp = z / b
else
tmp = x / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.0) {
tmp = x / a;
} else if (a <= -1.75e-133) {
tmp = x;
} else if (a <= -1.05e-246) {
tmp = z / b;
} else if (a <= 2.8e-193) {
tmp = x;
} else if (a <= 1.6e-110) {
tmp = z / b;
} else if (a <= 1.1e-56) {
tmp = x;
} else if (a <= 6.8e+19) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.0: tmp = x / a elif a <= -1.75e-133: tmp = x elif a <= -1.05e-246: tmp = z / b elif a <= 2.8e-193: tmp = x elif a <= 1.6e-110: tmp = z / b elif a <= 1.1e-56: tmp = x elif a <= 6.8e+19: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.0) tmp = Float64(x / a); elseif (a <= -1.75e-133) tmp = x; elseif (a <= -1.05e-246) tmp = Float64(z / b); elseif (a <= 2.8e-193) tmp = x; elseif (a <= 1.6e-110) tmp = Float64(z / b); elseif (a <= 1.1e-56) tmp = x; elseif (a <= 6.8e+19) tmp = Float64(z / b); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.0) tmp = x / a; elseif (a <= -1.75e-133) tmp = x; elseif (a <= -1.05e-246) tmp = z / b; elseif (a <= 2.8e-193) tmp = x; elseif (a <= 1.6e-110) tmp = z / b; elseif (a <= 1.1e-56) tmp = x; elseif (a <= 6.8e+19) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.0], N[(x / a), $MachinePrecision], If[LessEqual[a, -1.75e-133], x, If[LessEqual[a, -1.05e-246], N[(z / b), $MachinePrecision], If[LessEqual[a, 2.8e-193], x, If[LessEqual[a, 1.6e-110], N[(z / b), $MachinePrecision], If[LessEqual[a, 1.1e-56], x, If[LessEqual[a, 6.8e+19], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq -1.75 \cdot 10^{-133}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -1.05 \cdot 10^{-246}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{-193}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{-110}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{-56}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 6.8 \cdot 10^{+19}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -1 or 6.8e19 < a Initial program 82.6%
*-commutative82.6%
associate-/l*78.8%
associate-*l/80.3%
Simplified80.3%
Taylor expanded in t around inf 53.0%
Taylor expanded in a around inf 53.0%
if -1 < a < -1.75000000000000001e-133 or -1.04999999999999997e-246 < a < 2.8000000000000002e-193 or 1.60000000000000014e-110 < a < 1.10000000000000002e-56Initial program 77.8%
+-commutative77.8%
*-commutative77.8%
associate-*r/80.1%
fma-def80.1%
associate-+l+80.1%
+-commutative80.1%
associate-*r/83.5%
fma-def83.5%
Simplified83.5%
Taylor expanded in a around 0 76.4%
Taylor expanded in y around 0 56.2%
if -1.75000000000000001e-133 < a < -1.04999999999999997e-246 or 2.8000000000000002e-193 < a < 1.60000000000000014e-110 or 1.10000000000000002e-56 < a < 6.8e19Initial program 72.9%
*-commutative72.9%
associate-/l*76.6%
associate-*l/74.5%
Simplified74.5%
Taylor expanded in t around 0 55.2%
Final simplification54.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -1.0)
(/ x a)
(if (<= a -1.45e-133)
(- x (* x a))
(if (<= a -4.6e-249)
(/ z b)
(if (<= a 2.05e-199)
x
(if (<= a 2.3e-108)
(/ z b)
(if (<= a 2.2e-55) x (if (<= a 5.5e+18) (/ z b) (/ x a)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.0) {
tmp = x / a;
} else if (a <= -1.45e-133) {
tmp = x - (x * a);
} else if (a <= -4.6e-249) {
tmp = z / b;
} else if (a <= 2.05e-199) {
tmp = x;
} else if (a <= 2.3e-108) {
tmp = z / b;
} else if (a <= 2.2e-55) {
tmp = x;
} else if (a <= 5.5e+18) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-1.0d0)) then
tmp = x / a
else if (a <= (-1.45d-133)) then
tmp = x - (x * a)
else if (a <= (-4.6d-249)) then
tmp = z / b
else if (a <= 2.05d-199) then
tmp = x
else if (a <= 2.3d-108) then
tmp = z / b
else if (a <= 2.2d-55) then
tmp = x
else if (a <= 5.5d+18) then
tmp = z / b
else
tmp = x / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.0) {
tmp = x / a;
} else if (a <= -1.45e-133) {
tmp = x - (x * a);
} else if (a <= -4.6e-249) {
tmp = z / b;
} else if (a <= 2.05e-199) {
tmp = x;
} else if (a <= 2.3e-108) {
tmp = z / b;
} else if (a <= 2.2e-55) {
tmp = x;
} else if (a <= 5.5e+18) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.0: tmp = x / a elif a <= -1.45e-133: tmp = x - (x * a) elif a <= -4.6e-249: tmp = z / b elif a <= 2.05e-199: tmp = x elif a <= 2.3e-108: tmp = z / b elif a <= 2.2e-55: tmp = x elif a <= 5.5e+18: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.0) tmp = Float64(x / a); elseif (a <= -1.45e-133) tmp = Float64(x - Float64(x * a)); elseif (a <= -4.6e-249) tmp = Float64(z / b); elseif (a <= 2.05e-199) tmp = x; elseif (a <= 2.3e-108) tmp = Float64(z / b); elseif (a <= 2.2e-55) tmp = x; elseif (a <= 5.5e+18) tmp = Float64(z / b); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.0) tmp = x / a; elseif (a <= -1.45e-133) tmp = x - (x * a); elseif (a <= -4.6e-249) tmp = z / b; elseif (a <= 2.05e-199) tmp = x; elseif (a <= 2.3e-108) tmp = z / b; elseif (a <= 2.2e-55) tmp = x; elseif (a <= 5.5e+18) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.0], N[(x / a), $MachinePrecision], If[LessEqual[a, -1.45e-133], N[(x - N[(x * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -4.6e-249], N[(z / b), $MachinePrecision], If[LessEqual[a, 2.05e-199], x, If[LessEqual[a, 2.3e-108], N[(z / b), $MachinePrecision], If[LessEqual[a, 2.2e-55], x, If[LessEqual[a, 5.5e+18], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq -1.45 \cdot 10^{-133}:\\
\;\;\;\;x - x \cdot a\\
\mathbf{elif}\;a \leq -4.6 \cdot 10^{-249}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq 2.05 \cdot 10^{-199}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-108}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq 2.2 \cdot 10^{-55}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{+18}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -1 or 5.5e18 < a Initial program 82.6%
*-commutative82.6%
associate-/l*78.8%
associate-*l/80.3%
Simplified80.3%
Taylor expanded in t around inf 53.0%
Taylor expanded in a around inf 53.0%
if -1 < a < -1.4499999999999999e-133Initial program 74.6%
*-commutative74.6%
associate-/l*74.8%
associate-*l/77.8%
Simplified77.8%
Taylor expanded in t around inf 50.0%
Taylor expanded in a around 0 47.1%
+-commutative47.1%
mul-1-neg47.1%
unsub-neg47.1%
Simplified47.1%
if -1.4499999999999999e-133 < a < -4.5999999999999996e-249 or 2.05000000000000011e-199 < a < 2.29999999999999996e-108 or 2.2e-55 < a < 5.5e18Initial program 72.9%
*-commutative72.9%
associate-/l*76.6%
associate-*l/74.5%
Simplified74.5%
Taylor expanded in t around 0 55.2%
if -4.5999999999999996e-249 < a < 2.05000000000000011e-199 or 2.29999999999999996e-108 < a < 2.2e-55Initial program 79.4%
+-commutative79.4%
*-commutative79.4%
associate-*r/82.6%
fma-def82.6%
associate-+l+82.6%
+-commutative82.6%
associate-*r/84.4%
fma-def84.4%
Simplified84.4%
Taylor expanded in a around 0 79.4%
Taylor expanded in y around 0 61.2%
Final simplification54.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.02e+152)
(/ z b)
(if (<= y 1.05e-73)
(/ x (+ a 1.0))
(if (<= y 2.15e+158) (/ x (+ 1.0 (* y (/ b t)))) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.02e+152) {
tmp = z / b;
} else if (y <= 1.05e-73) {
tmp = x / (a + 1.0);
} else if (y <= 2.15e+158) {
tmp = x / (1.0 + (y * (b / t)));
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.02d+152)) then
tmp = z / b
else if (y <= 1.05d-73) then
tmp = x / (a + 1.0d0)
else if (y <= 2.15d+158) then
tmp = x / (1.0d0 + (y * (b / t)))
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.02e+152) {
tmp = z / b;
} else if (y <= 1.05e-73) {
tmp = x / (a + 1.0);
} else if (y <= 2.15e+158) {
tmp = x / (1.0 + (y * (b / t)));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.02e+152: tmp = z / b elif y <= 1.05e-73: tmp = x / (a + 1.0) elif y <= 2.15e+158: tmp = x / (1.0 + (y * (b / t))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.02e+152) tmp = Float64(z / b); elseif (y <= 1.05e-73) tmp = Float64(x / Float64(a + 1.0)); elseif (y <= 2.15e+158) tmp = Float64(x / Float64(1.0 + Float64(y * Float64(b / t)))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.02e+152) tmp = z / b; elseif (y <= 1.05e-73) tmp = x / (a + 1.0); elseif (y <= 2.15e+158) tmp = x / (1.0 + (y * (b / t))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.02e+152], N[(z / b), $MachinePrecision], If[LessEqual[y, 1.05e-73], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.15e+158], N[(x / N[(1.0 + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{+152}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-73}:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{+158}:\\
\;\;\;\;\frac{x}{1 + y \cdot \frac{b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.01999999999999999e152 or 2.15e158 < y Initial program 42.1%
*-commutative42.1%
associate-/l*37.4%
associate-*l/39.8%
Simplified39.8%
Taylor expanded in t around 0 68.5%
if -1.01999999999999999e152 < y < 1.0499999999999999e-73Initial program 94.1%
*-commutative94.1%
associate-/l*95.3%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in t around inf 62.5%
if 1.0499999999999999e-73 < y < 2.15e158Initial program 81.0%
*-commutative81.0%
associate-/l*82.1%
associate-*l/87.1%
Simplified87.1%
Taylor expanded in x around inf 71.5%
Taylor expanded in y around 0 66.5%
Taylor expanded in a around 0 52.4%
*-commutative52.4%
associate-*l/57.3%
*-commutative57.3%
Simplified57.3%
Final simplification63.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.1e+181) (not (<= y 1.35e+160))) (/ z b) (/ x (+ 1.0 (+ a (/ (* y b) t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.1e+181) || !(y <= 1.35e+160)) {
tmp = z / b;
} else {
tmp = x / (1.0 + (a + ((y * b) / t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-3.1d+181)) .or. (.not. (y <= 1.35d+160))) then
tmp = z / b
else
tmp = x / (1.0d0 + (a + ((y * b) / t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.1e+181) || !(y <= 1.35e+160)) {
tmp = z / b;
} else {
tmp = x / (1.0 + (a + ((y * b) / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3.1e+181) or not (y <= 1.35e+160): tmp = z / b else: tmp = x / (1.0 + (a + ((y * b) / t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.1e+181) || !(y <= 1.35e+160)) tmp = Float64(z / b); else tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -3.1e+181) || ~((y <= 1.35e+160))) tmp = z / b; else tmp = x / (1.0 + (a + ((y * b) / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.1e+181], N[Not[LessEqual[y, 1.35e+160]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+181} \lor \neg \left(y \leq 1.35 \cdot 10^{+160}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\end{array}
\end{array}
if y < -3.09999999999999989e181 or 1.35e160 < y Initial program 38.9%
*-commutative38.9%
associate-/l*35.5%
associate-*l/38.0%
Simplified38.0%
Taylor expanded in t around 0 72.4%
if -3.09999999999999989e181 < y < 1.35e160Initial program 91.1%
*-commutative91.1%
associate-/l*91.8%
associate-*l/92.7%
Simplified92.7%
Taylor expanded in x around inf 71.2%
Final simplification71.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1e+180) (/ z b) (if (<= y 2.5e+159) (/ x (+ (+ a 1.0) (* b (/ y t)))) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1e+180) {
tmp = z / b;
} else if (y <= 2.5e+159) {
tmp = x / ((a + 1.0) + (b * (y / t)));
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1d+180)) then
tmp = z / b
else if (y <= 2.5d+159) then
tmp = x / ((a + 1.0d0) + (b * (y / t)))
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1e+180) {
tmp = z / b;
} else if (y <= 2.5e+159) {
tmp = x / ((a + 1.0) + (b * (y / t)));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1e+180: tmp = z / b elif y <= 2.5e+159: tmp = x / ((a + 1.0) + (b * (y / t))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1e+180) tmp = Float64(z / b); elseif (y <= 2.5e+159) tmp = Float64(x / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1e+180) tmp = z / b; elseif (y <= 2.5e+159) tmp = x / ((a + 1.0) + (b * (y / t))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1e+180], N[(z / b), $MachinePrecision], If[LessEqual[y, 2.5e+159], N[(x / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+180}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+159}:\\
\;\;\;\;\frac{x}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1e180 or 2.50000000000000002e159 < y Initial program 38.9%
*-commutative38.9%
associate-/l*35.5%
associate-*l/38.0%
Simplified38.0%
Taylor expanded in t around 0 72.4%
if -1e180 < y < 2.50000000000000002e159Initial program 91.1%
*-commutative91.1%
associate-/l*91.8%
associate-*l/92.7%
Simplified92.7%
Taylor expanded in x around inf 72.2%
Final simplification72.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.9e+152) (/ z b) (if (<= y 1.2e+84) (/ x (+ a 1.0)) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.9e+152) {
tmp = z / b;
} else if (y <= 1.2e+84) {
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 <= (-2.9d+152)) then
tmp = z / b
else if (y <= 1.2d+84) 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 <= -2.9e+152) {
tmp = z / b;
} else if (y <= 1.2e+84) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.9e+152: tmp = z / b elif y <= 1.2e+84: tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.9e+152) tmp = Float64(z / b); elseif (y <= 1.2e+84) 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 <= -2.9e+152) tmp = z / b; elseif (y <= 1.2e+84) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.9e+152], N[(z / b), $MachinePrecision], If[LessEqual[y, 1.2e+84], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.9 \cdot 10^{+152}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+84}:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -2.8999999999999998e152 or 1.2e84 < y Initial program 41.9%
*-commutative41.9%
associate-/l*37.0%
associate-*l/41.7%
Simplified41.7%
Taylor expanded in t around 0 64.0%
if -2.8999999999999998e152 < y < 1.2e84Initial program 93.9%
*-commutative93.9%
associate-/l*95.5%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in t around inf 59.7%
Final simplification60.9%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.0) (/ x a) (if (<= a 1.0) x (/ x a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.0) {
tmp = x / a;
} else if (a <= 1.0) {
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.0d0)) then
tmp = x / a
else if (a <= 1.0d0) 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.0) {
tmp = x / a;
} else if (a <= 1.0) {
tmp = x;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.0: tmp = x / a elif a <= 1.0: tmp = x else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.0) tmp = Float64(x / a); elseif (a <= 1.0) 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.0) tmp = x / a; elseif (a <= 1.0) tmp = x; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.0], N[(x / a), $MachinePrecision], If[LessEqual[a, 1.0], x, N[(x / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq 1:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -1 or 1 < a Initial program 82.3%
*-commutative82.3%
associate-/l*78.6%
associate-*l/79.1%
Simplified79.1%
Taylor expanded in t around inf 51.8%
Taylor expanded in a around inf 51.8%
if -1 < a < 1Initial program 76.1%
+-commutative76.1%
*-commutative76.1%
associate-*r/79.0%
fma-def79.0%
associate-+l+79.0%
+-commutative79.0%
associate-*r/79.8%
fma-def79.8%
Simplified79.8%
Taylor expanded in a around 0 73.6%
Taylor expanded in y around 0 41.4%
Final simplification46.4%
(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 79.1%
+-commutative79.1%
*-commutative79.1%
associate-*r/78.8%
fma-def78.8%
associate-+l+78.8%
+-commutative78.8%
associate-*r/75.9%
fma-def75.9%
Simplified75.9%
Taylor expanded in a around 0 48.7%
Taylor expanded in y around 0 23.3%
Final simplification23.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 2023257
(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))))