
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0)))))
(if (<= t_1 (- INFINITY))
(* (/ z t) (/ y (+ 1.0 (+ a (* y (/ b t))))))
(if (<= t_1 INFINITY) t_1 (+ (/ z b) (* (/ t y) (/ x b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (z / t) * (y / (1.0 + (a + (y * (b / t)))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (z / b) + ((t / y) * (x / b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (z / t) * (y / (1.0 + (a + (y * (b / t)))));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (z / b) + ((t / y) * (x / b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)) tmp = 0 if t_1 <= -math.inf: tmp = (z / t) * (y / (1.0 + (a + (y * (b / t))))) elif t_1 <= math.inf: tmp = t_1 else: tmp = (z / b) + ((t / y) * (x / b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(z / t) * Float64(y / Float64(1.0 + Float64(a + Float64(y * Float64(b / t)))))); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(z / b) + Float64(Float64(t / y) * Float64(x / b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)); tmp = 0.0; if (t_1 <= -Inf) tmp = (z / t) * (y / (1.0 + (a + (y * (b / t))))); elseif (t_1 <= Inf) tmp = t_1; else tmp = (z / b) + ((t / y) * (x / b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(z / t), $MachinePrecision] * N[(y / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(z / b), $MachinePrecision] + N[(N[(t / y), $MachinePrecision] * N[(x / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{z}{t} \cdot \frac{y}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 29.3%
*-commutative29.3%
associate-*l/45.2%
associate-+l+45.2%
associate-*r/44.8%
*-commutative44.8%
Simplified44.8%
Taylor expanded in x around 0 60.7%
*-commutative60.7%
times-frac68.1%
associate-*r/42.4%
+-commutative42.4%
associate-*r/68.1%
associate-*l/68.1%
*-commutative68.1%
fma-def68.1%
Simplified68.1%
fma-udef68.1%
Applied egg-rr68.1%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 93.5%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 0.0%
*-commutative0.0%
associate-*l/1.0%
associate-+l+1.0%
associate-*r/23.0%
*-commutative23.0%
Simplified23.0%
Taylor expanded in b around inf 1.0%
Taylor expanded in t around 0 21.3%
Taylor expanded in t around 0 88.6%
*-commutative88.6%
times-frac100.0%
Simplified100.0%
Final simplification93.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (* z (/ y t))) (+ a (+ 1.0 (/ b (/ t y))))))
(t_2 (+ (/ z b) (* (/ t y) (/ x b)))))
(if (<= y -1.05e+151)
t_2
(if (<= y 2.3e+96)
t_1
(if (<= y 1.3e+134) t_2 (if (<= y 6.8e+211) t_1 (/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (z * (y / t))) / (a + (1.0 + (b / (t / y))));
double t_2 = (z / b) + ((t / y) * (x / b));
double tmp;
if (y <= -1.05e+151) {
tmp = t_2;
} else if (y <= 2.3e+96) {
tmp = t_1;
} else if (y <= 1.3e+134) {
tmp = t_2;
} else if (y <= 6.8e+211) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x + (z * (y / t))) / (a + (1.0d0 + (b / (t / y))))
t_2 = (z / b) + ((t / y) * (x / b))
if (y <= (-1.05d+151)) then
tmp = t_2
else if (y <= 2.3d+96) then
tmp = t_1
else if (y <= 1.3d+134) then
tmp = t_2
else if (y <= 6.8d+211) then
tmp = t_1
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (z * (y / t))) / (a + (1.0 + (b / (t / y))));
double t_2 = (z / b) + ((t / y) * (x / b));
double tmp;
if (y <= -1.05e+151) {
tmp = t_2;
} else if (y <= 2.3e+96) {
tmp = t_1;
} else if (y <= 1.3e+134) {
tmp = t_2;
} else if (y <= 6.8e+211) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + (z * (y / t))) / (a + (1.0 + (b / (t / y)))) t_2 = (z / b) + ((t / y) * (x / b)) tmp = 0 if y <= -1.05e+151: tmp = t_2 elif y <= 2.3e+96: tmp = t_1 elif y <= 1.3e+134: tmp = t_2 elif y <= 6.8e+211: tmp = t_1 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + Float64(1.0 + Float64(b / Float64(t / y))))) t_2 = Float64(Float64(z / b) + Float64(Float64(t / y) * Float64(x / b))) tmp = 0.0 if (y <= -1.05e+151) tmp = t_2; elseif (y <= 2.3e+96) tmp = t_1; elseif (y <= 1.3e+134) tmp = t_2; elseif (y <= 6.8e+211) tmp = t_1; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + (z * (y / t))) / (a + (1.0 + (b / (t / y)))); t_2 = (z / b) + ((t / y) * (x / b)); tmp = 0.0; if (y <= -1.05e+151) tmp = t_2; elseif (y <= 2.3e+96) tmp = t_1; elseif (y <= 1.3e+134) tmp = t_2; elseif (y <= 6.8e+211) tmp = t_1; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(b / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z / b), $MachinePrecision] + N[(N[(t / y), $MachinePrecision] * N[(x / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.05e+151], t$95$2, If[LessEqual[y, 2.3e+96], t$95$1, If[LessEqual[y, 1.3e+134], t$95$2, If[LessEqual[y, 6.8e+211], t$95$1, N[(z / b), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + z \cdot \frac{y}{t}}{a + \left(1 + \frac{b}{\frac{t}{y}}\right)}\\
t_2 := \frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\\
\mathbf{if}\;y \leq -1.05 \cdot 10^{+151}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+96}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+134}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+211}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.05e151 or 2.30000000000000015e96 < y < 1.3000000000000001e134Initial program 42.4%
*-commutative42.4%
associate-*l/45.2%
associate-+l+45.2%
associate-*r/53.2%
*-commutative53.2%
Simplified53.2%
Taylor expanded in b around inf 32.5%
Taylor expanded in t around 0 46.4%
Taylor expanded in t around 0 75.8%
*-commutative75.8%
times-frac86.8%
Simplified86.8%
if -1.05e151 < y < 2.30000000000000015e96 or 1.3000000000000001e134 < y < 6.7999999999999998e211Initial program 91.2%
associate-/l*86.5%
associate-*l/87.8%
*-commutative87.8%
cancel-sign-sub87.8%
*-commutative87.8%
associate-*l/86.5%
associate-+r-86.5%
associate-*l/87.8%
*-commutative87.8%
cancel-sign-sub87.8%
*-commutative87.8%
associate-*l/86.5%
*-commutative86.5%
associate-/l*87.9%
Simplified87.9%
associate-/r/92.7%
Applied egg-rr92.7%
if 6.7999999999999998e211 < y Initial program 32.5%
*-commutative32.5%
associate-*l/39.5%
associate-+l+39.5%
associate-*r/52.6%
*-commutative52.6%
Simplified52.6%
Taylor expanded in t around 0 73.3%
Final simplification89.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (/ z b) (* (/ t y) (/ x b)))))
(if (<= y -8.5e+150)
t_1
(if (<= y 2.5e+96)
(/ (+ x (* z (/ y t))) (+ a (+ 1.0 (/ b (/ t y)))))
(if (<= y 4.1e+134)
t_1
(if (<= y 6.4e+214)
(/ (+ x (* y (/ z t))) (+ a (+ 1.0 (* y (/ b t)))))
(/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z / b) + ((t / y) * (x / b));
double tmp;
if (y <= -8.5e+150) {
tmp = t_1;
} else if (y <= 2.5e+96) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (b / (t / y))));
} else if (y <= 4.1e+134) {
tmp = t_1;
} else if (y <= 6.4e+214) {
tmp = (x + (y * (z / t))) / (a + (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) :: t_1
real(8) :: tmp
t_1 = (z / b) + ((t / y) * (x / b))
if (y <= (-8.5d+150)) then
tmp = t_1
else if (y <= 2.5d+96) then
tmp = (x + (z * (y / t))) / (a + (1.0d0 + (b / (t / y))))
else if (y <= 4.1d+134) then
tmp = t_1
else if (y <= 6.4d+214) then
tmp = (x + (y * (z / t))) / (a + (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 t_1 = (z / b) + ((t / y) * (x / b));
double tmp;
if (y <= -8.5e+150) {
tmp = t_1;
} else if (y <= 2.5e+96) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (b / (t / y))));
} else if (y <= 4.1e+134) {
tmp = t_1;
} else if (y <= 6.4e+214) {
tmp = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t))));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z / b) + ((t / y) * (x / b)) tmp = 0 if y <= -8.5e+150: tmp = t_1 elif y <= 2.5e+96: tmp = (x + (z * (y / t))) / (a + (1.0 + (b / (t / y)))) elif y <= 4.1e+134: tmp = t_1 elif y <= 6.4e+214: tmp = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t)))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z / b) + Float64(Float64(t / y) * Float64(x / b))) tmp = 0.0 if (y <= -8.5e+150) tmp = t_1; elseif (y <= 2.5e+96) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + Float64(1.0 + Float64(b / Float64(t / y))))); elseif (y <= 4.1e+134) tmp = t_1; elseif (y <= 6.4e+214) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + 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) t_1 = (z / b) + ((t / y) * (x / b)); tmp = 0.0; if (y <= -8.5e+150) tmp = t_1; elseif (y <= 2.5e+96) tmp = (x + (z * (y / t))) / (a + (1.0 + (b / (t / y)))); elseif (y <= 4.1e+134) tmp = t_1; elseif (y <= 6.4e+214) tmp = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t)))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z / b), $MachinePrecision] + N[(N[(t / y), $MachinePrecision] * N[(x / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.5e+150], t$95$1, If[LessEqual[y, 2.5e+96], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(b / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.1e+134], t$95$1, If[LessEqual[y, 6.4e+214], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\\
\mathbf{if}\;y \leq -8.5 \cdot 10^{+150}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+96}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + \left(1 + \frac{b}{\frac{t}{y}}\right)}\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{+134}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{+214}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + \left(1 + y \cdot \frac{b}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -8.4999999999999999e150 or 2.5000000000000002e96 < y < 4.1000000000000003e134Initial program 42.4%
*-commutative42.4%
associate-*l/45.2%
associate-+l+45.2%
associate-*r/53.2%
*-commutative53.2%
Simplified53.2%
Taylor expanded in b around inf 32.5%
Taylor expanded in t around 0 46.4%
Taylor expanded in t around 0 75.8%
*-commutative75.8%
times-frac86.8%
Simplified86.8%
if -8.4999999999999999e150 < y < 2.5000000000000002e96Initial program 92.0%
associate-/l*87.1%
associate-*l/87.4%
*-commutative87.4%
cancel-sign-sub87.4%
*-commutative87.4%
associate-*l/87.1%
associate-+r-87.1%
associate-*l/87.4%
*-commutative87.4%
cancel-sign-sub87.4%
*-commutative87.4%
associate-*l/87.1%
*-commutative87.1%
associate-/l*87.5%
Simplified87.5%
associate-/r/92.4%
Applied egg-rr92.4%
if 4.1000000000000003e134 < y < 6.3999999999999999e214Initial program 71.0%
*-commutative71.0%
associate-*l/71.9%
associate-+l+71.9%
associate-*r/99.6%
*-commutative99.6%
Simplified99.6%
if 6.3999999999999999e214 < y Initial program 32.5%
*-commutative32.5%
associate-*l/39.5%
associate-+l+39.5%
associate-*r/52.6%
*-commutative52.6%
Simplified52.6%
Taylor expanded in t around 0 73.3%
Final simplification89.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -1.9e-165)
(/ (+ x (/ y (/ t z))) (+ a (+ 1.0 (/ b (/ t y)))))
(if (<= t 3.4e-208)
(+ (/ z b) (* (/ t y) (/ x b)))
(if (<= t 6e-140)
(/ (* y z) (+ (* y b) (* t (+ a 1.0))))
(/ (+ x (* y (/ z t))) (+ a (+ 1.0 (* y (/ b t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.9e-165) {
tmp = (x + (y / (t / z))) / (a + (1.0 + (b / (t / y))));
} else if (t <= 3.4e-208) {
tmp = (z / b) + ((t / y) * (x / b));
} else if (t <= 6e-140) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else {
tmp = (x + (y * (z / t))) / (a + (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 (t <= (-1.9d-165)) then
tmp = (x + (y / (t / z))) / (a + (1.0d0 + (b / (t / y))))
else if (t <= 3.4d-208) then
tmp = (z / b) + ((t / y) * (x / b))
else if (t <= 6d-140) then
tmp = (y * z) / ((y * b) + (t * (a + 1.0d0)))
else
tmp = (x + (y * (z / t))) / (a + (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 (t <= -1.9e-165) {
tmp = (x + (y / (t / z))) / (a + (1.0 + (b / (t / y))));
} else if (t <= 3.4e-208) {
tmp = (z / b) + ((t / y) * (x / b));
} else if (t <= 6e-140) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else {
tmp = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.9e-165: tmp = (x + (y / (t / z))) / (a + (1.0 + (b / (t / y)))) elif t <= 3.4e-208: tmp = (z / b) + ((t / y) * (x / b)) elif t <= 6e-140: tmp = (y * z) / ((y * b) + (t * (a + 1.0))) else: tmp = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.9e-165) tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / Float64(a + Float64(1.0 + Float64(b / Float64(t / y))))); elseif (t <= 3.4e-208) tmp = Float64(Float64(z / b) + Float64(Float64(t / y) * Float64(x / b))); elseif (t <= 6e-140) tmp = Float64(Float64(y * z) / Float64(Float64(y * b) + Float64(t * Float64(a + 1.0)))); else tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + 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 (t <= -1.9e-165) tmp = (x + (y / (t / z))) / (a + (1.0 + (b / (t / y)))); elseif (t <= 3.4e-208) tmp = (z / b) + ((t / y) * (x / b)); elseif (t <= 6e-140) tmp = (y * z) / ((y * b) + (t * (a + 1.0))); else tmp = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.9e-165], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(b / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.4e-208], N[(N[(z / b), $MachinePrecision] + N[(N[(t / y), $MachinePrecision] * N[(x / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e-140], N[(N[(y * z), $MachinePrecision] / N[(N[(y * b), $MachinePrecision] + N[(t * N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{-165}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a + \left(1 + \frac{b}{\frac{t}{y}}\right)}\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{-208}:\\
\;\;\;\;\frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-140}:\\
\;\;\;\;\frac{y \cdot z}{y \cdot b + t \cdot \left(a + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + \left(1 + y \cdot \frac{b}{t}\right)}\\
\end{array}
\end{array}
if t < -1.90000000000000009e-165Initial program 80.2%
associate-/l*79.5%
associate-*l/86.7%
*-commutative86.7%
cancel-sign-sub86.7%
*-commutative86.7%
associate-*l/79.5%
associate-+r-79.5%
associate-*l/86.7%
*-commutative86.7%
cancel-sign-sub86.7%
*-commutative86.7%
associate-*l/79.5%
*-commutative79.5%
associate-/l*87.7%
Simplified87.7%
if -1.90000000000000009e-165 < t < 3.4e-208Initial program 50.7%
*-commutative50.7%
associate-*l/46.1%
associate-+l+46.1%
associate-*r/32.7%
*-commutative32.7%
Simplified32.7%
Taylor expanded in b around inf 39.2%
Taylor expanded in t around 0 58.8%
Taylor expanded in t around 0 80.7%
*-commutative80.7%
times-frac78.5%
Simplified78.5%
if 3.4e-208 < t < 6.00000000000000037e-140Initial program 77.4%
*-commutative77.4%
associate-*l/56.1%
associate-+l+56.1%
associate-*r/55.9%
*-commutative55.9%
Simplified55.9%
Taylor expanded in x around 0 82.6%
Taylor expanded in t around 0 91.2%
if 6.00000000000000037e-140 < t Initial program 86.9%
*-commutative86.9%
associate-*l/88.0%
associate-+l+88.0%
associate-*r/92.3%
*-commutative92.3%
Simplified92.3%
Final simplification88.2%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= y -1.3e-6)
(not (or (<= y 2.5e-52) (and (not (<= y 2.3e+16)) (<= y 4.4e+85)))))
(+ (/ z b) (* (/ t y) (/ x b)))
(/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.3e-6) || !((y <= 2.5e-52) || (!(y <= 2.3e+16) && (y <= 4.4e+85)))) {
tmp = (z / b) + ((t / y) * (x / 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.3d-6)) .or. (.not. (y <= 2.5d-52) .or. (.not. (y <= 2.3d+16)) .and. (y <= 4.4d+85))) then
tmp = (z / b) + ((t / y) * (x / 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.3e-6) || !((y <= 2.5e-52) || (!(y <= 2.3e+16) && (y <= 4.4e+85)))) {
tmp = (z / b) + ((t / y) * (x / b));
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.3e-6) or not ((y <= 2.5e-52) or (not (y <= 2.3e+16) and (y <= 4.4e+85))): tmp = (z / b) + ((t / y) * (x / b)) else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.3e-6) || !((y <= 2.5e-52) || (!(y <= 2.3e+16) && (y <= 4.4e+85)))) tmp = Float64(Float64(z / b) + Float64(Float64(t / y) * Float64(x / 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.3e-6) || ~(((y <= 2.5e-52) || (~((y <= 2.3e+16)) && (y <= 4.4e+85))))) tmp = (z / b) + ((t / y) * (x / b)); else tmp = x / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.3e-6], N[Not[Or[LessEqual[y, 2.5e-52], And[N[Not[LessEqual[y, 2.3e+16]], $MachinePrecision], LessEqual[y, 4.4e+85]]]], $MachinePrecision]], N[(N[(z / b), $MachinePrecision] + N[(N[(t / y), $MachinePrecision] * N[(x / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{-6} \lor \neg \left(y \leq 2.5 \cdot 10^{-52} \lor \neg \left(y \leq 2.3 \cdot 10^{+16}\right) \land y \leq 4.4 \cdot 10^{+85}\right):\\
\;\;\;\;\frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -1.30000000000000005e-6 or 2.5e-52 < y < 2.3e16 or 4.4000000000000003e85 < y Initial program 57.2%
*-commutative57.2%
associate-*l/59.6%
associate-+l+59.6%
associate-*r/68.6%
*-commutative68.6%
Simplified68.6%
Taylor expanded in b around inf 35.3%
Taylor expanded in t around 0 42.4%
Taylor expanded in t around 0 65.5%
*-commutative65.5%
times-frac66.9%
Simplified66.9%
if -1.30000000000000005e-6 < y < 2.5e-52 or 2.3e16 < y < 4.4000000000000003e85Initial program 97.6%
*-commutative97.6%
associate-*l/90.4%
associate-+l+90.4%
associate-*r/86.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in t around inf 63.8%
Final simplification65.4%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= y -1.42e+32)
(not (or (<= y 9.6e-52) (and (not (<= y 5.6e+14)) (<= y 5.5e+87)))))
(+ (/ z b) (* (/ t y) (/ x 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 <= -1.42e+32) || !((y <= 9.6e-52) || (!(y <= 5.6e+14) && (y <= 5.5e+87)))) {
tmp = (z / b) + ((t / y) * (x / 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 <= (-1.42d+32)) .or. (.not. (y <= 9.6d-52) .or. (.not. (y <= 5.6d+14)) .and. (y <= 5.5d+87))) then
tmp = (z / b) + ((t / y) * (x / 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 <= -1.42e+32) || !((y <= 9.6e-52) || (!(y <= 5.6e+14) && (y <= 5.5e+87)))) {
tmp = (z / b) + ((t / y) * (x / b));
} else {
tmp = x / (1.0 + (a + ((y * b) / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.42e+32) or not ((y <= 9.6e-52) or (not (y <= 5.6e+14) and (y <= 5.5e+87))): tmp = (z / b) + ((t / y) * (x / 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 <= -1.42e+32) || !((y <= 9.6e-52) || (!(y <= 5.6e+14) && (y <= 5.5e+87)))) tmp = Float64(Float64(z / b) + Float64(Float64(t / y) * Float64(x / 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 <= -1.42e+32) || ~(((y <= 9.6e-52) || (~((y <= 5.6e+14)) && (y <= 5.5e+87))))) tmp = (z / b) + ((t / y) * (x / 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, -1.42e+32], N[Not[Or[LessEqual[y, 9.6e-52], And[N[Not[LessEqual[y, 5.6e+14]], $MachinePrecision], LessEqual[y, 5.5e+87]]]], $MachinePrecision]], N[(N[(z / b), $MachinePrecision] + N[(N[(t / y), $MachinePrecision] * N[(x / b), $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 -1.42 \cdot 10^{+32} \lor \neg \left(y \leq 9.6 \cdot 10^{-52} \lor \neg \left(y \leq 5.6 \cdot 10^{+14}\right) \land y \leq 5.5 \cdot 10^{+87}\right):\\
\;\;\;\;\frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\end{array}
\end{array}
if y < -1.41999999999999992e32 or 9.6000000000000007e-52 < y < 5.6e14 or 5.50000000000000022e87 < y Initial program 53.2%
*-commutative53.2%
associate-*l/55.9%
associate-+l+55.9%
associate-*r/66.0%
*-commutative66.0%
Simplified66.0%
Taylor expanded in b around inf 33.1%
Taylor expanded in t around 0 41.0%
Taylor expanded in t around 0 65.8%
*-commutative65.8%
times-frac68.3%
Simplified68.3%
if -1.41999999999999992e32 < y < 9.6000000000000007e-52 or 5.6e14 < y < 5.50000000000000022e87Initial program 97.1%
*-commutative97.1%
associate-*l/90.6%
associate-+l+90.6%
associate-*r/86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in x around inf 69.4%
Final simplification68.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (/ z b) (* (/ t y) (/ x b)))))
(if (<= y -1.5e+64)
t_1
(if (<= y 1e-51)
(/ x (+ (+ a 1.0) (* b (/ y t))))
(if (or (<= y 1.55e+16) (not (<= y 3.7e+87)))
t_1
(/ x (+ 1.0 (+ a (/ (* y b) t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z / b) + ((t / y) * (x / b));
double tmp;
if (y <= -1.5e+64) {
tmp = t_1;
} else if (y <= 1e-51) {
tmp = x / ((a + 1.0) + (b * (y / t)));
} else if ((y <= 1.55e+16) || !(y <= 3.7e+87)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (z / b) + ((t / y) * (x / b))
if (y <= (-1.5d+64)) then
tmp = t_1
else if (y <= 1d-51) then
tmp = x / ((a + 1.0d0) + (b * (y / t)))
else if ((y <= 1.55d+16) .or. (.not. (y <= 3.7d+87))) then
tmp = t_1
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 t_1 = (z / b) + ((t / y) * (x / b));
double tmp;
if (y <= -1.5e+64) {
tmp = t_1;
} else if (y <= 1e-51) {
tmp = x / ((a + 1.0) + (b * (y / t)));
} else if ((y <= 1.55e+16) || !(y <= 3.7e+87)) {
tmp = t_1;
} else {
tmp = x / (1.0 + (a + ((y * b) / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z / b) + ((t / y) * (x / b)) tmp = 0 if y <= -1.5e+64: tmp = t_1 elif y <= 1e-51: tmp = x / ((a + 1.0) + (b * (y / t))) elif (y <= 1.55e+16) or not (y <= 3.7e+87): tmp = t_1 else: tmp = x / (1.0 + (a + ((y * b) / t))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z / b) + Float64(Float64(t / y) * Float64(x / b))) tmp = 0.0 if (y <= -1.5e+64) tmp = t_1; elseif (y <= 1e-51) tmp = Float64(x / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))); elseif ((y <= 1.55e+16) || !(y <= 3.7e+87)) tmp = t_1; 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) t_1 = (z / b) + ((t / y) * (x / b)); tmp = 0.0; if (y <= -1.5e+64) tmp = t_1; elseif (y <= 1e-51) tmp = x / ((a + 1.0) + (b * (y / t))); elseif ((y <= 1.55e+16) || ~((y <= 3.7e+87))) tmp = t_1; else tmp = x / (1.0 + (a + ((y * b) / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z / b), $MachinePrecision] + N[(N[(t / y), $MachinePrecision] * N[(x / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.5e+64], t$95$1, If[LessEqual[y, 1e-51], N[(x / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 1.55e+16], N[Not[LessEqual[y, 3.7e+87]], $MachinePrecision]], t$95$1, N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\\
\mathbf{if}\;y \leq -1.5 \cdot 10^{+64}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 10^{-51}:\\
\;\;\;\;\frac{x}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+16} \lor \neg \left(y \leq 3.7 \cdot 10^{+87}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\end{array}
\end{array}
if y < -1.5000000000000001e64 or 1e-51 < y < 1.55e16 or 3.70000000000000003e87 < y Initial program 52.8%
*-commutative52.8%
associate-*l/55.9%
associate-+l+55.9%
associate-*r/65.2%
*-commutative65.2%
Simplified65.2%
Taylor expanded in b around inf 35.2%
Taylor expanded in t around 0 42.1%
Taylor expanded in t around 0 67.8%
*-commutative67.8%
times-frac70.5%
Simplified70.5%
if -1.5000000000000001e64 < y < 1e-51Initial program 93.4%
*-commutative93.4%
associate-*l/86.4%
associate-+l+86.4%
associate-*r/83.7%
*-commutative83.7%
Simplified83.7%
Taylor expanded in x around inf 68.4%
associate-+r+68.4%
associate-*r/69.1%
Simplified69.1%
if 1.55e16 < y < 3.70000000000000003e87Initial program 99.8%
*-commutative99.8%
associate-*l/99.8%
associate-+l+99.8%
associate-*r/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 59.3%
Final simplification68.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1600000.0) (not (<= b 3.1e+56))) (+ (/ z b) (* (/ t y) (/ x b))) (* (/ 1.0 (+ a 1.0)) (+ x (* z (/ y t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1600000.0) || !(b <= 3.1e+56)) {
tmp = (z / b) + ((t / y) * (x / b));
} else {
tmp = (1.0 / (a + 1.0)) * (x + (z * (y / 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 ((b <= (-1600000.0d0)) .or. (.not. (b <= 3.1d+56))) then
tmp = (z / b) + ((t / y) * (x / b))
else
tmp = (1.0d0 / (a + 1.0d0)) * (x + (z * (y / 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 ((b <= -1600000.0) || !(b <= 3.1e+56)) {
tmp = (z / b) + ((t / y) * (x / b));
} else {
tmp = (1.0 / (a + 1.0)) * (x + (z * (y / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1600000.0) or not (b <= 3.1e+56): tmp = (z / b) + ((t / y) * (x / b)) else: tmp = (1.0 / (a + 1.0)) * (x + (z * (y / t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1600000.0) || !(b <= 3.1e+56)) tmp = Float64(Float64(z / b) + Float64(Float64(t / y) * Float64(x / b))); else tmp = Float64(Float64(1.0 / Float64(a + 1.0)) * Float64(x + Float64(z * Float64(y / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -1600000.0) || ~((b <= 3.1e+56))) tmp = (z / b) + ((t / y) * (x / b)); else tmp = (1.0 / (a + 1.0)) * (x + (z * (y / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1600000.0], N[Not[LessEqual[b, 3.1e+56]], $MachinePrecision]], N[(N[(z / b), $MachinePrecision] + N[(N[(t / y), $MachinePrecision] * N[(x / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(a + 1.0), $MachinePrecision]), $MachinePrecision] * N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1600000 \lor \neg \left(b \leq 3.1 \cdot 10^{+56}\right):\\
\;\;\;\;\frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{a + 1} \cdot \left(x + z \cdot \frac{y}{t}\right)\\
\end{array}
\end{array}
if b < -1.6e6 or 3.10000000000000005e56 < b Initial program 59.4%
*-commutative59.4%
associate-*l/57.9%
associate-+l+57.9%
associate-*r/63.6%
*-commutative63.6%
Simplified63.6%
Taylor expanded in b around inf 39.3%
Taylor expanded in t around 0 43.5%
Taylor expanded in t around 0 69.4%
*-commutative69.4%
times-frac75.1%
Simplified75.1%
if -1.6e6 < b < 3.10000000000000005e56Initial program 89.8%
*-commutative89.8%
associate-*l/86.8%
associate-+l+86.8%
associate-*r/86.8%
*-commutative86.8%
Simplified86.8%
Taylor expanded in b around 0 78.9%
clear-num78.5%
associate-/r/78.8%
div-inv78.8%
*-commutative78.8%
associate-*l*79.4%
div-inv79.4%
Applied egg-rr79.4%
Final simplification77.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -2850000.0) (not (<= b 3e+52))) (+ (/ z b) (* (/ t y) (/ x b))) (/ (+ x (/ (* y z) t)) (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2850000.0) || !(b <= 3e+52)) {
tmp = (z / b) + ((t / y) * (x / b));
} else {
tmp = (x + ((y * z) / t)) / (a + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-2850000.0d0)) .or. (.not. (b <= 3d+52))) then
tmp = (z / b) + ((t / y) * (x / b))
else
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2850000.0) || !(b <= 3e+52)) {
tmp = (z / b) + ((t / y) * (x / b));
} else {
tmp = (x + ((y * z) / t)) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -2850000.0) or not (b <= 3e+52): tmp = (z / b) + ((t / y) * (x / b)) else: tmp = (x + ((y * z) / t)) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -2850000.0) || !(b <= 3e+52)) tmp = Float64(Float64(z / b) + Float64(Float64(t / y) * Float64(x / b))); else tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -2850000.0) || ~((b <= 3e+52))) tmp = (z / b) + ((t / y) * (x / b)); else tmp = (x + ((y * z) / t)) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -2850000.0], N[Not[LessEqual[b, 3e+52]], $MachinePrecision]], N[(N[(z / b), $MachinePrecision] + N[(N[(t / y), $MachinePrecision] * N[(x / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2850000 \lor \neg \left(b \leq 3 \cdot 10^{+52}\right):\\
\;\;\;\;\frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\end{array}
\end{array}
if b < -2.85e6 or 3e52 < b Initial program 59.4%
*-commutative59.4%
associate-*l/57.9%
associate-+l+57.9%
associate-*r/63.6%
*-commutative63.6%
Simplified63.6%
Taylor expanded in b around inf 39.3%
Taylor expanded in t around 0 43.5%
Taylor expanded in t around 0 69.4%
*-commutative69.4%
times-frac75.1%
Simplified75.1%
if -2.85e6 < b < 3e52Initial program 89.8%
*-commutative89.8%
associate-*l/86.8%
associate-+l+86.8%
associate-*r/86.8%
*-commutative86.8%
Simplified86.8%
Taylor expanded in b around 0 78.9%
Final simplification77.4%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= y -2.2e-6)
(and (not (<= y 1e-51)) (or (<= y 2.7e+15) (not (<= y 3.4e+84)))))
(/ z b)
(/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.2e-6) || (!(y <= 1e-51) && ((y <= 2.7e+15) || !(y <= 3.4e+84)))) {
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 <= (-2.2d-6)) .or. (.not. (y <= 1d-51)) .and. (y <= 2.7d+15) .or. (.not. (y <= 3.4d+84))) 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 <= -2.2e-6) || (!(y <= 1e-51) && ((y <= 2.7e+15) || !(y <= 3.4e+84)))) {
tmp = z / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.2e-6) or (not (y <= 1e-51) and ((y <= 2.7e+15) or not (y <= 3.4e+84))): tmp = z / b else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.2e-6) || (!(y <= 1e-51) && ((y <= 2.7e+15) || !(y <= 3.4e+84)))) 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 <= -2.2e-6) || (~((y <= 1e-51)) && ((y <= 2.7e+15) || ~((y <= 3.4e+84))))) 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, -2.2e-6], And[N[Not[LessEqual[y, 1e-51]], $MachinePrecision], Or[LessEqual[y, 2.7e+15], N[Not[LessEqual[y, 3.4e+84]], $MachinePrecision]]]], N[(z / b), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{-6} \lor \neg \left(y \leq 10^{-51}\right) \land \left(y \leq 2.7 \cdot 10^{+15} \lor \neg \left(y \leq 3.4 \cdot 10^{+84}\right)\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -2.2000000000000001e-6 or 1e-51 < y < 2.7e15 or 3.3999999999999998e84 < y Initial program 57.2%
*-commutative57.2%
associate-*l/59.6%
associate-+l+59.6%
associate-*r/68.6%
*-commutative68.6%
Simplified68.6%
Taylor expanded in t around 0 61.3%
if -2.2000000000000001e-6 < y < 1e-51 or 2.7e15 < y < 3.3999999999999998e84Initial program 97.6%
*-commutative97.6%
associate-*l/90.4%
associate-+l+90.4%
associate-*r/86.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in t around inf 63.8%
Final simplification62.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2e+185) (not (<= a 6.3e+28))) (/ x a) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2e+185) || !(a <= 6.3e+28)) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-2d+185)) .or. (.not. (a <= 6.3d+28))) then
tmp = x / a
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2e+185) || !(a <= 6.3e+28)) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2e+185) or not (a <= 6.3e+28): tmp = x / a else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2e+185) || !(a <= 6.3e+28)) tmp = Float64(x / a); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -2e+185) || ~((a <= 6.3e+28))) tmp = x / a; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2e+185], N[Not[LessEqual[a, 6.3e+28]], $MachinePrecision]], N[(x / a), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{+185} \lor \neg \left(a \leq 6.3 \cdot 10^{+28}\right):\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if a < -2e185 or 6.3000000000000001e28 < a Initial program 87.7%
*-commutative87.7%
associate-*l/85.3%
associate-+l+85.3%
associate-*r/84.0%
*-commutative84.0%
Simplified84.0%
Taylor expanded in x around inf 65.1%
Taylor expanded in a around inf 61.7%
if -2e185 < a < 6.3000000000000001e28Initial program 73.2%
*-commutative73.2%
associate-*l/70.8%
associate-+l+70.8%
associate-*r/74.7%
*-commutative74.7%
Simplified74.7%
Taylor expanded in t around 0 43.5%
Final simplification49.1%
(FPCore (x y z t a b) :precision binary64 (/ x a))
double code(double x, double y, double z, double t, double a, double b) {
return x / a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x / a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x / a;
}
def code(x, y, z, t, a, b): return x / a
function code(x, y, z, t, a, b) return Float64(x / a) end
function tmp = code(x, y, z, t, a, b) tmp = x / a; end
code[x_, y_, z_, t_, a_, b_] := N[(x / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{a}
\end{array}
Initial program 77.7%
*-commutative77.7%
associate-*l/75.3%
associate-+l+75.3%
associate-*r/77.6%
*-commutative77.6%
Simplified77.6%
Taylor expanded in x around inf 51.2%
Taylor expanded in a around inf 25.7%
Final simplification25.7%
(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 2023305
(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))))