
(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 -1e-317)
t_1
(if (<= t_1 0.0)
(/ (+ z (/ t (/ y x))) b)
(if (<= t_1 1e+303)
t_1
(if (<= t_1 INFINITY)
(/
1.0
(+ (/ b z) (* (/ t y) (- (/ (+ a 1.0) z) (/ (* x b) (* z z))))))
(/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -1e-317) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (z + (t / (y / x))) / b;
} else if (t_1 <= 1e+303) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = 1.0 / ((b / z) + ((t / y) * (((a + 1.0) / z) - ((x * b) / (z * z)))));
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -1e-317) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (z + (t / (y / x))) / b;
} else if (t_1 <= 1e+303) {
tmp = t_1;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = 1.0 / ((b / z) + ((t / y) * (((a + 1.0) / z) - ((x * b) / (z * z)))));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)) tmp = 0 if t_1 <= -1e-317: tmp = t_1 elif t_1 <= 0.0: tmp = (z + (t / (y / x))) / b elif t_1 <= 1e+303: tmp = t_1 elif t_1 <= math.inf: tmp = 1.0 / ((b / z) + ((t / y) * (((a + 1.0) / z) - ((x * b) / (z * z))))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) tmp = 0.0 if (t_1 <= -1e-317) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(z + Float64(t / Float64(y / x))) / b); elseif (t_1 <= 1e+303) tmp = t_1; elseif (t_1 <= Inf) tmp = Float64(1.0 / Float64(Float64(b / z) + Float64(Float64(t / y) * Float64(Float64(Float64(a + 1.0) / z) - Float64(Float64(x * b) / Float64(z * z)))))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)); tmp = 0.0; if (t_1 <= -1e-317) tmp = t_1; elseif (t_1 <= 0.0) tmp = (z + (t / (y / x))) / b; elseif (t_1 <= 1e+303) tmp = t_1; elseif (t_1 <= Inf) tmp = 1.0 / ((b / z) + ((t / y) * (((a + 1.0) / z) - ((x * b) / (z * z))))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-317], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$1, 1e+303], t$95$1, If[LessEqual[t$95$1, Infinity], N[(1.0 / N[(N[(b / z), $MachinePrecision] + N[(N[(t / y), $MachinePrecision] * N[(N[(N[(a + 1.0), $MachinePrecision] / z), $MachinePrecision] - N[(N[(x * b), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-317}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\mathbf{elif}\;t_1 \leq 10^{+303}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;\frac{1}{\frac{b}{z} + \frac{t}{y} \cdot \left(\frac{a + 1}{z} - \frac{x \cdot b}{z \cdot z}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1.00000023e-317 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1e303Initial program 96.0%
if -1.00000023e-317 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0Initial program 50.0%
*-commutative50.0%
associate-/l*49.2%
associate-*l/55.5%
Simplified55.5%
Taylor expanded in y around -inf 72.1%
+-commutative72.1%
associate-*r/72.1%
distribute-lft-out--72.1%
associate-*r*72.1%
metadata-eval72.1%
*-lft-identity72.1%
Simplified69.9%
Taylor expanded in b around inf 76.7%
+-commutative76.7%
associate-/l*76.7%
Simplified76.7%
if 1e303 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 27.7%
*-commutative27.7%
associate-/l*61.4%
associate-*l/61.4%
Simplified61.4%
clear-num61.3%
inv-pow61.3%
+-commutative61.3%
fma-def61.3%
+-commutative61.3%
div-inv61.2%
clear-num61.2%
fma-udef61.2%
Applied egg-rr61.2%
unpow-161.2%
+-commutative61.2%
Simplified61.2%
Taylor expanded in y around inf 60.0%
associate--l+60.0%
times-frac94.0%
times-frac94.0%
distribute-lft-out--94.0%
*-commutative94.0%
unpow294.0%
Simplified94.0%
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*0.9%
associate-*l/24.1%
Simplified24.1%
Taylor expanded in t around 0 96.4%
Final simplification92.4%
(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 -1e-317)
t_1
(if (<= t_1 0.0)
(/ (+ z (/ t (/ y x))) b)
(if (<= t_1 1e+303)
t_1
(if (<= t_1 INFINITY)
(* (/ y t) (/ z (+ 1.0 (+ a (/ y (/ t b))))))
(/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -1e-317) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (z + (t / (y / x))) / b;
} else if (t_1 <= 1e+303) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = (y / t) * (z / (1.0 + (a + (y / (t / b)))));
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -1e-317) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (z + (t / (y / x))) / b;
} else if (t_1 <= 1e+303) {
tmp = t_1;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (y / t) * (z / (1.0 + (a + (y / (t / b)))));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)) tmp = 0 if t_1 <= -1e-317: tmp = t_1 elif t_1 <= 0.0: tmp = (z + (t / (y / x))) / b elif t_1 <= 1e+303: tmp = t_1 elif t_1 <= math.inf: tmp = (y / t) * (z / (1.0 + (a + (y / (t / b))))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) tmp = 0.0 if (t_1 <= -1e-317) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(z + Float64(t / Float64(y / x))) / b); elseif (t_1 <= 1e+303) tmp = t_1; elseif (t_1 <= Inf) tmp = Float64(Float64(y / t) * Float64(z / Float64(1.0 + Float64(a + Float64(y / Float64(t / b)))))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)); tmp = 0.0; if (t_1 <= -1e-317) tmp = t_1; elseif (t_1 <= 0.0) tmp = (z + (t / (y / x))) / b; elseif (t_1 <= 1e+303) tmp = t_1; elseif (t_1 <= Inf) tmp = (y / t) * (z / (1.0 + (a + (y / (t / b))))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-317], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$1, 1e+303], t$95$1, If[LessEqual[t$95$1, Infinity], N[(N[(y / t), $MachinePrecision] * N[(z / N[(1.0 + N[(a + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-317}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\mathbf{elif}\;t_1 \leq 10^{+303}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{1 + \left(a + \frac{y}{\frac{t}{b}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1.00000023e-317 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1e303Initial program 96.0%
if -1.00000023e-317 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0Initial program 50.0%
*-commutative50.0%
associate-/l*49.2%
associate-*l/55.5%
Simplified55.5%
Taylor expanded in y around -inf 72.1%
+-commutative72.1%
associate-*r/72.1%
distribute-lft-out--72.1%
associate-*r*72.1%
metadata-eval72.1%
*-lft-identity72.1%
Simplified69.9%
Taylor expanded in b around inf 76.7%
+-commutative76.7%
associate-/l*76.7%
Simplified76.7%
if 1e303 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 27.7%
*-commutative27.7%
associate-/l*61.4%
associate-*l/61.4%
Simplified61.4%
Taylor expanded in x around 0 49.5%
times-frac94.2%
+-commutative94.2%
associate-/l*88.4%
Applied egg-rr88.4%
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*0.9%
associate-*l/24.1%
Simplified24.1%
Taylor expanded in t around 0 96.4%
Final simplification92.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* b (/ y t)))))
(t_2 (/ (+ z (/ (* x t) y)) b)))
(if (<= t -2e-9)
t_1
(if (<= t -5.5e-126)
t_2
(if (<= t -1.45e-254)
(/ (* y z) (+ (* y b) (* t (+ a 1.0))))
(if (<= t 4.2e-108) t_2 t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (y * (z / t))) / ((a + 1.0) + (b * (y / t)));
double t_2 = (z + ((x * t) / y)) / b;
double tmp;
if (t <= -2e-9) {
tmp = t_1;
} else if (t <= -5.5e-126) {
tmp = t_2;
} else if (t <= -1.45e-254) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else if (t <= 4.2e-108) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = (x + (y * (z / t))) / ((a + 1.0d0) + (b * (y / t)))
t_2 = (z + ((x * t) / y)) / b
if (t <= (-2d-9)) then
tmp = t_1
else if (t <= (-5.5d-126)) then
tmp = t_2
else if (t <= (-1.45d-254)) then
tmp = (y * z) / ((y * b) + (t * (a + 1.0d0)))
else if (t <= 4.2d-108) then
tmp = t_2
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 * (z / t))) / ((a + 1.0) + (b * (y / t)));
double t_2 = (z + ((x * t) / y)) / b;
double tmp;
if (t <= -2e-9) {
tmp = t_1;
} else if (t <= -5.5e-126) {
tmp = t_2;
} else if (t <= -1.45e-254) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else if (t <= 4.2e-108) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + (y * (z / t))) / ((a + 1.0) + (b * (y / t))) t_2 = (z + ((x * t) / y)) / b tmp = 0 if t <= -2e-9: tmp = t_1 elif t <= -5.5e-126: tmp = t_2 elif t <= -1.45e-254: tmp = (y * z) / ((y * b) + (t * (a + 1.0))) elif t <= 4.2e-108: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))) t_2 = Float64(Float64(z + Float64(Float64(x * t) / y)) / b) tmp = 0.0 if (t <= -2e-9) tmp = t_1; elseif (t <= -5.5e-126) tmp = t_2; elseif (t <= -1.45e-254) tmp = Float64(Float64(y * z) / Float64(Float64(y * b) + Float64(t * Float64(a + 1.0)))); elseif (t <= 4.2e-108) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + (y * (z / t))) / ((a + 1.0) + (b * (y / t))); t_2 = (z + ((x * t) / y)) / b; tmp = 0.0; if (t <= -2e-9) tmp = t_1; elseif (t <= -5.5e-126) tmp = t_2; elseif (t <= -1.45e-254) tmp = (y * z) / ((y * b) + (t * (a + 1.0))); elseif (t <= 4.2e-108) tmp = t_2; 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[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[t, -2e-9], t$95$1, If[LessEqual[t, -5.5e-126], t$95$2, If[LessEqual[t, -1.45e-254], N[(N[(y * z), $MachinePrecision] / N[(N[(y * b), $MachinePrecision] + N[(t * N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.2e-108], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
t_2 := \frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{if}\;t \leq -2 \cdot 10^{-9}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -5.5 \cdot 10^{-126}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.45 \cdot 10^{-254}:\\
\;\;\;\;\frac{y \cdot z}{y \cdot b + t \cdot \left(a + 1\right)}\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-108}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -2.00000000000000012e-9 or 4.1999999999999998e-108 < t Initial program 81.6%
*-commutative81.6%
associate-/l*86.5%
associate-*l/91.9%
Simplified91.9%
associate-/r/90.5%
Applied egg-rr90.5%
if -2.00000000000000012e-9 < t < -5.49999999999999987e-126 or -1.45e-254 < t < 4.1999999999999998e-108Initial program 57.7%
*-commutative57.7%
associate-/l*58.8%
associate-*l/55.9%
Simplified55.9%
Taylor expanded in y around -inf 69.4%
+-commutative69.4%
associate-*r/69.4%
distribute-lft-out--69.4%
associate-*r*69.4%
metadata-eval69.4%
*-lft-identity69.4%
Simplified70.7%
Taylor expanded in b around inf 82.0%
if -5.49999999999999987e-126 < t < -1.45e-254Initial program 69.5%
*-commutative69.5%
associate-/l*52.6%
associate-*l/50.8%
Simplified50.8%
Taylor expanded in x around 0 69.9%
Taylor expanded in t around 0 89.6%
Final simplification88.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ z (/ t y))) (+ (+ a 1.0) (* b (/ y t)))))
(t_2 (/ (+ z (/ (* x t) y)) b)))
(if (<= t -2e-9)
t_1
(if (<= t -1.4e-125)
t_2
(if (<= t -2.6e-255)
(/ (* y z) (+ (* y b) (* t (+ a 1.0))))
(if (<= t 2.4e-110) t_2 t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t)));
double t_2 = (z + ((x * t) / y)) / b;
double tmp;
if (t <= -2e-9) {
tmp = t_1;
} else if (t <= -1.4e-125) {
tmp = t_2;
} else if (t <= -2.6e-255) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else if (t <= 2.4e-110) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = (x + (z / (t / y))) / ((a + 1.0d0) + (b * (y / t)))
t_2 = (z + ((x * t) / y)) / b
if (t <= (-2d-9)) then
tmp = t_1
else if (t <= (-1.4d-125)) then
tmp = t_2
else if (t <= (-2.6d-255)) then
tmp = (y * z) / ((y * b) + (t * (a + 1.0d0)))
else if (t <= 2.4d-110) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t)));
double t_2 = (z + ((x * t) / y)) / b;
double tmp;
if (t <= -2e-9) {
tmp = t_1;
} else if (t <= -1.4e-125) {
tmp = t_2;
} else if (t <= -2.6e-255) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else if (t <= 2.4e-110) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t))) t_2 = (z + ((x * t) / y)) / b tmp = 0 if t <= -2e-9: tmp = t_1 elif t <= -1.4e-125: tmp = t_2 elif t <= -2.6e-255: tmp = (y * z) / ((y * b) + (t * (a + 1.0))) elif t <= 2.4e-110: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(z / Float64(t / y))) / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))) t_2 = Float64(Float64(z + Float64(Float64(x * t) / y)) / b) tmp = 0.0 if (t <= -2e-9) tmp = t_1; elseif (t <= -1.4e-125) tmp = t_2; elseif (t <= -2.6e-255) tmp = Float64(Float64(y * z) / Float64(Float64(y * b) + Float64(t * Float64(a + 1.0)))); elseif (t <= 2.4e-110) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t))); t_2 = (z + ((x * t) / y)) / b; tmp = 0.0; if (t <= -2e-9) tmp = t_1; elseif (t <= -1.4e-125) tmp = t_2; elseif (t <= -2.6e-255) tmp = (y * z) / ((y * b) + (t * (a + 1.0))); elseif (t <= 2.4e-110) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[t, -2e-9], t$95$1, If[LessEqual[t, -1.4e-125], t$95$2, If[LessEqual[t, -2.6e-255], N[(N[(y * z), $MachinePrecision] / N[(N[(y * b), $MachinePrecision] + N[(t * N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e-110], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{z}{\frac{t}{y}}}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
t_2 := \frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{if}\;t \leq -2 \cdot 10^{-9}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.4 \cdot 10^{-125}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -2.6 \cdot 10^{-255}:\\
\;\;\;\;\frac{y \cdot z}{y \cdot b + t \cdot \left(a + 1\right)}\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-110}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -2.00000000000000012e-9 or 2.40000000000000006e-110 < t Initial program 81.6%
*-commutative81.6%
associate-/l*86.5%
associate-*l/91.9%
Simplified91.9%
if -2.00000000000000012e-9 < t < -1.4e-125 or -2.60000000000000021e-255 < t < 2.40000000000000006e-110Initial program 57.7%
*-commutative57.7%
associate-/l*58.8%
associate-*l/55.9%
Simplified55.9%
Taylor expanded in y around -inf 69.4%
+-commutative69.4%
associate-*r/69.4%
distribute-lft-out--69.4%
associate-*r*69.4%
metadata-eval69.4%
*-lft-identity69.4%
Simplified70.7%
Taylor expanded in b around inf 82.0%
if -1.4e-125 < t < -2.60000000000000021e-255Initial program 69.5%
*-commutative69.5%
associate-/l*52.6%
associate-*l/50.8%
Simplified50.8%
Taylor expanded in x around 0 69.9%
Taylor expanded in t around 0 89.6%
Final simplification89.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ z (/ (* x t) y)) b))
(t_2 (/ (+ x (/ y (/ t z))) (+ a 1.0))))
(if (<= t -4100000000.0)
t_2
(if (<= t -4.3e-128)
t_1
(if (<= t -1.95e-255)
(/ (* y z) (+ (* y b) (* t (+ a 1.0))))
(if (<= t 8e-47) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + ((x * t) / y)) / b;
double t_2 = (x + (y / (t / z))) / (a + 1.0);
double tmp;
if (t <= -4100000000.0) {
tmp = t_2;
} else if (t <= -4.3e-128) {
tmp = t_1;
} else if (t <= -1.95e-255) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else if (t <= 8e-47) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = (z + ((x * t) / y)) / b
t_2 = (x + (y / (t / z))) / (a + 1.0d0)
if (t <= (-4100000000.0d0)) then
tmp = t_2
else if (t <= (-4.3d-128)) then
tmp = t_1
else if (t <= (-1.95d-255)) then
tmp = (y * z) / ((y * b) + (t * (a + 1.0d0)))
else if (t <= 8d-47) then
tmp = t_1
else
tmp = t_2
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 + ((x * t) / y)) / b;
double t_2 = (x + (y / (t / z))) / (a + 1.0);
double tmp;
if (t <= -4100000000.0) {
tmp = t_2;
} else if (t <= -4.3e-128) {
tmp = t_1;
} else if (t <= -1.95e-255) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else if (t <= 8e-47) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + ((x * t) / y)) / b t_2 = (x + (y / (t / z))) / (a + 1.0) tmp = 0 if t <= -4100000000.0: tmp = t_2 elif t <= -4.3e-128: tmp = t_1 elif t <= -1.95e-255: tmp = (y * z) / ((y * b) + (t * (a + 1.0))) elif t <= 8e-47: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + Float64(Float64(x * t) / y)) / b) t_2 = Float64(Float64(x + Float64(y / Float64(t / z))) / Float64(a + 1.0)) tmp = 0.0 if (t <= -4100000000.0) tmp = t_2; elseif (t <= -4.3e-128) tmp = t_1; elseif (t <= -1.95e-255) tmp = Float64(Float64(y * z) / Float64(Float64(y * b) + Float64(t * Float64(a + 1.0)))); elseif (t <= 8e-47) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + ((x * t) / y)) / b; t_2 = (x + (y / (t / z))) / (a + 1.0); tmp = 0.0; if (t <= -4100000000.0) tmp = t_2; elseif (t <= -4.3e-128) tmp = t_1; elseif (t <= -1.95e-255) tmp = (y * z) / ((y * b) + (t * (a + 1.0))); elseif (t <= 8e-47) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4100000000.0], t$95$2, If[LessEqual[t, -4.3e-128], t$95$1, If[LessEqual[t, -1.95e-255], N[(N[(y * z), $MachinePrecision] / N[(N[(y * b), $MachinePrecision] + N[(t * N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8e-47], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z + \frac{x \cdot t}{y}}{b}\\
t_2 := \frac{x + \frac{y}{\frac{t}{z}}}{a + 1}\\
\mathbf{if}\;t \leq -4100000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -4.3 \cdot 10^{-128}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.95 \cdot 10^{-255}:\\
\;\;\;\;\frac{y \cdot z}{y \cdot b + t \cdot \left(a + 1\right)}\\
\mathbf{elif}\;t \leq 8 \cdot 10^{-47}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -4.1e9 or 7.9999999999999998e-47 < t Initial program 80.9%
*-commutative80.9%
associate-/l*86.6%
associate-*l/92.8%
Simplified92.8%
clear-num92.3%
inv-pow92.3%
+-commutative92.3%
fma-def92.3%
+-commutative92.3%
div-inv92.2%
clear-num92.2%
fma-udef92.2%
Applied egg-rr92.2%
unpow-192.2%
+-commutative92.2%
Simplified92.2%
Taylor expanded in b around 0 72.0%
+-commutative72.0%
associate-/l*76.3%
Simplified76.3%
if -4.1e9 < t < -4.29999999999999994e-128 or -1.95e-255 < t < 7.9999999999999998e-47Initial program 64.2%
*-commutative64.2%
associate-/l*65.0%
associate-*l/62.8%
Simplified62.8%
Taylor expanded in y around -inf 63.6%
+-commutative63.6%
associate-*r/63.6%
distribute-lft-out--63.6%
associate-*r*63.6%
metadata-eval63.6%
*-lft-identity63.6%
Simplified64.6%
Taylor expanded in b around inf 76.6%
if -4.29999999999999994e-128 < t < -1.95e-255Initial program 69.5%
*-commutative69.5%
associate-/l*52.6%
associate-*l/50.8%
Simplified50.8%
Taylor expanded in x around 0 69.9%
Taylor expanded in t around 0 89.6%
Final simplification77.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -600000000000.0) (not (<= t 1.1e-113))) (/ x (+ 1.0 (+ a (/ (* y b) t)))) (/ (+ z (/ (* x t) y)) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -600000000000.0) || !(t <= 1.1e-113)) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} 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 <= (-600000000000.0d0)) .or. (.not. (t <= 1.1d-113))) then
tmp = x / (1.0d0 + (a + ((y * b) / t)))
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 <= -600000000000.0) || !(t <= 1.1e-113)) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -600000000000.0) or not (t <= 1.1e-113): tmp = x / (1.0 + (a + ((y * b) / t))) else: tmp = (z + ((x * t) / y)) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -600000000000.0) || !(t <= 1.1e-113)) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); 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 <= -600000000000.0) || ~((t <= 1.1e-113))) tmp = x / (1.0 + (a + ((y * b) / t))); else tmp = (z + ((x * t) / y)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -600000000000.0], N[Not[LessEqual[t, 1.1e-113]], $MachinePrecision]], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $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 -600000000000 \lor \neg \left(t \leq 1.1 \cdot 10^{-113}\right):\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if t < -6e11 or 1.10000000000000002e-113 < t Initial program 81.5%
*-commutative81.5%
associate-/l*86.7%
associate-*l/91.6%
Simplified91.6%
Taylor expanded in x around inf 68.9%
if -6e11 < t < 1.10000000000000002e-113Initial program 62.0%
*-commutative62.0%
associate-/l*58.7%
associate-*l/57.3%
Simplified57.3%
Taylor expanded in y around -inf 64.7%
+-commutative64.7%
associate-*r/64.7%
distribute-lft-out--64.7%
associate-*r*64.7%
metadata-eval64.7%
*-lft-identity64.7%
Simplified65.7%
Taylor expanded in b around inf 76.8%
Final simplification72.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -46000000000.0) (not (<= t 9.5e-47))) (/ (+ x (/ 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 tmp;
if ((t <= -46000000000.0) || !(t <= 9.5e-47)) {
tmp = (x + (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) :: tmp
if ((t <= (-46000000000.0d0)) .or. (.not. (t <= 9.5d-47))) then
tmp = (x + (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 tmp;
if ((t <= -46000000000.0) || !(t <= 9.5e-47)) {
tmp = (x + (y / (t / z))) / (a + 1.0);
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -46000000000.0) or not (t <= 9.5e-47): tmp = (x + (y / (t / z))) / (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 <= -46000000000.0) || !(t <= 9.5e-47)) tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / 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 <= -46000000000.0) || ~((t <= 9.5e-47))) tmp = (x + (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_] := If[Or[LessEqual[t, -46000000000.0], N[Not[LessEqual[t, 9.5e-47]], $MachinePrecision]], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 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 -46000000000 \lor \neg \left(t \leq 9.5 \cdot 10^{-47}\right):\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if t < -4.6e10 or 9.4999999999999991e-47 < t Initial program 80.9%
*-commutative80.9%
associate-/l*86.6%
associate-*l/92.8%
Simplified92.8%
clear-num92.3%
inv-pow92.3%
+-commutative92.3%
fma-def92.3%
+-commutative92.3%
div-inv92.2%
clear-num92.2%
fma-udef92.2%
Applied egg-rr92.2%
unpow-192.2%
+-commutative92.2%
Simplified92.2%
Taylor expanded in b around 0 72.0%
+-commutative72.0%
associate-/l*76.3%
Simplified76.3%
if -4.6e10 < t < 9.4999999999999991e-47Initial program 65.3%
*-commutative65.3%
associate-/l*62.4%
associate-*l/60.3%
Simplified60.3%
Taylor expanded in y around -inf 61.7%
+-commutative61.7%
associate-*r/61.7%
distribute-lft-out--61.7%
associate-*r*61.7%
metadata-eval61.7%
*-lft-identity61.7%
Simplified62.5%
Taylor expanded in b around inf 74.8%
Final simplification75.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -175000000000.0) (not (<= t 4.1e-16))) (/ x (+ a 1.0)) (/ (+ z (/ t (/ y x))) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -175000000000.0) || !(t <= 4.1e-16)) {
tmp = x / (a + 1.0);
} else {
tmp = (z + (t / (y / x))) / 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 <= (-175000000000.0d0)) .or. (.not. (t <= 4.1d-16))) then
tmp = x / (a + 1.0d0)
else
tmp = (z + (t / (y / x))) / 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 <= -175000000000.0) || !(t <= 4.1e-16)) {
tmp = x / (a + 1.0);
} else {
tmp = (z + (t / (y / x))) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -175000000000.0) or not (t <= 4.1e-16): tmp = x / (a + 1.0) else: tmp = (z + (t / (y / x))) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -175000000000.0) || !(t <= 4.1e-16)) tmp = Float64(x / Float64(a + 1.0)); else tmp = Float64(Float64(z + Float64(t / Float64(y / x))) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -175000000000.0) || ~((t <= 4.1e-16))) tmp = x / (a + 1.0); else tmp = (z + (t / (y / x))) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -175000000000.0], N[Not[LessEqual[t, 4.1e-16]], $MachinePrecision]], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -175000000000 \lor \neg \left(t \leq 4.1 \cdot 10^{-16}\right):\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\end{array}
\end{array}
if t < -1.75e11 or 4.10000000000000006e-16 < t Initial program 80.3%
*-commutative80.3%
associate-/l*86.4%
associate-*l/93.0%
Simplified93.0%
Taylor expanded in t around inf 64.4%
if -1.75e11 < t < 4.10000000000000006e-16Initial program 67.0%
*-commutative67.0%
associate-/l*64.4%
associate-*l/62.4%
Simplified62.4%
Taylor expanded in y around -inf 60.5%
+-commutative60.5%
associate-*r/60.5%
distribute-lft-out--60.5%
associate-*r*60.5%
metadata-eval60.5%
*-lft-identity60.5%
Simplified61.3%
Taylor expanded in b around inf 72.7%
+-commutative72.7%
associate-/l*67.7%
Simplified67.7%
Final simplification66.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -21500000000.0) (not (<= t 2.4e-10))) (/ 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 <= -21500000000.0) || !(t <= 2.4e-10)) {
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 <= (-21500000000.0d0)) .or. (.not. (t <= 2.4d-10))) 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 <= -21500000000.0) || !(t <= 2.4e-10)) {
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 <= -21500000000.0) or not (t <= 2.4e-10): 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 <= -21500000000.0) || !(t <= 2.4e-10)) 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 <= -21500000000.0) || ~((t <= 2.4e-10))) 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, -21500000000.0], N[Not[LessEqual[t, 2.4e-10]], $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 -21500000000 \lor \neg \left(t \leq 2.4 \cdot 10^{-10}\right):\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if t < -2.15e10 or 2.4e-10 < t Initial program 80.3%
*-commutative80.3%
associate-/l*86.4%
associate-*l/93.0%
Simplified93.0%
Taylor expanded in t around inf 64.4%
if -2.15e10 < t < 2.4e-10Initial program 67.0%
*-commutative67.0%
associate-/l*64.4%
associate-*l/62.4%
Simplified62.4%
Taylor expanded in y around -inf 60.5%
+-commutative60.5%
associate-*r/60.5%
distribute-lft-out--60.5%
associate-*r*60.5%
metadata-eval60.5%
*-lft-identity60.5%
Simplified61.3%
Taylor expanded in b around inf 72.7%
Final simplification68.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -26500000000.0) (not (<= t 7.6e-41))) (/ x (+ a 1.0)) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -26500000000.0) || !(t <= 7.6e-41)) {
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 <= (-26500000000.0d0)) .or. (.not. (t <= 7.6d-41))) 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 <= -26500000000.0) || !(t <= 7.6e-41)) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -26500000000.0) or not (t <= 7.6e-41): tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -26500000000.0) || !(t <= 7.6e-41)) 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 <= -26500000000.0) || ~((t <= 7.6e-41))) 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, -26500000000.0], N[Not[LessEqual[t, 7.6e-41]], $MachinePrecision]], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -26500000000 \lor \neg \left(t \leq 7.6 \cdot 10^{-41}\right):\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -2.65e10 or 7.59999999999999958e-41 < t Initial program 80.6%
*-commutative80.6%
associate-/l*86.4%
associate-*l/92.7%
Simplified92.7%
Taylor expanded in t around inf 62.7%
if -2.65e10 < t < 7.59999999999999958e-41Initial program 65.9%
*-commutative65.9%
associate-/l*63.1%
associate-*l/61.0%
Simplified61.0%
Taylor expanded in t around 0 59.4%
Final simplification61.1%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.2e+156) (/ x a) (if (<= a 4.6e+33) (/ z b) (/ x a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.2e+156) {
tmp = x / a;
} else if (a <= 4.6e+33) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-1.2d+156)) then
tmp = x / a
else if (a <= 4.6d+33) then
tmp = z / b
else
tmp = x / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.2e+156) {
tmp = x / a;
} else if (a <= 4.6e+33) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.2e+156: tmp = x / a elif a <= 4.6e+33: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.2e+156) tmp = Float64(x / a); elseif (a <= 4.6e+33) tmp = Float64(z / b); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.2e+156) tmp = x / a; elseif (a <= 4.6e+33) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.2e+156], N[(x / a), $MachinePrecision], If[LessEqual[a, 4.6e+33], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.2 \cdot 10^{+156}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq 4.6 \cdot 10^{+33}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -1.2000000000000001e156 or 4.60000000000000021e33 < a Initial program 84.1%
*-commutative84.1%
associate-/l*84.1%
associate-*l/84.0%
Simplified84.0%
Taylor expanded in x around inf 61.4%
Taylor expanded in a around inf 60.0%
if -1.2000000000000001e156 < a < 4.60000000000000021e33Initial program 69.3%
*-commutative69.3%
associate-/l*71.9%
associate-*l/75.4%
Simplified75.4%
Taylor expanded in t around 0 44.7%
Final simplification49.4%
(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 73.8%
*-commutative73.8%
associate-/l*75.6%
associate-*l/78.1%
Simplified78.1%
Taylor expanded in x around inf 52.5%
Taylor expanded in a around inf 24.1%
Final simplification24.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 2023221
(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))))