
(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 18 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)) (+ (+ a 1.0) t_1)))
(t_3 (+ 1.0 (+ a t_1)))
(t_4 (* z (+ (/ x (* z t_3)) (/ y (* t t_3))))))
(if (<= t_2 (- INFINITY))
t_4
(if (<= t_2 5e+250) t_2 (if (<= t_2 INFINITY) t_4 (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = (x + ((y * z) / t)) / ((a + 1.0) + t_1);
double t_3 = 1.0 + (a + t_1);
double t_4 = z * ((x / (z * t_3)) + (y / (t * t_3)));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_4;
} else if (t_2 <= 5e+250) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = (x + ((y * z) / t)) / ((a + 1.0) + t_1);
double t_3 = 1.0 + (a + t_1);
double t_4 = z * ((x / (z * t_3)) + (y / (t * t_3)));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_4;
} else if (t_2 <= 5e+250) {
tmp = t_2;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_4;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y * b) / t t_2 = (x + ((y * z) / t)) / ((a + 1.0) + t_1) t_3 = 1.0 + (a + t_1) t_4 = z * ((x / (z * t_3)) + (y / (t * t_3))) tmp = 0 if t_2 <= -math.inf: tmp = t_4 elif t_2 <= 5e+250: tmp = t_2 elif t_2 <= math.inf: tmp = t_4 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * b) / t) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + t_1)) t_3 = Float64(1.0 + Float64(a + t_1)) t_4 = Float64(z * Float64(Float64(x / Float64(z * t_3)) + Float64(y / Float64(t * t_3)))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_4; elseif (t_2 <= 5e+250) tmp = t_2; elseif (t_2 <= Inf) tmp = t_4; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y * b) / t; t_2 = (x + ((y * z) / t)) / ((a + 1.0) + t_1); t_3 = 1.0 + (a + t_1); t_4 = z * ((x / (z * t_3)) + (y / (t * t_3))); tmp = 0.0; if (t_2 <= -Inf) tmp = t_4; elseif (t_2 <= 5e+250) tmp = t_2; elseif (t_2 <= Inf) tmp = t_4; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(N[(x / N[(z * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$4, If[LessEqual[t$95$2, 5e+250], t$95$2, If[LessEqual[t$95$2, Infinity], t$95$4, N[(z / b), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + t\_1}\\
t_3 := 1 + \left(a + t\_1\right)\\
t_4 := z \cdot \left(\frac{x}{z \cdot t\_3} + \frac{y}{t \cdot t\_3}\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+250}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0 or 5.0000000000000002e250 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 42.4%
+-commutative42.4%
associate-/l*60.7%
fma-define60.7%
+-commutative60.7%
associate-/l*60.7%
fma-define60.7%
Simplified60.7%
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))) < 5.0000000000000002e250Initial program 92.3%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 0.0%
+-commutative0.0%
associate-/l*0.4%
fma-define0.4%
+-commutative0.4%
associate-/l*5.3%
fma-define5.3%
Simplified5.3%
Taylor expanded in y around inf 100.0%
Final simplification92.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ a 1.0) (/ (* y b) t))) (t_2 (/ (+ x (/ (* y z) t)) t_1)))
(if (<= t_2 -1e+31)
(/ (+ x (* z (/ y t))) t_1)
(if (<= t_2 2e+283) t_2 (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + 1.0) + ((y * b) / t);
double t_2 = (x + ((y * z) / t)) / t_1;
double tmp;
if (t_2 <= -1e+31) {
tmp = (x + (z * (y / t))) / t_1;
} else if (t_2 <= 2e+283) {
tmp = t_2;
} 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) :: tmp
t_1 = (a + 1.0d0) + ((y * b) / t)
t_2 = (x + ((y * z) / t)) / t_1
if (t_2 <= (-1d+31)) then
tmp = (x + (z * (y / t))) / t_1
else if (t_2 <= 2d+283) then
tmp = t_2
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 = (a + 1.0) + ((y * b) / t);
double t_2 = (x + ((y * z) / t)) / t_1;
double tmp;
if (t_2 <= -1e+31) {
tmp = (x + (z * (y / t))) / t_1;
} else if (t_2 <= 2e+283) {
tmp = t_2;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + 1.0) + ((y * b) / t) t_2 = (x + ((y * z) / t)) / t_1 tmp = 0 if t_2 <= -1e+31: tmp = (x + (z * (y / t))) / t_1 elif t_2 <= 2e+283: tmp = t_2 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t)) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / t_1) tmp = 0.0 if (t_2 <= -1e+31) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / t_1); elseif (t_2 <= 2e+283) tmp = t_2; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + 1.0) + ((y * b) / t); t_2 = (x + ((y * z) / t)) / t_1; tmp = 0.0; if (t_2 <= -1e+31) tmp = (x + (z * (y / t))) / t_1; elseif (t_2 <= 2e+283) 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[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+31], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 2e+283], t$95$2, N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + 1\right) + \frac{y \cdot b}{t}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{t\_1}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+31}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{t\_1}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+283}:\\
\;\;\;\;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))) < -9.9999999999999996e30Initial program 75.3%
*-commutative75.3%
associate-/l*87.7%
Applied egg-rr87.7%
if -9.9999999999999996e30 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 1.99999999999999991e283Initial program 91.3%
if 1.99999999999999991e283 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 14.8%
+-commutative14.8%
associate-/l*22.5%
fma-define22.5%
+-commutative22.5%
associate-/l*25.1%
fma-define25.1%
Simplified25.1%
Taylor expanded in y around inf 79.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.95e-146) (not (<= t 6.5e-160))) (/ (+ x (* y (/ z t))) (+ (+ a 1.0) (/ y (/ t b)))) (+ (/ z b) (* t (/ x (* y b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.95e-146) || !(t <= 6.5e-160)) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y / (t / b)));
} else {
tmp = (z / b) + (t * (x / (y * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-1.95d-146)) .or. (.not. (t <= 6.5d-160))) then
tmp = (x + (y * (z / t))) / ((a + 1.0d0) + (y / (t / b)))
else
tmp = (z / b) + (t * (x / (y * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.95e-146) || !(t <= 6.5e-160)) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y / (t / b)));
} else {
tmp = (z / b) + (t * (x / (y * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.95e-146) or not (t <= 6.5e-160): tmp = (x + (y * (z / t))) / ((a + 1.0) + (y / (t / b))) else: tmp = (z / b) + (t * (x / (y * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.95e-146) || !(t <= 6.5e-160)) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y / Float64(t / b)))); else tmp = Float64(Float64(z / b) + Float64(t * Float64(x / Float64(y * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.95e-146) || ~((t <= 6.5e-160))) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y / (t / b))); else tmp = (z / b) + (t * (x / (y * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.95e-146], N[Not[LessEqual[t, 6.5e-160]], $MachinePrecision]], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z / b), $MachinePrecision] + N[(t * N[(x / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{-146} \lor \neg \left(t \leq 6.5 \cdot 10^{-160}\right):\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{x}{y \cdot b}\\
\end{array}
\end{array}
if t < -1.95000000000000001e-146 or 6.4999999999999996e-160 < t Initial program 84.0%
associate-/l*86.1%
associate-/l*87.1%
Simplified87.1%
clear-num87.1%
un-div-inv87.1%
Applied egg-rr87.1%
if -1.95000000000000001e-146 < t < 6.4999999999999996e-160Initial program 57.6%
+-commutative57.6%
associate-/l*47.6%
fma-define47.6%
+-commutative47.6%
associate-/l*41.9%
fma-define41.9%
Simplified41.9%
Taylor expanded in b around inf 43.6%
Taylor expanded in t around 0 68.1%
+-commutative68.1%
associate-/l*66.6%
Simplified66.6%
Final simplification81.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.4e-144) (not (<= t 1.8e-163))) (/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t)))) (+ (/ z b) (* t (/ x (* y b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.4e-144) || !(t <= 1.8e-163)) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else {
tmp = (z / b) + (t * (x / (y * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-2.4d-144)) .or. (.not. (t <= 1.8d-163))) then
tmp = (x + (y * (z / t))) / ((a + 1.0d0) + (y * (b / t)))
else
tmp = (z / b) + (t * (x / (y * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.4e-144) || !(t <= 1.8e-163)) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else {
tmp = (z / b) + (t * (x / (y * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.4e-144) or not (t <= 1.8e-163): tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) else: tmp = (z / b) + (t * (x / (y * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.4e-144) || !(t <= 1.8e-163)) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); else tmp = Float64(Float64(z / b) + Float64(t * Float64(x / Float64(y * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -2.4e-144) || ~((t <= 1.8e-163))) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); else tmp = (z / b) + (t * (x / (y * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.4e-144], N[Not[LessEqual[t, 1.8e-163]], $MachinePrecision]], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z / b), $MachinePrecision] + N[(t * N[(x / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{-144} \lor \neg \left(t \leq 1.8 \cdot 10^{-163}\right):\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{x}{y \cdot b}\\
\end{array}
\end{array}
if t < -2.39999999999999994e-144 or 1.7999999999999999e-163 < t Initial program 84.0%
associate-/l*86.1%
associate-/l*87.1%
Simplified87.1%
if -2.39999999999999994e-144 < t < 1.7999999999999999e-163Initial program 57.6%
+-commutative57.6%
associate-/l*47.6%
fma-define47.6%
+-commutative47.6%
associate-/l*41.9%
fma-define41.9%
Simplified41.9%
Taylor expanded in b around inf 43.6%
Taylor expanded in t around 0 68.1%
+-commutative68.1%
associate-/l*66.6%
Simplified66.6%
Final simplification81.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -7e-204)
(/ (+ x (* z (/ y t))) (+ (+ a 1.0) (/ (* y b) t)))
(if (<= t 6.8e-162)
(+ (/ z b) (* t (/ x (* y b))))
(/ (+ x (* y (/ z t))) (+ (+ a 1.0) (/ y (/ t b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -7e-204) {
tmp = (x + (z * (y / t))) / ((a + 1.0) + ((y * b) / t));
} else if (t <= 6.8e-162) {
tmp = (z / b) + (t * (x / (y * b)));
} else {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y / (t / 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 <= (-7d-204)) then
tmp = (x + (z * (y / t))) / ((a + 1.0d0) + ((y * b) / t))
else if (t <= 6.8d-162) then
tmp = (z / b) + (t * (x / (y * b)))
else
tmp = (x + (y * (z / t))) / ((a + 1.0d0) + (y / (t / 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 <= -7e-204) {
tmp = (x + (z * (y / t))) / ((a + 1.0) + ((y * b) / t));
} else if (t <= 6.8e-162) {
tmp = (z / b) + (t * (x / (y * b)));
} else {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y / (t / b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -7e-204: tmp = (x + (z * (y / t))) / ((a + 1.0) + ((y * b) / t)) elif t <= 6.8e-162: tmp = (z / b) + (t * (x / (y * b))) else: tmp = (x + (y * (z / t))) / ((a + 1.0) + (y / (t / b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -7e-204) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))); elseif (t <= 6.8e-162) tmp = Float64(Float64(z / b) + Float64(t * Float64(x / Float64(y * b)))); else tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y / Float64(t / b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -7e-204) tmp = (x + (z * (y / t))) / ((a + 1.0) + ((y * b) / t)); elseif (t <= 6.8e-162) tmp = (z / b) + (t * (x / (y * b))); else tmp = (x + (y * (z / t))) / ((a + 1.0) + (y / (t / b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -7e-204], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.8e-162], N[(N[(z / b), $MachinePrecision] + N[(t * N[(x / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{-204}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{-162}:\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{x}{y \cdot b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\
\end{array}
\end{array}
if t < -7.00000000000000054e-204Initial program 81.2%
*-commutative81.2%
associate-/l*86.7%
Applied egg-rr86.7%
if -7.00000000000000054e-204 < t < 6.8e-162Initial program 54.9%
+-commutative54.9%
associate-/l*46.0%
fma-define46.0%
+-commutative46.0%
associate-/l*40.7%
fma-define40.7%
Simplified40.7%
Taylor expanded in b around inf 45.8%
Taylor expanded in t around 0 71.0%
+-commutative71.0%
associate-/l*71.1%
Simplified71.1%
if 6.8e-162 < t Initial program 85.0%
associate-/l*86.0%
associate-/l*86.9%
Simplified86.9%
clear-num87.0%
un-div-inv87.0%
Applied egg-rr87.0%
Final simplification83.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -0.55) (not (<= a 1.25e-15))) (/ (+ x (* z (/ y t))) (+ a (/ (* y b) t))) (/ (+ x (* y (/ z t))) (+ 1.0 (* y (/ b t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -0.55) || !(a <= 1.25e-15)) {
tmp = (x + (z * (y / t))) / (a + ((y * b) / t));
} else {
tmp = (x + (y * (z / t))) / (1.0 + (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 ((a <= (-0.55d0)) .or. (.not. (a <= 1.25d-15))) then
tmp = (x + (z * (y / t))) / (a + ((y * b) / t))
else
tmp = (x + (y * (z / t))) / (1.0d0 + (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 ((a <= -0.55) || !(a <= 1.25e-15)) {
tmp = (x + (z * (y / t))) / (a + ((y * b) / t));
} else {
tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -0.55) or not (a <= 1.25e-15): tmp = (x + (z * (y / t))) / (a + ((y * b) / t)) else: tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -0.55) || !(a <= 1.25e-15)) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + Float64(Float64(y * b) / t))); else tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(1.0 + Float64(y * Float64(b / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -0.55) || ~((a <= 1.25e-15))) tmp = (x + (z * (y / t))) / (a + ((y * b) / t)); else tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -0.55], N[Not[LessEqual[a, 1.25e-15]], $MachinePrecision]], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.55 \lor \neg \left(a \leq 1.25 \cdot 10^{-15}\right):\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + \frac{y \cdot b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{1 + y \cdot \frac{b}{t}}\\
\end{array}
\end{array}
if a < -0.55000000000000004 or 1.25e-15 < a Initial program 76.2%
Taylor expanded in a around inf 75.9%
*-commutative76.2%
associate-/l*76.8%
Applied egg-rr76.5%
if -0.55000000000000004 < a < 1.25e-15Initial program 78.1%
associate-/l*79.8%
associate-/l*79.8%
Simplified79.8%
Taylor expanded in a around 0 79.8%
Final simplification78.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (/ b t))) (t_2 (+ x (* y (/ z t)))))
(if (or (<= a -980000000.0) (not (<= a 1.25e-15)))
(/ t_2 (+ a t_1))
(/ t_2 (+ 1.0 t_1)))))
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 tmp;
if ((a <= -980000000.0) || !(a <= 1.25e-15)) {
tmp = t_2 / (a + t_1);
} else {
tmp = t_2 / (1.0 + 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) :: t_2
real(8) :: tmp
t_1 = y * (b / t)
t_2 = x + (y * (z / t))
if ((a <= (-980000000.0d0)) .or. (.not. (a <= 1.25d-15))) then
tmp = t_2 / (a + t_1)
else
tmp = t_2 / (1.0d0 + 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 = y * (b / t);
double t_2 = x + (y * (z / t));
double tmp;
if ((a <= -980000000.0) || !(a <= 1.25e-15)) {
tmp = t_2 / (a + t_1);
} else {
tmp = t_2 / (1.0 + t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * (b / t) t_2 = x + (y * (z / t)) tmp = 0 if (a <= -980000000.0) or not (a <= 1.25e-15): tmp = t_2 / (a + t_1) else: tmp = t_2 / (1.0 + t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(b / t)) t_2 = Float64(x + Float64(y * Float64(z / t))) tmp = 0.0 if ((a <= -980000000.0) || !(a <= 1.25e-15)) tmp = Float64(t_2 / Float64(a + t_1)); else tmp = Float64(t_2 / Float64(1.0 + t_1)); 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)); tmp = 0.0; if ((a <= -980000000.0) || ~((a <= 1.25e-15))) tmp = t_2 / (a + t_1); else tmp = t_2 / (1.0 + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[a, -980000000.0], N[Not[LessEqual[a, 1.25e-15]], $MachinePrecision]], N[(t$95$2 / N[(a + t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$2 / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{b}{t}\\
t_2 := x + y \cdot \frac{z}{t}\\
\mathbf{if}\;a \leq -980000000 \lor \neg \left(a \leq 1.25 \cdot 10^{-15}\right):\\
\;\;\;\;\frac{t\_2}{a + t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_2}{1 + t\_1}\\
\end{array}
\end{array}
if a < -9.8e8 or 1.25e-15 < a Initial program 75.9%
associate-/l*72.2%
associate-/l*70.8%
Simplified70.8%
Taylor expanded in a around inf 70.5%
if -9.8e8 < a < 1.25e-15Initial program 78.4%
associate-/l*80.1%
associate-/l*80.1%
Simplified80.1%
Taylor expanded in a around 0 80.1%
Final simplification75.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ a (/ (* y b) t))))
(if (<= a -0.058)
(/ (+ x (/ (* y z) t)) t_1)
(if (<= a 1.25e-15)
(/ (+ x (* y (/ z t))) (+ 1.0 (* y (/ b t))))
(/ (+ x (* z (/ y t))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a + ((y * b) / t);
double tmp;
if (a <= -0.058) {
tmp = (x + ((y * z) / t)) / t_1;
} else if (a <= 1.25e-15) {
tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t)));
} else {
tmp = (x + (z * (y / t))) / 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 = a + ((y * b) / t)
if (a <= (-0.058d0)) then
tmp = (x + ((y * z) / t)) / t_1
else if (a <= 1.25d-15) then
tmp = (x + (y * (z / t))) / (1.0d0 + (y * (b / t)))
else
tmp = (x + (z * (y / t))) / 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 = a + ((y * b) / t);
double tmp;
if (a <= -0.058) {
tmp = (x + ((y * z) / t)) / t_1;
} else if (a <= 1.25e-15) {
tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t)));
} else {
tmp = (x + (z * (y / t))) / t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a + ((y * b) / t) tmp = 0 if a <= -0.058: tmp = (x + ((y * z) / t)) / t_1 elif a <= 1.25e-15: tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t))) else: tmp = (x + (z * (y / t))) / t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a + Float64(Float64(y * b) / t)) tmp = 0.0 if (a <= -0.058) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / t_1); elseif (a <= 1.25e-15) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(1.0 + Float64(y * Float64(b / t)))); else tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a + ((y * b) / t); tmp = 0.0; if (a <= -0.058) tmp = (x + ((y * z) / t)) / t_1; elseif (a <= 1.25e-15) tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t))); else tmp = (x + (z * (y / t))) / t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.058], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[a, 1.25e-15], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + \frac{y \cdot b}{t}\\
\mathbf{if}\;a \leq -0.058:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{t\_1}\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{-15}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{1 + y \cdot \frac{b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{t\_1}\\
\end{array}
\end{array}
if a < -0.0580000000000000029Initial program 82.2%
Taylor expanded in a around inf 82.2%
if -0.0580000000000000029 < a < 1.25e-15Initial program 78.1%
associate-/l*79.8%
associate-/l*79.8%
Simplified79.8%
Taylor expanded in a around 0 79.8%
if 1.25e-15 < a Initial program 69.4%
Taylor expanded in a around inf 68.8%
*-commutative69.4%
associate-/l*70.7%
Applied egg-rr70.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -7e+14)
(/ (+ x (/ (* y z) t)) a)
(if (<= a 10600000.0)
(/ (+ x (* y (/ z t))) (+ 1.0 (* y (/ b t))))
(/ (+ x (* z (/ y t))) (+ a 1.0)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -7e+14) {
tmp = (x + ((y * z) / t)) / a;
} else if (a <= 10600000.0) {
tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t)));
} else {
tmp = (x + (z * (y / 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 (a <= (-7d+14)) then
tmp = (x + ((y * z) / t)) / a
else if (a <= 10600000.0d0) then
tmp = (x + (y * (z / t))) / (1.0d0 + (y * (b / t)))
else
tmp = (x + (z * (y / 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 (a <= -7e+14) {
tmp = (x + ((y * z) / t)) / a;
} else if (a <= 10600000.0) {
tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t)));
} else {
tmp = (x + (z * (y / t))) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -7e+14: tmp = (x + ((y * z) / t)) / a elif a <= 10600000.0: tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t))) else: tmp = (x + (z * (y / t))) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -7e+14) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / a); elseif (a <= 10600000.0) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(1.0 + Float64(y * Float64(b / t)))); else tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -7e+14) tmp = (x + ((y * z) / t)) / a; elseif (a <= 10600000.0) tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t))); else tmp = (x + (z * (y / t))) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -7e+14], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[a, 10600000.0], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7 \cdot 10^{+14}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a}\\
\mathbf{elif}\;a \leq 10600000:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{1 + y \cdot \frac{b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\
\end{array}
\end{array}
if a < -7e14Initial program 81.7%
+-commutative81.7%
associate-/l*74.8%
fma-define74.8%
+-commutative74.8%
associate-/l*72.1%
fma-define72.1%
Simplified72.1%
Taylor expanded in a around inf 64.5%
if -7e14 < a < 1.06e7Initial program 78.0%
associate-/l*79.6%
associate-/l*79.6%
Simplified79.6%
Taylor expanded in a around 0 79.6%
if 1.06e7 < a Initial program 70.0%
*-commutative70.0%
associate-/l*71.3%
Applied egg-rr71.3%
Taylor expanded in y around 0 67.7%
Final simplification72.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -1000000000.0)
(/ (+ x (/ (* y z) t)) a)
(if (<= a -3.8e-263)
(/ x (+ 1.0 (* b (/ y t))))
(if (<= a 1.25e-15) (+ x (* y (/ z t))) (/ (+ x (* z (/ y t))) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1000000000.0) {
tmp = (x + ((y * z) / t)) / a;
} else if (a <= -3.8e-263) {
tmp = x / (1.0 + (b * (y / t)));
} else if (a <= 1.25e-15) {
tmp = x + (y * (z / t));
} else {
tmp = (x + (z * (y / t))) / 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 <= (-1000000000.0d0)) then
tmp = (x + ((y * z) / t)) / a
else if (a <= (-3.8d-263)) then
tmp = x / (1.0d0 + (b * (y / t)))
else if (a <= 1.25d-15) then
tmp = x + (y * (z / t))
else
tmp = (x + (z * (y / t))) / 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 <= -1000000000.0) {
tmp = (x + ((y * z) / t)) / a;
} else if (a <= -3.8e-263) {
tmp = x / (1.0 + (b * (y / t)));
} else if (a <= 1.25e-15) {
tmp = x + (y * (z / t));
} else {
tmp = (x + (z * (y / t))) / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1000000000.0: tmp = (x + ((y * z) / t)) / a elif a <= -3.8e-263: tmp = x / (1.0 + (b * (y / t))) elif a <= 1.25e-15: tmp = x + (y * (z / t)) else: tmp = (x + (z * (y / t))) / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1000000000.0) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / a); elseif (a <= -3.8e-263) tmp = Float64(x / Float64(1.0 + Float64(b * Float64(y / t)))); elseif (a <= 1.25e-15) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1000000000.0) tmp = (x + ((y * z) / t)) / a; elseif (a <= -3.8e-263) tmp = x / (1.0 + (b * (y / t))); elseif (a <= 1.25e-15) tmp = x + (y * (z / t)); else tmp = (x + (z * (y / t))) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1000000000.0], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[a, -3.8e-263], N[(x / N[(1.0 + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.25e-15], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1000000000:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a}\\
\mathbf{elif}\;a \leq -3.8 \cdot 10^{-263}:\\
\;\;\;\;\frac{x}{1 + b \cdot \frac{y}{t}}\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{-15}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a}\\
\end{array}
\end{array}
if a < -1e9Initial program 81.7%
+-commutative81.7%
associate-/l*74.8%
fma-define74.8%
+-commutative74.8%
associate-/l*72.1%
fma-define72.1%
Simplified72.1%
Taylor expanded in a around inf 64.5%
if -1e9 < a < -3.80000000000000005e-263Initial program 77.5%
+-commutative77.5%
associate-/l*77.4%
fma-define77.4%
+-commutative77.4%
associate-/l*75.6%
fma-define75.6%
Simplified75.6%
Taylor expanded in z around 0 58.3%
Taylor expanded in a around 0 58.3%
associate-*r/58.3%
Simplified58.3%
if -3.80000000000000005e-263 < a < 1.25e-15Initial program 79.2%
associate-/l*82.4%
associate-/l*83.9%
Simplified83.9%
Taylor expanded in a around 0 83.9%
Taylor expanded in y around 0 58.0%
/-rgt-identity58.0%
+-commutative58.0%
Applied egg-rr58.0%
if 1.25e-15 < a Initial program 69.4%
*-commutative69.4%
associate-/l*70.7%
Applied egg-rr70.7%
Taylor expanded in a around inf 65.1%
Final simplification61.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (* z (/ y t))) a)))
(if (<= a -980000000.0)
t_1
(if (<= a -7.5e-264)
(/ x (+ 1.0 (* b (/ y t))))
(if (<= a 1.25e-15) (+ x (* y (/ z t))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (z * (y / t))) / a;
double tmp;
if (a <= -980000000.0) {
tmp = t_1;
} else if (a <= -7.5e-264) {
tmp = x / (1.0 + (b * (y / t)));
} else if (a <= 1.25e-15) {
tmp = x + (y * (z / t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (z * (y / t))) / a
if (a <= (-980000000.0d0)) then
tmp = t_1
else if (a <= (-7.5d-264)) then
tmp = x / (1.0d0 + (b * (y / t)))
else if (a <= 1.25d-15) then
tmp = x + (y * (z / t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (z * (y / t))) / a;
double tmp;
if (a <= -980000000.0) {
tmp = t_1;
} else if (a <= -7.5e-264) {
tmp = x / (1.0 + (b * (y / t)));
} else if (a <= 1.25e-15) {
tmp = x + (y * (z / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + (z * (y / t))) / a tmp = 0 if a <= -980000000.0: tmp = t_1 elif a <= -7.5e-264: tmp = x / (1.0 + (b * (y / t))) elif a <= 1.25e-15: tmp = x + (y * (z / t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(z * Float64(y / t))) / a) tmp = 0.0 if (a <= -980000000.0) tmp = t_1; elseif (a <= -7.5e-264) tmp = Float64(x / Float64(1.0 + Float64(b * Float64(y / t)))); elseif (a <= 1.25e-15) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + (z * (y / t))) / a; tmp = 0.0; if (a <= -980000000.0) tmp = t_1; elseif (a <= -7.5e-264) tmp = x / (1.0 + (b * (y / t))); elseif (a <= 1.25e-15) tmp = x + (y * (z / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[a, -980000000.0], t$95$1, If[LessEqual[a, -7.5e-264], N[(x / N[(1.0 + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.25e-15], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + z \cdot \frac{y}{t}}{a}\\
\mathbf{if}\;a \leq -980000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -7.5 \cdot 10^{-264}:\\
\;\;\;\;\frac{x}{1 + b \cdot \frac{y}{t}}\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{-15}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -9.8e8 or 1.25e-15 < a Initial program 75.9%
*-commutative75.9%
associate-/l*76.4%
Applied egg-rr76.4%
Taylor expanded in a around inf 64.8%
if -9.8e8 < a < -7.5000000000000001e-264Initial program 77.5%
+-commutative77.5%
associate-/l*77.4%
fma-define77.4%
+-commutative77.4%
associate-/l*75.6%
fma-define75.6%
Simplified75.6%
Taylor expanded in z around 0 58.3%
Taylor expanded in a around 0 58.3%
associate-*r/58.3%
Simplified58.3%
if -7.5000000000000001e-264 < a < 1.25e-15Initial program 79.2%
associate-/l*82.4%
associate-/l*83.9%
Simplified83.9%
Taylor expanded in a around 0 83.9%
Taylor expanded in y around 0 58.0%
/-rgt-identity58.0%
+-commutative58.0%
Applied egg-rr58.0%
Final simplification61.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -2.5e+177)
(/ x a)
(if (<= a -2e-33)
(/ z b)
(if (<= a -1.55e-246) x (if (<= a 2.4e+59) (/ z b) (/ x a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.5e+177) {
tmp = x / a;
} else if (a <= -2e-33) {
tmp = z / b;
} else if (a <= -1.55e-246) {
tmp = x;
} else if (a <= 2.4e+59) {
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 <= (-2.5d+177)) then
tmp = x / a
else if (a <= (-2d-33)) then
tmp = z / b
else if (a <= (-1.55d-246)) then
tmp = x
else if (a <= 2.4d+59) 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 <= -2.5e+177) {
tmp = x / a;
} else if (a <= -2e-33) {
tmp = z / b;
} else if (a <= -1.55e-246) {
tmp = x;
} else if (a <= 2.4e+59) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.5e+177: tmp = x / a elif a <= -2e-33: tmp = z / b elif a <= -1.55e-246: tmp = x elif a <= 2.4e+59: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.5e+177) tmp = Float64(x / a); elseif (a <= -2e-33) tmp = Float64(z / b); elseif (a <= -1.55e-246) tmp = x; elseif (a <= 2.4e+59) 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 <= -2.5e+177) tmp = x / a; elseif (a <= -2e-33) tmp = z / b; elseif (a <= -1.55e-246) tmp = x; elseif (a <= 2.4e+59) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.5e+177], N[(x / a), $MachinePrecision], If[LessEqual[a, -2e-33], N[(z / b), $MachinePrecision], If[LessEqual[a, -1.55e-246], x, If[LessEqual[a, 2.4e+59], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{+177}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq -2 \cdot 10^{-33}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq -1.55 \cdot 10^{-246}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{+59}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -2.5000000000000001e177 or 2.4000000000000002e59 < a Initial program 78.2%
+-commutative78.2%
associate-/l*73.5%
fma-define73.5%
+-commutative73.5%
associate-/l*72.3%
fma-define72.3%
Simplified72.3%
Taylor expanded in z around 0 57.1%
Taylor expanded in a around inf 52.4%
if -2.5000000000000001e177 < a < -2.0000000000000001e-33 or -1.55e-246 < a < 2.4000000000000002e59Initial program 74.8%
+-commutative74.8%
associate-/l*74.9%
fma-define74.9%
+-commutative74.9%
associate-/l*74.9%
fma-define74.9%
Simplified74.9%
Taylor expanded in y around inf 43.4%
if -2.0000000000000001e-33 < a < -1.55e-246Initial program 82.0%
associate-/l*84.1%
associate-/l*81.8%
Simplified81.8%
Taylor expanded in a around 0 81.8%
Taylor expanded in y around 0 52.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.32e-33) (not (<= y 4.5e+94))) (+ (/ z b) (* t (/ x (* y b)))) (/ (+ x (* z (/ y t))) (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.32e-33) || !(y <= 4.5e+94)) {
tmp = (z / b) + (t * (x / (y * b)));
} else {
tmp = (x + (z * (y / 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 <= (-1.32d-33)) .or. (.not. (y <= 4.5d+94))) then
tmp = (z / b) + (t * (x / (y * b)))
else
tmp = (x + (z * (y / 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 <= -1.32e-33) || !(y <= 4.5e+94)) {
tmp = (z / b) + (t * (x / (y * b)));
} else {
tmp = (x + (z * (y / t))) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.32e-33) or not (y <= 4.5e+94): tmp = (z / b) + (t * (x / (y * b))) else: tmp = (x + (z * (y / t))) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.32e-33) || !(y <= 4.5e+94)) tmp = Float64(Float64(z / b) + Float64(t * Float64(x / Float64(y * b)))); else tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.32e-33) || ~((y <= 4.5e+94))) tmp = (z / b) + (t * (x / (y * b))); else tmp = (x + (z * (y / t))) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.32e-33], N[Not[LessEqual[y, 4.5e+94]], $MachinePrecision]], N[(N[(z / b), $MachinePrecision] + N[(t * N[(x / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.32 \cdot 10^{-33} \lor \neg \left(y \leq 4.5 \cdot 10^{+94}\right):\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{x}{y \cdot b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\
\end{array}
\end{array}
if y < -1.31999999999999993e-33 or 4.49999999999999972e94 < y Initial program 60.1%
+-commutative60.1%
associate-/l*65.8%
fma-define65.8%
+-commutative65.8%
associate-/l*67.4%
fma-define67.4%
Simplified67.4%
Taylor expanded in b around inf 36.0%
Taylor expanded in t around 0 61.3%
+-commutative61.3%
associate-/l*63.0%
Simplified63.0%
if -1.31999999999999993e-33 < y < 4.49999999999999972e94Initial program 91.4%
*-commutative91.4%
associate-/l*92.9%
Applied egg-rr92.9%
Taylor expanded in y around 0 78.3%
Final simplification71.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.05e-55) (not (<= y 1.15e+91))) (+ (/ z b) (* t (/ x (* y 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 <= -2.05e-55) || !(y <= 1.15e+91)) {
tmp = (z / b) + (t * (x / (y * 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 <= (-2.05d-55)) .or. (.not. (y <= 1.15d+91))) then
tmp = (z / b) + (t * (x / (y * 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 <= -2.05e-55) || !(y <= 1.15e+91)) {
tmp = (z / b) + (t * (x / (y * b)));
} else {
tmp = x / (1.0 + (a + ((y * b) / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.05e-55) or not (y <= 1.15e+91): tmp = (z / b) + (t * (x / (y * 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 <= -2.05e-55) || !(y <= 1.15e+91)) tmp = Float64(Float64(z / b) + Float64(t * Float64(x / Float64(y * 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 <= -2.05e-55) || ~((y <= 1.15e+91))) tmp = (z / b) + (t * (x / (y * 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, -2.05e-55], N[Not[LessEqual[y, 1.15e+91]], $MachinePrecision]], N[(N[(z / b), $MachinePrecision] + N[(t * N[(x / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{-55} \lor \neg \left(y \leq 1.15 \cdot 10^{+91}\right):\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{x}{y \cdot b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\end{array}
\end{array}
if y < -2.0499999999999999e-55 or 1.14999999999999996e91 < y Initial program 61.6%
+-commutative61.6%
associate-/l*66.2%
fma-define66.2%
+-commutative66.2%
associate-/l*67.7%
fma-define67.7%
Simplified67.7%
Taylor expanded in b around inf 35.6%
Taylor expanded in t around 0 60.3%
+-commutative60.3%
associate-/l*61.9%
Simplified61.9%
if -2.0499999999999999e-55 < y < 1.14999999999999996e91Initial program 91.7%
+-commutative91.7%
associate-/l*85.2%
fma-define85.2%
+-commutative85.2%
associate-/l*82.3%
fma-define82.3%
Simplified82.3%
Taylor expanded in z around 0 67.7%
Final simplification64.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.05e-55) (not (<= y 4e+94))) (+ (/ z b) (* t (/ x (* y b)))) (/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.05e-55) || !(y <= 4e+94)) {
tmp = (z / b) + (t * (x / (y * b)));
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-2.05d-55)) .or. (.not. (y <= 4d+94))) then
tmp = (z / b) + (t * (x / (y * b)))
else
tmp = x / (a + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.05e-55) || !(y <= 4e+94)) {
tmp = (z / b) + (t * (x / (y * b)));
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.05e-55) or not (y <= 4e+94): tmp = (z / b) + (t * (x / (y * b))) else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.05e-55) || !(y <= 4e+94)) tmp = Float64(Float64(z / b) + Float64(t * Float64(x / Float64(y * b)))); else tmp = Float64(x / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.05e-55) || ~((y <= 4e+94))) tmp = (z / b) + (t * (x / (y * b))); else tmp = x / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.05e-55], N[Not[LessEqual[y, 4e+94]], $MachinePrecision]], N[(N[(z / b), $MachinePrecision] + N[(t * N[(x / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{-55} \lor \neg \left(y \leq 4 \cdot 10^{+94}\right):\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{x}{y \cdot b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -2.0499999999999999e-55 or 4.0000000000000001e94 < y Initial program 60.7%
+-commutative60.7%
associate-/l*65.4%
fma-define65.4%
+-commutative65.4%
associate-/l*67.0%
fma-define67.0%
Simplified67.0%
Taylor expanded in b around inf 35.6%
Taylor expanded in t around 0 60.9%
+-commutative60.9%
associate-/l*62.5%
Simplified62.5%
if -2.0499999999999999e-55 < y < 4.0000000000000001e94Initial program 91.8%
+-commutative91.8%
associate-/l*85.6%
fma-define85.6%
+-commutative85.6%
associate-/l*82.7%
fma-define82.7%
Simplified82.7%
Taylor expanded in y around 0 59.9%
Final simplification61.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.32e-55) (not (<= y 4.6e+94))) (/ z b) (/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.32e-55) || !(y <= 4.6e+94)) {
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 <= (-1.32d-55)) .or. (.not. (y <= 4.6d+94))) 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 <= -1.32e-55) || !(y <= 4.6e+94)) {
tmp = z / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.32e-55) or not (y <= 4.6e+94): tmp = z / b else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.32e-55) || !(y <= 4.6e+94)) 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 <= -1.32e-55) || ~((y <= 4.6e+94))) 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, -1.32e-55], N[Not[LessEqual[y, 4.6e+94]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.32 \cdot 10^{-55} \lor \neg \left(y \leq 4.6 \cdot 10^{+94}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -1.31999999999999993e-55 or 4.5999999999999999e94 < y Initial program 61.1%
+-commutative61.1%
associate-/l*65.9%
fma-define65.9%
+-commutative65.9%
associate-/l*67.5%
fma-define67.5%
Simplified67.5%
Taylor expanded in y around inf 55.6%
if -1.31999999999999993e-55 < y < 4.5999999999999999e94Initial program 91.2%
+-commutative91.2%
associate-/l*85.0%
fma-define85.0%
+-commutative85.0%
associate-/l*82.1%
fma-define82.1%
Simplified82.1%
Taylor expanded in y around 0 59.5%
Final simplification57.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1e-32) (not (<= a 4.4e-27))) (/ x a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1e-32) || !(a <= 4.4e-27)) {
tmp = x / a;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-1d-32)) .or. (.not. (a <= 4.4d-27))) then
tmp = x / a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1e-32) || !(a <= 4.4e-27)) {
tmp = x / a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1e-32) or not (a <= 4.4e-27): tmp = x / a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1e-32) || !(a <= 4.4e-27)) tmp = Float64(x / a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1e-32) || ~((a <= 4.4e-27))) tmp = x / a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1e-32], N[Not[LessEqual[a, 4.4e-27]], $MachinePrecision]], N[(x / a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \cdot 10^{-32} \lor \neg \left(a \leq 4.4 \cdot 10^{-27}\right):\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.00000000000000006e-32 or 4.39999999999999974e-27 < a Initial program 74.2%
+-commutative74.2%
associate-/l*72.1%
fma-define72.1%
+-commutative72.1%
associate-/l*70.8%
fma-define70.8%
Simplified70.8%
Taylor expanded in z around 0 47.0%
Taylor expanded in a around inf 40.8%
if -1.00000000000000006e-32 < a < 4.39999999999999974e-27Initial program 80.8%
associate-/l*81.0%
associate-/l*80.9%
Simplified80.9%
Taylor expanded in a around 0 80.9%
Taylor expanded in y around 0 39.0%
Final simplification40.0%
(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 77.1%
associate-/l*76.0%
associate-/l*75.3%
Simplified75.3%
Taylor expanded in a around 0 46.5%
Taylor expanded in y around 0 19.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 2024135
(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))))