
(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 14 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)) (+ (+ a 1.0) (/ (* y b) t))))
(t_2 (/ y (+ (/ (* y b) z) (* t (+ (/ a z) (/ 1.0 z)))))))
(if (<= t_1 (- INFINITY))
t_2
(if (<= t_1 -1e-323)
t_1
(if (<= t_1 0.0)
(+ (/ z b) (/ (- (/ t (/ b x)) (* (/ z b) (/ (+ t (* t a)) b))) y))
(if (<= t_1 1e+298) t_1 (if (<= t_1 INFINITY) t_2 (/ z b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double t_2 = y / (((y * b) / z) + (t * ((a / z) + (1.0 / z))));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= -1e-323) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (z / b) + (((t / (b / x)) - ((z / b) * ((t + (t * a)) / b))) / y);
} else if (t_1 <= 1e+298) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} 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)) / ((a + 1.0) + ((y * b) / t));
double t_2 = y / (((y * b) / z) + (t * ((a / z) + (1.0 / z))));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= -1e-323) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (z / b) + (((t / (b / x)) - ((z / b) * ((t + (t * a)) / b))) / y);
} else if (t_1 <= 1e+298) {
tmp = t_1;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)) t_2 = y / (((y * b) / z) + (t * ((a / z) + (1.0 / z)))) tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= -1e-323: tmp = t_1 elif t_1 <= 0.0: tmp = (z / b) + (((t / (b / x)) - ((z / b) * ((t + (t * a)) / b))) / y) elif t_1 <= 1e+298: tmp = t_1 elif t_1 <= math.inf: tmp = t_2 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(a + 1.0) + Float64(Float64(y * b) / t))) t_2 = Float64(y / Float64(Float64(Float64(y * b) / z) + Float64(t * Float64(Float64(a / z) + Float64(1.0 / z))))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= -1e-323) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(z / b) + Float64(Float64(Float64(t / Float64(b / x)) - Float64(Float64(z / b) * Float64(Float64(t + Float64(t * a)) / b))) / y)); elseif (t_1 <= 1e+298) tmp = t_1; elseif (t_1 <= Inf) tmp = t_2; 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)) / ((a + 1.0) + ((y * b) / t)); t_2 = y / (((y * b) / z) + (t * ((a / z) + (1.0 / z)))); tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= -1e-323) tmp = t_1; elseif (t_1 <= 0.0) tmp = (z / b) + (((t / (b / x)) - ((z / b) * ((t + (t * a)) / b))) / y); elseif (t_1 <= 1e+298) tmp = t_1; elseif (t_1 <= Inf) tmp = t_2; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y / N[(N[(N[(y * b), $MachinePrecision] / z), $MachinePrecision] + N[(t * N[(N[(a / z), $MachinePrecision] + N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -1e-323], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(z / b), $MachinePrecision] + N[(N[(N[(t / N[(b / x), $MachinePrecision]), $MachinePrecision] - N[(N[(z / b), $MachinePrecision] * N[(N[(t + N[(t * a), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+298], t$95$1, If[LessEqual[t$95$1, Infinity], t$95$2, N[(z / b), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_2 := \frac{y}{\frac{y \cdot b}{z} + t \cdot \left(\frac{a}{z} + \frac{1}{z}\right)}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{-323}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{z}{b} + \frac{\frac{t}{\frac{b}{x}} - \frac{z}{b} \cdot \frac{t + t \cdot a}{b}}{y}\\
\mathbf{elif}\;t_1 \leq 10^{+298}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_2\\
\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))) < -inf.0 or 9.9999999999999996e297 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 27.4%
*-commutative27.4%
associate-/l*56.0%
associate-*l/52.4%
Simplified52.4%
Taylor expanded in x around 0 45.5%
associate-/l*81.4%
associate-+r+81.4%
associate-*r/76.9%
+-commutative76.9%
fma-def76.9%
+-commutative76.9%
Simplified76.9%
Taylor expanded in t around 0 97.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -9.88131e-324 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 9.9999999999999996e297Initial program 99.2%
if -9.88131e-324 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0Initial program 54.4%
*-commutative54.4%
associate-/l*49.1%
associate-*l/64.5%
Simplified64.5%
Taylor expanded in y around -inf 69.0%
+-commutative69.0%
associate-*r/69.0%
distribute-lft-out--69.0%
associate-*r*69.0%
metadata-eval69.0%
*-lft-identity69.0%
Simplified74.6%
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.3%
associate-*l/4.0%
Simplified4.0%
Taylor expanded in t around 0 96.4%
Final simplification95.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
(t_2 (/ y (+ (/ (* y b) z) (* t (+ (/ a z) (/ 1.0 z)))))))
(if (<= t_1 (- INFINITY))
t_2
(if (<= t_1 -2e-255)
t_1
(if (<= t_1 5e-143)
(/ (+ x (/ 1.0 (/ (/ t z) y))) (+ (+ a 1.0) (* b (/ y t))))
(if (<= t_1 1e+298) t_1 (if (<= t_1 INFINITY) t_2 (/ z b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double t_2 = y / (((y * b) / z) + (t * ((a / z) + (1.0 / z))));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= -2e-255) {
tmp = t_1;
} else if (t_1 <= 5e-143) {
tmp = (x + (1.0 / ((t / z) / y))) / ((a + 1.0) + (b * (y / t)));
} else if (t_1 <= 1e+298) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} 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)) / ((a + 1.0) + ((y * b) / t));
double t_2 = y / (((y * b) / z) + (t * ((a / z) + (1.0 / z))));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= -2e-255) {
tmp = t_1;
} else if (t_1 <= 5e-143) {
tmp = (x + (1.0 / ((t / z) / y))) / ((a + 1.0) + (b * (y / t)));
} else if (t_1 <= 1e+298) {
tmp = t_1;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)) t_2 = y / (((y * b) / z) + (t * ((a / z) + (1.0 / z)))) tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= -2e-255: tmp = t_1 elif t_1 <= 5e-143: tmp = (x + (1.0 / ((t / z) / y))) / ((a + 1.0) + (b * (y / t))) elif t_1 <= 1e+298: tmp = t_1 elif t_1 <= math.inf: tmp = t_2 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(a + 1.0) + Float64(Float64(y * b) / t))) t_2 = Float64(y / Float64(Float64(Float64(y * b) / z) + Float64(t * Float64(Float64(a / z) + Float64(1.0 / z))))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= -2e-255) tmp = t_1; elseif (t_1 <= 5e-143) tmp = Float64(Float64(x + Float64(1.0 / Float64(Float64(t / z) / y))) / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))); elseif (t_1 <= 1e+298) tmp = t_1; elseif (t_1 <= Inf) tmp = t_2; 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)) / ((a + 1.0) + ((y * b) / t)); t_2 = y / (((y * b) / z) + (t * ((a / z) + (1.0 / z)))); tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= -2e-255) tmp = t_1; elseif (t_1 <= 5e-143) tmp = (x + (1.0 / ((t / z) / y))) / ((a + 1.0) + (b * (y / t))); elseif (t_1 <= 1e+298) tmp = t_1; elseif (t_1 <= Inf) tmp = t_2; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y / N[(N[(N[(y * b), $MachinePrecision] / z), $MachinePrecision] + N[(t * N[(N[(a / z), $MachinePrecision] + N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -2e-255], t$95$1, If[LessEqual[t$95$1, 5e-143], N[(N[(x + N[(1.0 / N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+298], t$95$1, If[LessEqual[t$95$1, Infinity], t$95$2, N[(z / b), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_2 := \frac{y}{\frac{y \cdot b}{z} + t \cdot \left(\frac{a}{z} + \frac{1}{z}\right)}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-255}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{-143}:\\
\;\;\;\;\frac{x + \frac{1}{\frac{\frac{t}{z}}{y}}}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\mathbf{elif}\;t_1 \leq 10^{+298}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_2\\
\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))) < -inf.0 or 9.9999999999999996e297 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 27.4%
*-commutative27.4%
associate-/l*56.0%
associate-*l/52.4%
Simplified52.4%
Taylor expanded in x around 0 45.5%
associate-/l*81.4%
associate-+r+81.4%
associate-*r/76.9%
+-commutative76.9%
fma-def76.9%
+-commutative76.9%
Simplified76.9%
Taylor expanded in t around 0 97.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -2e-255 or 5.0000000000000002e-143 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 9.9999999999999996e297Initial program 99.8%
if -2e-255 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 5.0000000000000002e-143Initial program 71.7%
*-commutative71.7%
associate-/l*67.2%
associate-*l/76.2%
Simplified76.2%
div-inv74.0%
clear-num74.1%
Applied egg-rr74.1%
clear-num74.0%
div-inv76.2%
clear-num76.1%
Applied egg-rr76.1%
associate-/l/80.7%
associate-/r*80.8%
Simplified80.8%
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.3%
associate-*l/4.0%
Simplified4.0%
Taylor expanded in t around 0 96.4%
Final simplification94.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
(t_2 (/ y (+ (/ (* y b) z) (* t (+ (/ a z) (/ 1.0 z)))))))
(if (<= t_1 (- INFINITY))
t_2
(if (<= t_1 1e+298) t_1 (if (<= t_1 INFINITY) t_2 (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double t_2 = y / (((y * b) / z) + (t * ((a / z) + (1.0 / z))));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= 1e+298) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} 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)) / ((a + 1.0) + ((y * b) / t));
double t_2 = y / (((y * b) / z) + (t * ((a / z) + (1.0 / z))));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= 1e+298) {
tmp = t_1;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)) t_2 = y / (((y * b) / z) + (t * ((a / z) + (1.0 / z)))) tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= 1e+298: tmp = t_1 elif t_1 <= math.inf: tmp = t_2 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(a + 1.0) + Float64(Float64(y * b) / t))) t_2 = Float64(y / Float64(Float64(Float64(y * b) / z) + Float64(t * Float64(Float64(a / z) + Float64(1.0 / z))))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= 1e+298) tmp = t_1; elseif (t_1 <= Inf) tmp = t_2; 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)) / ((a + 1.0) + ((y * b) / t)); t_2 = y / (((y * b) / z) + (t * ((a / z) + (1.0 / z)))); tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= 1e+298) tmp = t_1; elseif (t_1 <= Inf) tmp = t_2; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y / N[(N[(N[(y * b), $MachinePrecision] / z), $MachinePrecision] + N[(t * N[(N[(a / z), $MachinePrecision] + N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, 1e+298], t$95$1, If[LessEqual[t$95$1, Infinity], t$95$2, N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_2 := \frac{y}{\frac{y \cdot b}{z} + t \cdot \left(\frac{a}{z} + \frac{1}{z}\right)}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq 10^{+298}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_2\\
\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))) < -inf.0 or 9.9999999999999996e297 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 27.4%
*-commutative27.4%
associate-/l*56.0%
associate-*l/52.4%
Simplified52.4%
Taylor expanded in x around 0 45.5%
associate-/l*81.4%
associate-+r+81.4%
associate-*r/76.9%
+-commutative76.9%
fma-def76.9%
+-commutative76.9%
Simplified76.9%
Taylor expanded in t around 0 97.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 9.9999999999999996e297Initial program 91.3%
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.3%
associate-*l/4.0%
Simplified4.0%
Taylor expanded in t around 0 96.4%
Final simplification92.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.25e+168) (not (<= y 7e+212))) (/ z b) (/ (+ x (* z (/ y t))) (+ (+ a 1.0) (* b (/ y t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.25e+168) || !(y <= 7e+212)) {
tmp = z / b;
} else {
tmp = (x + (z * (y / t))) / ((a + 1.0) + (b * (y / t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.25d+168)) .or. (.not. (y <= 7d+212))) then
tmp = z / b
else
tmp = (x + (z * (y / t))) / ((a + 1.0d0) + (b * (y / t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.25e+168) || !(y <= 7e+212)) {
tmp = z / b;
} else {
tmp = (x + (z * (y / t))) / ((a + 1.0) + (b * (y / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.25e+168) or not (y <= 7e+212): tmp = z / b else: tmp = (x + (z * (y / t))) / ((a + 1.0) + (b * (y / t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.25e+168) || !(y <= 7e+212)) tmp = Float64(z / b); else tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.25e+168) || ~((y <= 7e+212))) tmp = z / b; else tmp = (x + (z * (y / t))) / ((a + 1.0) + (b * (y / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.25e+168], N[Not[LessEqual[y, 7e+212]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+168} \lor \neg \left(y \leq 7 \cdot 10^{+212}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\end{array}
\end{array}
if y < -1.24999999999999992e168 or 6.99999999999999974e212 < y Initial program 36.8%
*-commutative36.8%
associate-/l*32.8%
associate-*l/38.2%
Simplified38.2%
Taylor expanded in t around 0 67.4%
if -1.24999999999999992e168 < y < 6.99999999999999974e212Initial program 83.5%
*-commutative83.5%
associate-/l*85.0%
associate-*l/86.2%
Simplified86.2%
div-inv86.1%
clear-num86.5%
Applied egg-rr86.5%
Final simplification82.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -950000000000.0) (not (<= y 4.7e+39))) (/ y (+ (/ y (/ z b)) (/ t (/ z (+ a 1.0))))) (/ (+ x (/ (* y z) t)) (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -950000000000.0) || !(y <= 4.7e+39)) {
tmp = y / ((y / (z / b)) + (t / (z / (a + 1.0))));
} 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 ((y <= (-950000000000.0d0)) .or. (.not. (y <= 4.7d+39))) then
tmp = y / ((y / (z / b)) + (t / (z / (a + 1.0d0))))
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 ((y <= -950000000000.0) || !(y <= 4.7e+39)) {
tmp = y / ((y / (z / b)) + (t / (z / (a + 1.0))));
} else {
tmp = (x + ((y * z) / t)) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -950000000000.0) or not (y <= 4.7e+39): tmp = y / ((y / (z / b)) + (t / (z / (a + 1.0)))) else: tmp = (x + ((y * z) / t)) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -950000000000.0) || !(y <= 4.7e+39)) tmp = Float64(y / Float64(Float64(y / Float64(z / b)) + Float64(t / Float64(z / Float64(a + 1.0))))); 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 ((y <= -950000000000.0) || ~((y <= 4.7e+39))) tmp = y / ((y / (z / b)) + (t / (z / (a + 1.0)))); else tmp = (x + ((y * z) / t)) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -950000000000.0], N[Not[LessEqual[y, 4.7e+39]], $MachinePrecision]], N[(y / N[(N[(y / N[(z / b), $MachinePrecision]), $MachinePrecision] + N[(t / N[(z / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -950000000000 \lor \neg \left(y \leq 4.7 \cdot 10^{+39}\right):\\
\;\;\;\;\frac{y}{\frac{y}{\frac{z}{b}} + \frac{t}{\frac{z}{a + 1}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\end{array}
\end{array}
if y < -9.5e11 or 4.6999999999999999e39 < y Initial program 50.3%
*-commutative50.3%
associate-/l*53.6%
associate-*l/58.0%
Simplified58.0%
Taylor expanded in x around 0 33.5%
associate-/l*42.3%
associate-+r+42.3%
associate-*r/42.3%
+-commutative42.3%
fma-def42.3%
+-commutative42.3%
Simplified42.3%
Taylor expanded in t around inf 45.1%
associate-/l*55.9%
associate-/l*60.1%
Simplified60.1%
if -9.5e11 < y < 4.6999999999999999e39Initial program 94.4%
*-commutative94.4%
associate-/l*92.3%
associate-*l/92.4%
Simplified92.4%
Taylor expanded in b around 0 79.6%
Final simplification70.7%
(FPCore (x y z t a b) :precision binary64 (if (<= z -4.3e+226) (/ y (+ (/ y (/ z b)) (/ t (/ z (+ a 1.0))))) (/ (+ x (/ z (/ t y))) (+ (+ a 1.0) (* b (/ y t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.3e+226) {
tmp = y / ((y / (z / b)) + (t / (z / (a + 1.0))));
} else {
tmp = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-4.3d+226)) then
tmp = y / ((y / (z / b)) + (t / (z / (a + 1.0d0))))
else
tmp = (x + (z / (t / y))) / ((a + 1.0d0) + (b * (y / t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.3e+226) {
tmp = y / ((y / (z / b)) + (t / (z / (a + 1.0))));
} else {
tmp = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.3e+226: tmp = y / ((y / (z / b)) + (t / (z / (a + 1.0)))) else: tmp = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.3e+226) tmp = Float64(y / Float64(Float64(y / Float64(z / b)) + Float64(t / Float64(z / Float64(a + 1.0))))); else tmp = Float64(Float64(x + Float64(z / Float64(t / y))) / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4.3e+226) tmp = y / ((y / (z / b)) + (t / (z / (a + 1.0)))); else tmp = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.3e+226], N[(y / N[(N[(y / N[(z / b), $MachinePrecision]), $MachinePrecision] + N[(t / N[(z / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+226}:\\
\;\;\;\;\frac{y}{\frac{y}{\frac{z}{b}} + \frac{t}{\frac{z}{a + 1}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\end{array}
\end{array}
if z < -4.29999999999999987e226Initial program 46.2%
*-commutative46.2%
associate-/l*49.8%
associate-*l/46.5%
Simplified46.5%
Taylor expanded in x around 0 42.3%
associate-/l*50.9%
associate-+r+50.9%
associate-*r/43.0%
+-commutative43.0%
fma-def43.0%
+-commutative43.0%
Simplified43.0%
Taylor expanded in t around inf 54.2%
associate-/l*74.3%
associate-/l*87.4%
Simplified87.4%
if -4.29999999999999987e226 < z Initial program 77.8%
*-commutative77.8%
associate-/l*77.8%
associate-*l/80.5%
Simplified80.5%
Final simplification81.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -9.6e-54)
(/ x (+ (+ a 1.0) (/ y (/ t b))))
(if (<= x 4.5e-127)
(/ y (/ (+ (* y b) (* t (+ a 1.0))) z))
(if (<= x 1.2e+29)
(/ (+ x (/ (* y z) t)) (+ a 1.0))
(/ x (+ (+ a 1.0) (* b (/ y t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -9.6e-54) {
tmp = x / ((a + 1.0) + (y / (t / b)));
} else if (x <= 4.5e-127) {
tmp = y / (((y * b) + (t * (a + 1.0))) / z);
} else if (x <= 1.2e+29) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else {
tmp = x / ((a + 1.0) + (b * (y / t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-9.6d-54)) then
tmp = x / ((a + 1.0d0) + (y / (t / b)))
else if (x <= 4.5d-127) then
tmp = y / (((y * b) + (t * (a + 1.0d0))) / z)
else if (x <= 1.2d+29) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else
tmp = x / ((a + 1.0d0) + (b * (y / t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -9.6e-54) {
tmp = x / ((a + 1.0) + (y / (t / b)));
} else if (x <= 4.5e-127) {
tmp = y / (((y * b) + (t * (a + 1.0))) / z);
} else if (x <= 1.2e+29) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else {
tmp = x / ((a + 1.0) + (b * (y / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -9.6e-54: tmp = x / ((a + 1.0) + (y / (t / b))) elif x <= 4.5e-127: tmp = y / (((y * b) + (t * (a + 1.0))) / z) elif x <= 1.2e+29: tmp = (x + ((y * z) / t)) / (a + 1.0) else: tmp = x / ((a + 1.0) + (b * (y / t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -9.6e-54) tmp = Float64(x / Float64(Float64(a + 1.0) + Float64(y / Float64(t / b)))); elseif (x <= 4.5e-127) tmp = Float64(y / Float64(Float64(Float64(y * b) + Float64(t * Float64(a + 1.0))) / z)); elseif (x <= 1.2e+29) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); else tmp = Float64(x / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -9.6e-54) tmp = x / ((a + 1.0) + (y / (t / b))); elseif (x <= 4.5e-127) tmp = y / (((y * b) + (t * (a + 1.0))) / z); elseif (x <= 1.2e+29) tmp = (x + ((y * z) / t)) / (a + 1.0); else tmp = x / ((a + 1.0) + (b * (y / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -9.6e-54], N[(x / N[(N[(a + 1.0), $MachinePrecision] + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.5e-127], N[(y / N[(N[(N[(y * b), $MachinePrecision] + N[(t * N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.2e+29], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.6 \cdot 10^{-54}:\\
\;\;\;\;\frac{x}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-127}:\\
\;\;\;\;\frac{y}{\frac{y \cdot b + t \cdot \left(a + 1\right)}{z}}\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+29}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\end{array}
\end{array}
if x < -9.60000000000000053e-54Initial program 78.1%
*-commutative78.1%
associate-/l*78.4%
associate-*l/79.7%
Simplified79.7%
Taylor expanded in x around inf 72.0%
Taylor expanded in y around 0 70.6%
associate-/l*72.0%
Simplified72.0%
if -9.60000000000000053e-54 < x < 4.4999999999999999e-127Initial program 72.8%
*-commutative72.8%
associate-/l*74.7%
associate-*l/78.2%
Simplified78.2%
Taylor expanded in x around 0 61.1%
associate-/l*64.7%
associate-+r+64.7%
associate-*r/60.9%
+-commutative60.9%
fma-def60.9%
+-commutative60.9%
Simplified60.9%
Taylor expanded in t around 0 65.6%
if 4.4999999999999999e-127 < x < 1.2e29Initial program 81.1%
*-commutative81.1%
associate-/l*76.5%
associate-*l/71.7%
Simplified71.7%
Taylor expanded in b around 0 81.4%
if 1.2e29 < x Initial program 69.8%
*-commutative69.8%
associate-/l*69.7%
associate-*l/72.5%
Simplified72.5%
Taylor expanded in x around inf 68.3%
Final simplification69.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.1e-110) (not (<= t 1.4e-49))) (/ x (+ 1.0 (+ a (/ (* y b) t)))) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.1e-110) || !(t <= 1.4e-49)) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-2.1d-110)) .or. (.not. (t <= 1.4d-49))) then
tmp = x / (1.0d0 + (a + ((y * b) / t)))
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.1e-110) || !(t <= 1.4e-49)) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.1e-110) or not (t <= 1.4e-49): tmp = x / (1.0 + (a + ((y * b) / t))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.1e-110) || !(t <= 1.4e-49)) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -2.1e-110) || ~((t <= 1.4e-49))) tmp = x / (1.0 + (a + ((y * b) / t))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.1e-110], N[Not[LessEqual[t, 1.4e-49]], $MachinePrecision]], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{-110} \lor \neg \left(t \leq 1.4 \cdot 10^{-49}\right):\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -2.10000000000000002e-110 or 1.39999999999999999e-49 < t Initial program 81.7%
*-commutative81.7%
associate-/l*84.2%
associate-*l/88.1%
Simplified88.1%
Taylor expanded in x around inf 66.2%
if -2.10000000000000002e-110 < t < 1.39999999999999999e-49Initial program 61.3%
*-commutative61.3%
associate-/l*58.2%
associate-*l/57.0%
Simplified57.0%
Taylor expanded in t around 0 61.0%
Final simplification64.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -5.5e-110) (not (<= t 8.2e-50))) (/ x (+ (+ a 1.0) (* y (/ b t)))) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -5.5e-110) || !(t <= 8.2e-50)) {
tmp = x / ((a + 1.0) + (y * (b / t)));
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-5.5d-110)) .or. (.not. (t <= 8.2d-50))) then
tmp = x / ((a + 1.0d0) + (y * (b / t)))
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -5.5e-110) || !(t <= 8.2e-50)) {
tmp = x / ((a + 1.0) + (y * (b / t)));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -5.5e-110) or not (t <= 8.2e-50): tmp = x / ((a + 1.0) + (y * (b / t))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -5.5e-110) || !(t <= 8.2e-50)) tmp = Float64(x / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -5.5e-110) || ~((t <= 8.2e-50))) tmp = x / ((a + 1.0) + (y * (b / t))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -5.5e-110], N[Not[LessEqual[t, 8.2e-50]], $MachinePrecision]], N[(x / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{-110} \lor \neg \left(t \leq 8.2 \cdot 10^{-50}\right):\\
\;\;\;\;\frac{x}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -5.4999999999999998e-110 or 8.19999999999999971e-50 < t Initial program 81.7%
*-commutative81.7%
associate-/l*84.2%
associate-*l/88.1%
Simplified88.1%
Taylor expanded in x around inf 67.9%
Taylor expanded in y around 0 66.2%
associate-*r/67.9%
Simplified67.9%
if -5.4999999999999998e-110 < t < 8.19999999999999971e-50Initial program 61.3%
*-commutative61.3%
associate-/l*58.2%
associate-*l/57.0%
Simplified57.0%
Taylor expanded in t around 0 61.0%
Final simplification65.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -8.5e+135) (not (<= y 1.5e+83))) (/ z 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 ((y <= -8.5e+135) || !(y <= 1.5e+83)) {
tmp = z / 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 ((y <= (-8.5d+135)) .or. (.not. (y <= 1.5d+83))) then
tmp = z / 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 ((y <= -8.5e+135) || !(y <= 1.5e+83)) {
tmp = z / b;
} else {
tmp = (x + ((y * z) / t)) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -8.5e+135) or not (y <= 1.5e+83): tmp = z / b else: tmp = (x + ((y * z) / t)) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -8.5e+135) || !(y <= 1.5e+83)) tmp = Float64(z / 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 ((y <= -8.5e+135) || ~((y <= 1.5e+83))) tmp = z / b; else tmp = (x + ((y * z) / t)) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -8.5e+135], N[Not[LessEqual[y, 1.5e+83]], $MachinePrecision]], N[(z / 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}\;y \leq -8.5 \cdot 10^{+135} \lor \neg \left(y \leq 1.5 \cdot 10^{+83}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\end{array}
\end{array}
if y < -8.49999999999999992e135 or 1.5e83 < y Initial program 39.5%
*-commutative39.5%
associate-/l*44.0%
associate-*l/49.1%
Simplified49.1%
Taylor expanded in t around 0 60.1%
if -8.49999999999999992e135 < y < 1.5e83Initial program 90.9%
*-commutative90.9%
associate-/l*89.3%
associate-*l/89.9%
Simplified89.9%
Taylor expanded in b around 0 73.5%
Final simplification69.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -4e+38)
(/ x a)
(if (<= a -3.9e-113)
(/ z b)
(if (<= a 5.7e-77) (- x (* x a)) (if (<= a 2.9e+32) (/ z b) (/ x a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4e+38) {
tmp = x / a;
} else if (a <= -3.9e-113) {
tmp = z / b;
} else if (a <= 5.7e-77) {
tmp = x - (x * a);
} else if (a <= 2.9e+32) {
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 <= (-4d+38)) then
tmp = x / a
else if (a <= (-3.9d-113)) then
tmp = z / b
else if (a <= 5.7d-77) then
tmp = x - (x * a)
else if (a <= 2.9d+32) 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 <= -4e+38) {
tmp = x / a;
} else if (a <= -3.9e-113) {
tmp = z / b;
} else if (a <= 5.7e-77) {
tmp = x - (x * a);
} else if (a <= 2.9e+32) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -4e+38: tmp = x / a elif a <= -3.9e-113: tmp = z / b elif a <= 5.7e-77: tmp = x - (x * a) elif a <= 2.9e+32: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -4e+38) tmp = Float64(x / a); elseif (a <= -3.9e-113) tmp = Float64(z / b); elseif (a <= 5.7e-77) tmp = Float64(x - Float64(x * a)); elseif (a <= 2.9e+32) 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 <= -4e+38) tmp = x / a; elseif (a <= -3.9e-113) tmp = z / b; elseif (a <= 5.7e-77) tmp = x - (x * a); elseif (a <= 2.9e+32) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4e+38], N[(x / a), $MachinePrecision], If[LessEqual[a, -3.9e-113], N[(z / b), $MachinePrecision], If[LessEqual[a, 5.7e-77], N[(x - N[(x * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.9e+32], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4 \cdot 10^{+38}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq -3.9 \cdot 10^{-113}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq 5.7 \cdot 10^{-77}:\\
\;\;\;\;x - x \cdot a\\
\mathbf{elif}\;a \leq 2.9 \cdot 10^{+32}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -3.99999999999999991e38 or 2.90000000000000003e32 < a Initial program 74.2%
*-commutative74.2%
associate-/l*74.3%
associate-*l/76.8%
Simplified76.8%
Taylor expanded in x around inf 56.1%
Taylor expanded in a around inf 48.4%
if -3.99999999999999991e38 < a < -3.8999999999999999e-113 or 5.69999999999999981e-77 < a < 2.90000000000000003e32Initial program 66.0%
*-commutative66.0%
associate-/l*68.1%
associate-*l/66.0%
Simplified66.0%
Taylor expanded in t around 0 58.2%
if -3.8999999999999999e-113 < a < 5.69999999999999981e-77Initial program 78.4%
*-commutative78.4%
associate-/l*78.3%
associate-*l/81.9%
Simplified81.9%
Taylor expanded in t around inf 45.5%
Taylor expanded in a around 0 45.5%
+-commutative45.5%
mul-1-neg45.5%
unsub-neg45.5%
*-commutative45.5%
Simplified45.5%
Final simplification49.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.3e+58) (/ z b) (if (<= y 1.45e+79) (/ x (+ a 1.0)) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.3e+58) {
tmp = z / b;
} else if (y <= 1.45e+79) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.3d+58)) then
tmp = z / b
else if (y <= 1.45d+79) then
tmp = x / (a + 1.0d0)
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.3e+58) {
tmp = z / b;
} else if (y <= 1.45e+79) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.3e+58: tmp = z / b elif y <= 1.45e+79: tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.3e+58) tmp = Float64(z / b); elseif (y <= 1.45e+79) tmp = Float64(x / Float64(a + 1.0)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.3e+58) tmp = z / b; elseif (y <= 1.45e+79) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.3e+58], N[(z / b), $MachinePrecision], If[LessEqual[y, 1.45e+79], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{+58}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+79}:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.29999999999999994e58 or 1.44999999999999996e79 < y Initial program 43.5%
*-commutative43.5%
associate-/l*47.4%
associate-*l/52.7%
Simplified52.7%
Taylor expanded in t around 0 57.9%
if -1.29999999999999994e58 < y < 1.44999999999999996e79Initial program 93.3%
*-commutative93.3%
associate-/l*91.5%
associate-*l/91.5%
Simplified91.5%
Taylor expanded in t around inf 60.9%
Final simplification59.8%
(FPCore (x y z t a b) :precision binary64 (if (<= a -4.3e+43) (/ x a) (if (<= a 1.25e+32) (/ z b) (/ x a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4.3e+43) {
tmp = x / a;
} else if (a <= 1.25e+32) {
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 <= (-4.3d+43)) then
tmp = x / a
else if (a <= 1.25d+32) 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 <= -4.3e+43) {
tmp = x / a;
} else if (a <= 1.25e+32) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -4.3e+43: tmp = x / a elif a <= 1.25e+32: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -4.3e+43) tmp = Float64(x / a); elseif (a <= 1.25e+32) 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 <= -4.3e+43) tmp = x / a; elseif (a <= 1.25e+32) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4.3e+43], N[(x / a), $MachinePrecision], If[LessEqual[a, 1.25e+32], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.3 \cdot 10^{+43}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{+32}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -4.3e43 or 1.2499999999999999e32 < a Initial program 74.2%
*-commutative74.2%
associate-/l*74.3%
associate-*l/76.8%
Simplified76.8%
Taylor expanded in x around inf 56.1%
Taylor expanded in a around inf 48.4%
if -4.3e43 < a < 1.2499999999999999e32Initial program 74.2%
*-commutative74.2%
associate-/l*74.9%
associate-*l/76.6%
Simplified76.6%
Taylor expanded in t around 0 43.6%
Final simplification45.6%
(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 74.2%
*-commutative74.2%
associate-/l*74.6%
associate-*l/76.7%
Simplified76.7%
Taylor expanded in x around inf 53.3%
Taylor expanded in a around inf 23.2%
Final simplification23.2%
(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 2023230
(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))))