
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0)))))
(if (or (<= t_1 -5e-318) (and (not (<= t_1 0.0)) (<= t_1 2e+243)))
t_1
(/ (+ z (* x (/ t y))) 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 <= -5e-318) || (!(t_1 <= 0.0) && (t_1 <= 2e+243))) {
tmp = t_1;
} else {
tmp = (z + (x * (t / y))) / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0d0))
if ((t_1 <= (-5d-318)) .or. (.not. (t_1 <= 0.0d0)) .and. (t_1 <= 2d+243)) then
tmp = t_1
else
tmp = (z + (x * (t / y))) / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if ((t_1 <= -5e-318) || (!(t_1 <= 0.0) && (t_1 <= 2e+243))) {
tmp = t_1;
} else {
tmp = (z + (x * (t / y))) / 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 <= -5e-318) or (not (t_1 <= 0.0) and (t_1 <= 2e+243)): tmp = t_1 else: tmp = (z + (x * (t / y))) / 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 <= -5e-318) || (!(t_1 <= 0.0) && (t_1 <= 2e+243))) tmp = t_1; else tmp = Float64(Float64(z + Float64(x * Float64(t / y))) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)); tmp = 0.0; if ((t_1 <= -5e-318) || (~((t_1 <= 0.0)) && (t_1 <= 2e+243))) tmp = t_1; else tmp = (z + (x * (t / y))) / 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[Or[LessEqual[t$95$1, -5e-318], And[N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision], LessEqual[t$95$1, 2e+243]]], t$95$1, N[(N[(z + N[(x * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{-318} \lor \neg \left(t_1 \leq 0\right) \land t_1 \leq 2 \cdot 10^{+243}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z + x \cdot \frac{t}{y}}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -4.9999987e-318 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e243Initial program 96.5%
if -4.9999987e-318 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0 or 2.0000000000000001e243 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 25.7%
*-commutative25.7%
associate-/l*25.1%
associate-*l/32.9%
Simplified32.9%
Taylor expanded in y around -inf 67.4%
+-commutative67.4%
associate-*r/67.4%
distribute-lft-out--67.4%
associate-*r*67.4%
metadata-eval67.4%
*-lft-identity67.4%
Simplified73.3%
Taylor expanded in b around inf 78.6%
+-commutative78.6%
associate-/l*79.9%
Simplified79.9%
associate-/r/81.0%
Applied egg-rr81.0%
Final simplification91.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -4.2e+104)
(/ (+ z (/ t (/ y x))) b)
(if (<= y 2.2e+80)
(/ (+ x (* z (/ y t))) (+ (* b (/ y t)) (+ a 1.0)))
(/ (+ z (* x (/ t y))) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.2e+104) {
tmp = (z + (t / (y / x))) / b;
} else if (y <= 2.2e+80) {
tmp = (x + (z * (y / t))) / ((b * (y / t)) + (a + 1.0));
} else {
tmp = (z + (x * (t / y))) / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-4.2d+104)) then
tmp = (z + (t / (y / x))) / b
else if (y <= 2.2d+80) then
tmp = (x + (z * (y / t))) / ((b * (y / t)) + (a + 1.0d0))
else
tmp = (z + (x * (t / y))) / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.2e+104) {
tmp = (z + (t / (y / x))) / b;
} else if (y <= 2.2e+80) {
tmp = (x + (z * (y / t))) / ((b * (y / t)) + (a + 1.0));
} else {
tmp = (z + (x * (t / y))) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -4.2e+104: tmp = (z + (t / (y / x))) / b elif y <= 2.2e+80: tmp = (x + (z * (y / t))) / ((b * (y / t)) + (a + 1.0)) else: tmp = (z + (x * (t / y))) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4.2e+104) tmp = Float64(Float64(z + Float64(t / Float64(y / x))) / b); elseif (y <= 2.2e+80) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(Float64(b * Float64(y / t)) + Float64(a + 1.0))); else tmp = Float64(Float64(z + Float64(x * Float64(t / y))) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -4.2e+104) tmp = (z + (t / (y / x))) / b; elseif (y <= 2.2e+80) tmp = (x + (z * (y / t))) / ((b * (y / t)) + (a + 1.0)); else tmp = (z + (x * (t / y))) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.2e+104], N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[y, 2.2e+80], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(x * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+104}:\\
\;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+80}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{b \cdot \frac{y}{t} + \left(a + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + x \cdot \frac{t}{y}}{b}\\
\end{array}
\end{array}
if y < -4.1999999999999997e104Initial program 36.9%
*-commutative36.9%
associate-/l*34.5%
associate-*l/36.2%
Simplified36.2%
Taylor expanded in y around -inf 59.1%
+-commutative59.1%
associate-*r/59.1%
distribute-lft-out--59.1%
associate-*r*59.1%
metadata-eval59.1%
*-lft-identity59.1%
Simplified59.2%
Taylor expanded in b around inf 72.3%
+-commutative72.3%
associate-/l*74.2%
Simplified74.2%
if -4.1999999999999997e104 < y < 2.20000000000000003e80Initial program 93.0%
*-commutative93.0%
associate-/l*93.6%
associate-*l/93.6%
Simplified93.6%
div-inv93.6%
clear-num93.6%
Applied egg-rr93.6%
if 2.20000000000000003e80 < y Initial program 46.6%
*-commutative46.6%
associate-/l*39.0%
associate-*l/43.6%
Simplified43.6%
Taylor expanded in y around -inf 49.7%
+-commutative49.7%
associate-*r/49.7%
distribute-lft-out--49.7%
associate-*r*49.7%
metadata-eval49.7%
*-lft-identity49.7%
Simplified65.9%
Taylor expanded in b around inf 67.7%
+-commutative67.7%
associate-/l*69.8%
Simplified69.8%
associate-/r/71.7%
Applied egg-rr71.7%
Final simplification85.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ 1.0 (+ a (/ (* y b) t))))))
(if (<= y -4.3e+104)
(/ (+ z (/ t (/ y x))) b)
(if (<= y 2e-65)
t_1
(if (<= y 4.7e-29)
(/ z b)
(if (<= y 2.3e+35)
t_1
(if (<= y 9.2e+58)
(* (/ y t) (/ z (+ a 1.0)))
(/ (+ z (* x (/ t y))) b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 + (a + ((y * b) / t)));
double tmp;
if (y <= -4.3e+104) {
tmp = (z + (t / (y / x))) / b;
} else if (y <= 2e-65) {
tmp = t_1;
} else if (y <= 4.7e-29) {
tmp = z / b;
} else if (y <= 2.3e+35) {
tmp = t_1;
} else if (y <= 9.2e+58) {
tmp = (y / t) * (z / (a + 1.0));
} else {
tmp = (z + (x * (t / y))) / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (1.0d0 + (a + ((y * b) / t)))
if (y <= (-4.3d+104)) then
tmp = (z + (t / (y / x))) / b
else if (y <= 2d-65) then
tmp = t_1
else if (y <= 4.7d-29) then
tmp = z / b
else if (y <= 2.3d+35) then
tmp = t_1
else if (y <= 9.2d+58) then
tmp = (y / t) * (z / (a + 1.0d0))
else
tmp = (z + (x * (t / y))) / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 + (a + ((y * b) / t)));
double tmp;
if (y <= -4.3e+104) {
tmp = (z + (t / (y / x))) / b;
} else if (y <= 2e-65) {
tmp = t_1;
} else if (y <= 4.7e-29) {
tmp = z / b;
} else if (y <= 2.3e+35) {
tmp = t_1;
} else if (y <= 9.2e+58) {
tmp = (y / t) * (z / (a + 1.0));
} else {
tmp = (z + (x * (t / y))) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 + (a + ((y * b) / t))) tmp = 0 if y <= -4.3e+104: tmp = (z + (t / (y / x))) / b elif y <= 2e-65: tmp = t_1 elif y <= 4.7e-29: tmp = z / b elif y <= 2.3e+35: tmp = t_1 elif y <= 9.2e+58: tmp = (y / t) * (z / (a + 1.0)) else: tmp = (z + (x * (t / y))) / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))) tmp = 0.0 if (y <= -4.3e+104) tmp = Float64(Float64(z + Float64(t / Float64(y / x))) / b); elseif (y <= 2e-65) tmp = t_1; elseif (y <= 4.7e-29) tmp = Float64(z / b); elseif (y <= 2.3e+35) tmp = t_1; elseif (y <= 9.2e+58) tmp = Float64(Float64(y / t) * Float64(z / Float64(a + 1.0))); else tmp = Float64(Float64(z + Float64(x * Float64(t / y))) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 + (a + ((y * b) / t))); tmp = 0.0; if (y <= -4.3e+104) tmp = (z + (t / (y / x))) / b; elseif (y <= 2e-65) tmp = t_1; elseif (y <= 4.7e-29) tmp = z / b; elseif (y <= 2.3e+35) tmp = t_1; elseif (y <= 9.2e+58) tmp = (y / t) * (z / (a + 1.0)); else tmp = (z + (x * (t / y))) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.3e+104], N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[y, 2e-65], t$95$1, If[LessEqual[y, 4.7e-29], N[(z / b), $MachinePrecision], If[LessEqual[y, 2.3e+35], t$95$1, If[LessEqual[y, 9.2e+58], N[(N[(y / t), $MachinePrecision] * N[(z / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(x * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{if}\;y \leq -4.3 \cdot 10^{+104}:\\
\;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{-29}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+35}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{+58}:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + x \cdot \frac{t}{y}}{b}\\
\end{array}
\end{array}
if y < -4.3000000000000002e104Initial program 36.9%
*-commutative36.9%
associate-/l*34.5%
associate-*l/36.2%
Simplified36.2%
Taylor expanded in y around -inf 59.1%
+-commutative59.1%
associate-*r/59.1%
distribute-lft-out--59.1%
associate-*r*59.1%
metadata-eval59.1%
*-lft-identity59.1%
Simplified59.2%
Taylor expanded in b around inf 72.3%
+-commutative72.3%
associate-/l*74.2%
Simplified74.2%
if -4.3000000000000002e104 < y < 1.99999999999999985e-65 or 4.6999999999999998e-29 < y < 2.2999999999999998e35Initial program 95.7%
*-commutative95.7%
associate-/l*96.3%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in x around inf 72.6%
if 1.99999999999999985e-65 < y < 4.6999999999999998e-29Initial program 72.9%
*-commutative72.9%
associate-/l*72.8%
associate-*l/73.0%
Simplified73.0%
Taylor expanded in t around 0 72.1%
if 2.2999999999999998e35 < y < 9.2000000000000001e58Initial program 67.2%
*-commutative67.2%
associate-/l*68.0%
associate-*l/68.0%
Simplified68.0%
Taylor expanded in b around 0 67.7%
Taylor expanded in y around inf 83.3%
times-frac84.1%
Simplified84.1%
if 9.2000000000000001e58 < y Initial program 48.7%
*-commutative48.7%
associate-/l*41.7%
associate-*l/46.0%
Simplified46.0%
Taylor expanded in y around -inf 49.9%
+-commutative49.9%
associate-*r/49.9%
distribute-lft-out--49.9%
associate-*r*49.9%
metadata-eval49.9%
*-lft-identity49.9%
Simplified64.8%
Taylor expanded in b around inf 66.5%
+-commutative66.5%
associate-/l*68.5%
Simplified68.5%
associate-/r/70.3%
Applied egg-rr70.3%
Final simplification72.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ (* b (/ y t)) (+ a 1.0)))))
(if (<= t -2.15e-41)
t_1
(if (<= t 2e-48)
(/ (+ z (/ (* x t) y)) b)
(if (<= t 10000000000.0)
(/ (+ x (/ (* y z) t)) a)
(if (<= t 2.15e+36) (/ (+ z (* x (/ t y))) b) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / ((b * (y / t)) + (a + 1.0));
double tmp;
if (t <= -2.15e-41) {
tmp = t_1;
} else if (t <= 2e-48) {
tmp = (z + ((x * t) / y)) / b;
} else if (t <= 10000000000.0) {
tmp = (x + ((y * z) / t)) / a;
} else if (t <= 2.15e+36) {
tmp = (z + (x * (t / y))) / 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 = x / ((b * (y / t)) + (a + 1.0d0))
if (t <= (-2.15d-41)) then
tmp = t_1
else if (t <= 2d-48) then
tmp = (z + ((x * t) / y)) / b
else if (t <= 10000000000.0d0) then
tmp = (x + ((y * z) / t)) / a
else if (t <= 2.15d+36) then
tmp = (z + (x * (t / y))) / 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 = x / ((b * (y / t)) + (a + 1.0));
double tmp;
if (t <= -2.15e-41) {
tmp = t_1;
} else if (t <= 2e-48) {
tmp = (z + ((x * t) / y)) / b;
} else if (t <= 10000000000.0) {
tmp = (x + ((y * z) / t)) / a;
} else if (t <= 2.15e+36) {
tmp = (z + (x * (t / y))) / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / ((b * (y / t)) + (a + 1.0)) tmp = 0 if t <= -2.15e-41: tmp = t_1 elif t <= 2e-48: tmp = (z + ((x * t) / y)) / b elif t <= 10000000000.0: tmp = (x + ((y * z) / t)) / a elif t <= 2.15e+36: tmp = (z + (x * (t / y))) / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(Float64(b * Float64(y / t)) + Float64(a + 1.0))) tmp = 0.0 if (t <= -2.15e-41) tmp = t_1; elseif (t <= 2e-48) tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); elseif (t <= 10000000000.0) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / a); elseif (t <= 2.15e+36) tmp = Float64(Float64(z + Float64(x * Float64(t / y))) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / ((b * (y / t)) + (a + 1.0)); tmp = 0.0; if (t <= -2.15e-41) tmp = t_1; elseif (t <= 2e-48) tmp = (z + ((x * t) / y)) / b; elseif (t <= 10000000000.0) tmp = (x + ((y * z) / t)) / a; elseif (t <= 2.15e+36) tmp = (z + (x * (t / y))) / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.15e-41], t$95$1, If[LessEqual[t, 2e-48], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t, 10000000000.0], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t, 2.15e+36], N[(N[(z + N[(x * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{b \cdot \frac{y}{t} + \left(a + 1\right)}\\
\mathbf{if}\;t \leq -2.15 \cdot 10^{-41}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-48}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{elif}\;t \leq 10000000000:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a}\\
\mathbf{elif}\;t \leq 2.15 \cdot 10^{+36}:\\
\;\;\;\;\frac{z + x \cdot \frac{t}{y}}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -2.1499999999999999e-41 or 2.15000000000000002e36 < t Initial program 82.0%
*-commutative82.0%
associate-/l*87.7%
associate-*l/94.2%
Simplified94.2%
Taylor expanded in x around inf 76.7%
if -2.1499999999999999e-41 < t < 1.9999999999999999e-48Initial program 62.6%
*-commutative62.6%
associate-/l*54.0%
associate-*l/50.5%
Simplified50.5%
Taylor expanded in y around -inf 56.5%
+-commutative56.5%
associate-*r/56.5%
distribute-lft-out--56.5%
associate-*r*56.5%
metadata-eval56.5%
*-lft-identity56.5%
Simplified60.9%
Taylor expanded in b around inf 71.0%
if 1.9999999999999999e-48 < t < 1e10Initial program 80.4%
*-commutative80.4%
associate-/l*77.2%
associate-*l/74.0%
Simplified74.0%
Taylor expanded in a around inf 55.5%
if 1e10 < t < 2.15000000000000002e36Initial program 79.8%
*-commutative79.8%
associate-/l*80.2%
associate-*l/80.2%
Simplified80.2%
Taylor expanded in y around -inf 40.1%
+-commutative40.1%
associate-*r/40.1%
distribute-lft-out--40.1%
associate-*r*40.1%
metadata-eval40.1%
*-lft-identity40.1%
Simplified60.1%
Taylor expanded in b around inf 60.9%
+-commutative60.9%
associate-/l*61.2%
Simplified61.2%
associate-/r/61.2%
Applied egg-rr61.2%
Final simplification72.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ y (/ t z))) (+ a 1.0))))
(if (<= t -1.95e+14)
t_1
(if (<= t -0.00195)
(/ (+ z (* x (/ t y))) b)
(if (<= t -2.7e-62)
(/ (+ x (/ (* y z) t)) (+ a 1.0))
(if (<= t 2.45e-48) (/ (+ z (/ (* x t) y)) b) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (y / (t / z))) / (a + 1.0);
double tmp;
if (t <= -1.95e+14) {
tmp = t_1;
} else if (t <= -0.00195) {
tmp = (z + (x * (t / y))) / b;
} else if (t <= -2.7e-62) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (t <= 2.45e-48) {
tmp = (z + ((x * t) / y)) / 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 = (x + (y / (t / z))) / (a + 1.0d0)
if (t <= (-1.95d+14)) then
tmp = t_1
else if (t <= (-0.00195d0)) then
tmp = (z + (x * (t / y))) / b
else if (t <= (-2.7d-62)) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else if (t <= 2.45d-48) then
tmp = (z + ((x * t) / y)) / 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 = (x + (y / (t / z))) / (a + 1.0);
double tmp;
if (t <= -1.95e+14) {
tmp = t_1;
} else if (t <= -0.00195) {
tmp = (z + (x * (t / y))) / b;
} else if (t <= -2.7e-62) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (t <= 2.45e-48) {
tmp = (z + ((x * t) / y)) / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + (y / (t / z))) / (a + 1.0) tmp = 0 if t <= -1.95e+14: tmp = t_1 elif t <= -0.00195: tmp = (z + (x * (t / y))) / b elif t <= -2.7e-62: tmp = (x + ((y * z) / t)) / (a + 1.0) elif t <= 2.45e-48: tmp = (z + ((x * t) / y)) / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(y / Float64(t / z))) / Float64(a + 1.0)) tmp = 0.0 if (t <= -1.95e+14) tmp = t_1; elseif (t <= -0.00195) tmp = Float64(Float64(z + Float64(x * Float64(t / y))) / b); elseif (t <= -2.7e-62) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); elseif (t <= 2.45e-48) tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + (y / (t / z))) / (a + 1.0); tmp = 0.0; if (t <= -1.95e+14) tmp = t_1; elseif (t <= -0.00195) tmp = (z + (x * (t / y))) / b; elseif (t <= -2.7e-62) tmp = (x + ((y * z) / t)) / (a + 1.0); elseif (t <= 2.45e-48) tmp = (z + ((x * t) / y)) / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.95e+14], t$95$1, If[LessEqual[t, -0.00195], N[(N[(z + N[(x * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t, -2.7e-62], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.45e-48], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{\frac{t}{z}}}{a + 1}\\
\mathbf{if}\;t \leq -1.95 \cdot 10^{+14}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -0.00195:\\
\;\;\;\;\frac{z + x \cdot \frac{t}{y}}{b}\\
\mathbf{elif}\;t \leq -2.7 \cdot 10^{-62}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{elif}\;t \leq 2.45 \cdot 10^{-48}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.95e14 or 2.4500000000000001e-48 < t Initial program 82.1%
*-commutative82.1%
associate-/l*87.1%
associate-*l/92.9%
Simplified92.9%
Taylor expanded in b around 0 73.7%
*-un-lft-identity73.7%
associate-/l*79.1%
Applied egg-rr79.1%
if -1.95e14 < t < -0.0019499999999999999Initial program 51.5%
*-commutative51.5%
associate-/l*51.3%
associate-*l/51.8%
Simplified51.8%
Taylor expanded in y around -inf 84.0%
+-commutative84.0%
associate-*r/84.0%
distribute-lft-out--84.0%
associate-*r*84.0%
metadata-eval84.0%
*-lft-identity84.0%
Simplified100.0%
Taylor expanded in b around inf 100.0%
+-commutative100.0%
associate-/l*100.0%
Simplified100.0%
associate-/r/100.0%
Applied egg-rr100.0%
if -0.0019499999999999999 < t < -2.70000000000000019e-62Initial program 99.8%
*-commutative99.8%
associate-/l*100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in b around 0 80.8%
if -2.70000000000000019e-62 < t < 2.4500000000000001e-48Initial program 62.0%
*-commutative62.0%
associate-/l*53.2%
associate-*l/49.6%
Simplified49.6%
Taylor expanded in y around -inf 57.5%
+-commutative57.5%
associate-*r/57.5%
distribute-lft-out--57.5%
associate-*r*57.5%
metadata-eval57.5%
*-lft-identity57.5%
Simplified61.9%
Taylor expanded in b around inf 72.2%
Final simplification76.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ a 1.0))))
(if (<= t -1.4e+16)
t_1
(if (<= t 2.7e-48)
(/ (+ z (/ (* x t) y)) b)
(if (<= t 68000000000000.0)
(/ (+ x (/ (* y z) t)) a)
(if (<= t 1.4e+38) (/ (+ z (* x (/ t y))) b) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (a + 1.0);
double tmp;
if (t <= -1.4e+16) {
tmp = t_1;
} else if (t <= 2.7e-48) {
tmp = (z + ((x * t) / y)) / b;
} else if (t <= 68000000000000.0) {
tmp = (x + ((y * z) / t)) / a;
} else if (t <= 1.4e+38) {
tmp = (z + (x * (t / y))) / 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 = x / (a + 1.0d0)
if (t <= (-1.4d+16)) then
tmp = t_1
else if (t <= 2.7d-48) then
tmp = (z + ((x * t) / y)) / b
else if (t <= 68000000000000.0d0) then
tmp = (x + ((y * z) / t)) / a
else if (t <= 1.4d+38) then
tmp = (z + (x * (t / y))) / 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 = x / (a + 1.0);
double tmp;
if (t <= -1.4e+16) {
tmp = t_1;
} else if (t <= 2.7e-48) {
tmp = (z + ((x * t) / y)) / b;
} else if (t <= 68000000000000.0) {
tmp = (x + ((y * z) / t)) / a;
} else if (t <= 1.4e+38) {
tmp = (z + (x * (t / y))) / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (a + 1.0) tmp = 0 if t <= -1.4e+16: tmp = t_1 elif t <= 2.7e-48: tmp = (z + ((x * t) / y)) / b elif t <= 68000000000000.0: tmp = (x + ((y * z) / t)) / a elif t <= 1.4e+38: tmp = (z + (x * (t / y))) / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (t <= -1.4e+16) tmp = t_1; elseif (t <= 2.7e-48) tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); elseif (t <= 68000000000000.0) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / a); elseif (t <= 1.4e+38) tmp = Float64(Float64(z + Float64(x * Float64(t / y))) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (a + 1.0); tmp = 0.0; if (t <= -1.4e+16) tmp = t_1; elseif (t <= 2.7e-48) tmp = (z + ((x * t) / y)) / b; elseif (t <= 68000000000000.0) tmp = (x + ((y * z) / t)) / a; elseif (t <= 1.4e+38) tmp = (z + (x * (t / y))) / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.4e+16], t$95$1, If[LessEqual[t, 2.7e-48], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t, 68000000000000.0], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t, 1.4e+38], N[(N[(z + N[(x * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{a + 1}\\
\mathbf{if}\;t \leq -1.4 \cdot 10^{+16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-48}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{elif}\;t \leq 68000000000000:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+38}:\\
\;\;\;\;\frac{z + x \cdot \frac{t}{y}}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.4e16 or 1.4e38 < t Initial program 82.4%
*-commutative82.4%
associate-/l*88.8%
associate-*l/96.2%
Simplified96.2%
Taylor expanded in t around inf 69.6%
if -1.4e16 < t < 2.70000000000000011e-48Initial program 64.4%
*-commutative64.4%
associate-/l*56.6%
associate-*l/53.5%
Simplified53.5%
Taylor expanded in y around -inf 56.0%
+-commutative56.0%
associate-*r/56.0%
distribute-lft-out--56.0%
associate-*r*56.0%
metadata-eval56.0%
*-lft-identity56.0%
Simplified60.6%
Taylor expanded in b around inf 69.7%
if 2.70000000000000011e-48 < t < 6.8e13Initial program 80.4%
*-commutative80.4%
associate-/l*77.2%
associate-*l/74.0%
Simplified74.0%
Taylor expanded in a around inf 55.5%
if 6.8e13 < t < 1.4e38Initial program 79.8%
*-commutative79.8%
associate-/l*80.2%
associate-*l/80.2%
Simplified80.2%
Taylor expanded in y around -inf 40.1%
+-commutative40.1%
associate-*r/40.1%
distribute-lft-out--40.1%
associate-*r*40.1%
metadata-eval40.1%
*-lft-identity40.1%
Simplified60.1%
Taylor expanded in b around inf 60.9%
+-commutative60.9%
associate-/l*61.2%
Simplified61.2%
associate-/r/61.2%
Applied egg-rr61.2%
Final simplification68.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -6.2e-41)
(/ x (+ (* b (/ y t)) (+ a 1.0)))
(if (<= t 1.65e-48)
(/ (+ z (/ (* x t) y)) 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 (t <= -6.2e-41) {
tmp = x / ((b * (y / t)) + (a + 1.0));
} else if (t <= 1.65e-48) {
tmp = (z + ((x * t) / y)) / 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 (t <= (-6.2d-41)) then
tmp = x / ((b * (y / t)) + (a + 1.0d0))
else if (t <= 1.65d-48) then
tmp = (z + ((x * t) / y)) / 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 (t <= -6.2e-41) {
tmp = x / ((b * (y / t)) + (a + 1.0));
} else if (t <= 1.65e-48) {
tmp = (z + ((x * t) / y)) / b;
} else {
tmp = (x + ((y * z) / t)) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -6.2e-41: tmp = x / ((b * (y / t)) + (a + 1.0)) elif t <= 1.65e-48: tmp = (z + ((x * t) / y)) / b else: tmp = (x + ((y * z) / t)) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -6.2e-41) tmp = Float64(x / Float64(Float64(b * Float64(y / t)) + Float64(a + 1.0))); elseif (t <= 1.65e-48) tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / 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 (t <= -6.2e-41) tmp = x / ((b * (y / t)) + (a + 1.0)); elseif (t <= 1.65e-48) tmp = (z + ((x * t) / y)) / b; else tmp = (x + ((y * z) / t)) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -6.2e-41], N[(x / N[(N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.65e-48], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $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}\;t \leq -6.2 \cdot 10^{-41}:\\
\;\;\;\;\frac{x}{b \cdot \frac{y}{t} + \left(a + 1\right)}\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{-48}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\end{array}
\end{array}
if t < -6.20000000000000001e-41Initial program 79.0%
*-commutative79.0%
associate-/l*84.9%
associate-*l/92.4%
Simplified92.4%
Taylor expanded in x around inf 73.9%
if -6.20000000000000001e-41 < t < 1.65e-48Initial program 62.6%
*-commutative62.6%
associate-/l*54.0%
associate-*l/50.5%
Simplified50.5%
Taylor expanded in y around -inf 56.5%
+-commutative56.5%
associate-*r/56.5%
distribute-lft-out--56.5%
associate-*r*56.5%
metadata-eval56.5%
*-lft-identity56.5%
Simplified60.9%
Taylor expanded in b around inf 71.0%
if 1.65e-48 < t Initial program 84.1%
*-commutative84.1%
associate-/l*87.5%
associate-*l/90.8%
Simplified90.8%
Taylor expanded in b around 0 74.2%
Final simplification72.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3600000000000.0) (not (<= t 8.2e+36))) (/ x (+ a 1.0)) (/ (+ z (* x (/ t y))) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3600000000000.0) || !(t <= 8.2e+36)) {
tmp = x / (a + 1.0);
} else {
tmp = (z + (x * (t / y))) / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-3600000000000.0d0)) .or. (.not. (t <= 8.2d+36))) then
tmp = x / (a + 1.0d0)
else
tmp = (z + (x * (t / y))) / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3600000000000.0) || !(t <= 8.2e+36)) {
tmp = x / (a + 1.0);
} else {
tmp = (z + (x * (t / y))) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3600000000000.0) or not (t <= 8.2e+36): tmp = x / (a + 1.0) else: tmp = (z + (x * (t / y))) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3600000000000.0) || !(t <= 8.2e+36)) tmp = Float64(x / Float64(a + 1.0)); else tmp = Float64(Float64(z + Float64(x * Float64(t / y))) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -3600000000000.0) || ~((t <= 8.2e+36))) tmp = x / (a + 1.0); else tmp = (z + (x * (t / y))) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3600000000000.0], N[Not[LessEqual[t, 8.2e+36]], $MachinePrecision]], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(x * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3600000000000 \lor \neg \left(t \leq 8.2 \cdot 10^{+36}\right):\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + x \cdot \frac{t}{y}}{b}\\
\end{array}
\end{array}
if t < -3.6e12 or 8.20000000000000026e36 < t Initial program 82.4%
*-commutative82.4%
associate-/l*88.8%
associate-*l/96.2%
Simplified96.2%
Taylor expanded in t around inf 69.6%
if -3.6e12 < t < 8.20000000000000026e36Initial program 66.5%
*-commutative66.5%
associate-/l*59.4%
associate-*l/56.4%
Simplified56.4%
Taylor expanded in y around -inf 52.7%
+-commutative52.7%
associate-*r/52.7%
distribute-lft-out--52.7%
associate-*r*52.7%
metadata-eval52.7%
*-lft-identity52.7%
Simplified57.3%
Taylor expanded in b around inf 65.3%
+-commutative65.3%
associate-/l*59.6%
Simplified59.6%
associate-/r/64.6%
Applied egg-rr64.6%
Final simplification66.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -68000000000000.0) (not (<= t 6.6e+41))) (/ x (+ a 1.0)) (/ (+ z (/ (* x t) y)) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -68000000000000.0) || !(t <= 6.6e+41)) {
tmp = x / (a + 1.0);
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-68000000000000.0d0)) .or. (.not. (t <= 6.6d+41))) then
tmp = x / (a + 1.0d0)
else
tmp = (z + ((x * t) / y)) / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -68000000000000.0) || !(t <= 6.6e+41)) {
tmp = x / (a + 1.0);
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -68000000000000.0) or not (t <= 6.6e+41): tmp = x / (a + 1.0) else: tmp = (z + ((x * t) / y)) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -68000000000000.0) || !(t <= 6.6e+41)) tmp = Float64(x / Float64(a + 1.0)); else tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -68000000000000.0) || ~((t <= 6.6e+41))) tmp = x / (a + 1.0); else tmp = (z + ((x * t) / y)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -68000000000000.0], N[Not[LessEqual[t, 6.6e+41]], $MachinePrecision]], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -68000000000000 \lor \neg \left(t \leq 6.6 \cdot 10^{+41}\right):\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if t < -6.8e13 or 6.6000000000000001e41 < t Initial program 82.4%
*-commutative82.4%
associate-/l*88.8%
associate-*l/96.2%
Simplified96.2%
Taylor expanded in t around inf 69.6%
if -6.8e13 < t < 6.6000000000000001e41Initial program 66.5%
*-commutative66.5%
associate-/l*59.4%
associate-*l/56.4%
Simplified56.4%
Taylor expanded in y around -inf 52.7%
+-commutative52.7%
associate-*r/52.7%
distribute-lft-out--52.7%
associate-*r*52.7%
metadata-eval52.7%
*-lft-identity52.7%
Simplified57.3%
Taylor expanded in b around inf 65.3%
Final simplification67.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -4500000000000.0) (not (<= t 5.4e-14))) (/ x (+ a 1.0)) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4500000000000.0) || !(t <= 5.4e-14)) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-4500000000000.0d0)) .or. (.not. (t <= 5.4d-14))) then
tmp = x / (a + 1.0d0)
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4500000000000.0) || !(t <= 5.4e-14)) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -4500000000000.0) or not (t <= 5.4e-14): tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -4500000000000.0) || !(t <= 5.4e-14)) tmp = Float64(x / Float64(a + 1.0)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -4500000000000.0) || ~((t <= 5.4e-14))) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -4500000000000.0], N[Not[LessEqual[t, 5.4e-14]], $MachinePrecision]], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4500000000000 \lor \neg \left(t \leq 5.4 \cdot 10^{-14}\right):\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -4.5e12 or 5.3999999999999997e-14 < t Initial program 82.5%
*-commutative82.5%
associate-/l*88.3%
associate-*l/94.9%
Simplified94.9%
Taylor expanded in t around inf 66.1%
if -4.5e12 < t < 5.3999999999999997e-14Initial program 65.0%
*-commutative65.0%
associate-/l*57.4%
associate-*l/54.1%
Simplified54.1%
Taylor expanded in t around 0 56.7%
Final simplification61.0%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.25e-8) (/ x a) (if (<= a 1.0) x (/ x a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.25e-8) {
tmp = x / a;
} else if (a <= 1.0) {
tmp = x;
} else {
tmp = x / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-1.25d-8)) then
tmp = x / a
else if (a <= 1.0d0) then
tmp = x
else
tmp = x / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.25e-8) {
tmp = x / a;
} else if (a <= 1.0) {
tmp = x;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.25e-8: tmp = x / a elif a <= 1.0: tmp = x else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.25e-8) tmp = Float64(x / a); elseif (a <= 1.0) tmp = x; else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.25e-8) tmp = x / a; elseif (a <= 1.0) tmp = x; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.25e-8], N[(x / a), $MachinePrecision], If[LessEqual[a, 1.0], x, N[(x / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.25 \cdot 10^{-8}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq 1:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -1.2499999999999999e-8 or 1 < a Initial program 76.6%
*-commutative76.6%
associate-/l*76.7%
associate-*l/76.4%
Simplified76.4%
Taylor expanded in x around inf 56.2%
Taylor expanded in a around inf 48.7%
if -1.2499999999999999e-8 < a < 1Initial program 68.7%
+-commutative68.7%
*-commutative68.7%
associate-*r/65.2%
fma-def65.2%
associate-+l+65.2%
+-commutative65.2%
associate-*r/63.5%
fma-def63.5%
Simplified63.5%
Taylor expanded in a around 0 68.7%
Taylor expanded in z around 0 46.5%
Taylor expanded in y around 0 32.2%
Final simplification41.1%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1e+38) (/ x a) (if (<= t 7.3e+47) (/ z b) (/ x a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1e+38) {
tmp = x / a;
} else if (t <= 7.3e+47) {
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 (t <= (-1d+38)) then
tmp = x / a
else if (t <= 7.3d+47) 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 (t <= -1e+38) {
tmp = x / a;
} else if (t <= 7.3e+47) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1e+38: tmp = x / a elif t <= 7.3e+47: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1e+38) tmp = Float64(x / a); elseif (t <= 7.3e+47) 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 (t <= -1e+38) tmp = x / a; elseif (t <= 7.3e+47) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1e+38], N[(x / a), $MachinePrecision], If[LessEqual[t, 7.3e+47], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{+38}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;t \leq 7.3 \cdot 10^{+47}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if t < -9.99999999999999977e37 or 7.3000000000000001e47 < t Initial program 84.1%
*-commutative84.1%
associate-/l*89.1%
associate-*l/96.0%
Simplified96.0%
Taylor expanded in x around inf 79.9%
Taylor expanded in a around inf 46.5%
if -9.99999999999999977e37 < t < 7.3000000000000001e47Initial program 66.0%
*-commutative66.0%
associate-/l*60.4%
associate-*l/58.1%
Simplified58.1%
Taylor expanded in t around 0 53.7%
Final simplification50.9%
(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 73.0%
+-commutative73.0%
*-commutative73.0%
associate-*r/70.5%
fma-def70.5%
associate-+l+70.5%
+-commutative70.5%
associate-*r/68.3%
fma-def68.3%
Simplified68.3%
Taylor expanded in a around 0 40.4%
Taylor expanded in z around 0 27.2%
Taylor expanded in y around 0 17.1%
Final simplification17.1%
(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 2023240
(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))))