
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
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 + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
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 + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y x) t)) (t_2 (/ y t_1)) (t_3 (+ t_2 (/ x t_1))))
(if (<= a -8.6e-75)
(* (+ (fma z (/ t_3 a) t_2) (fma (/ (- b) a) t_2 (/ t t_1))) a)
(if (<= a 2.2e-250)
(fma t_3 z (/ (fma (- y) b (* (+ t y) a)) t_1))
(if (<= a 8.8e-94)
(* (- (/ (fma (+ y x) (/ z t_1) (* (/ a t_1) (+ t y))) b) t_2) b)
(fma t_3 z (* (fma (/ b t_1) (/ y a) (/ (- (- y) t) t_1)) (- a))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + x) + t;
double t_2 = y / t_1;
double t_3 = t_2 + (x / t_1);
double tmp;
if (a <= -8.6e-75) {
tmp = (fma(z, (t_3 / a), t_2) + fma((-b / a), t_2, (t / t_1))) * a;
} else if (a <= 2.2e-250) {
tmp = fma(t_3, z, (fma(-y, b, ((t + y) * a)) / t_1));
} else if (a <= 8.8e-94) {
tmp = ((fma((y + x), (z / t_1), ((a / t_1) * (t + y))) / b) - t_2) * b;
} else {
tmp = fma(t_3, z, (fma((b / t_1), (y / a), ((-y - t) / t_1)) * -a));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + x) + t) t_2 = Float64(y / t_1) t_3 = Float64(t_2 + Float64(x / t_1)) tmp = 0.0 if (a <= -8.6e-75) tmp = Float64(Float64(fma(z, Float64(t_3 / a), t_2) + fma(Float64(Float64(-b) / a), t_2, Float64(t / t_1))) * a); elseif (a <= 2.2e-250) tmp = fma(t_3, z, Float64(fma(Float64(-y), b, Float64(Float64(t + y) * a)) / t_1)); elseif (a <= 8.8e-94) tmp = Float64(Float64(Float64(fma(Float64(y + x), Float64(z / t_1), Float64(Float64(a / t_1) * Float64(t + y))) / b) - t_2) * b); else tmp = fma(t_3, z, Float64(fma(Float64(b / t_1), Float64(y / a), Float64(Float64(Float64(-y) - t) / t_1)) * Float64(-a))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(y / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8.6e-75], N[(N[(N[(z * N[(t$95$3 / a), $MachinePrecision] + t$95$2), $MachinePrecision] + N[(N[((-b) / a), $MachinePrecision] * t$95$2 + N[(t / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[a, 2.2e-250], N[(t$95$3 * z + N[(N[((-y) * b + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.8e-94], N[(N[(N[(N[(N[(y + x), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision] + N[(N[(a / t$95$1), $MachinePrecision] * N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] - t$95$2), $MachinePrecision] * b), $MachinePrecision], N[(t$95$3 * z + N[(N[(N[(b / t$95$1), $MachinePrecision] * N[(y / a), $MachinePrecision] + N[(N[((-y) - t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] * (-a)), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) + t\\
t_2 := \frac{y}{t\_1}\\
t_3 := t\_2 + \frac{x}{t\_1}\\
\mathbf{if}\;a \leq -8.6 \cdot 10^{-75}:\\
\;\;\;\;\left(\mathsf{fma}\left(z, \frac{t\_3}{a}, t\_2\right) + \mathsf{fma}\left(\frac{-b}{a}, t\_2, \frac{t}{t\_1}\right)\right) \cdot a\\
\mathbf{elif}\;a \leq 2.2 \cdot 10^{-250}:\\
\;\;\;\;\mathsf{fma}\left(t\_3, z, \frac{\mathsf{fma}\left(-y, b, \left(t + y\right) \cdot a\right)}{t\_1}\right)\\
\mathbf{elif}\;a \leq 8.8 \cdot 10^{-94}:\\
\;\;\;\;\left(\frac{\mathsf{fma}\left(y + x, \frac{z}{t\_1}, \frac{a}{t\_1} \cdot \left(t + y\right)\right)}{b} - t\_2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_3, z, \mathsf{fma}\left(\frac{b}{t\_1}, \frac{y}{a}, \frac{\left(-y\right) - t}{t\_1}\right) \cdot \left(-a\right)\right)\\
\end{array}
\end{array}
if a < -8.5999999999999998e-75Initial program 58.6%
Taylor expanded in z around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
div-subN/A
Applied rewrites66.7%
Taylor expanded in a around inf
Applied rewrites99.7%
if -8.5999999999999998e-75 < a < 2.2e-250Initial program 76.3%
Taylor expanded in z around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
div-subN/A
Applied rewrites94.8%
if 2.2e-250 < a < 8.80000000000000004e-94Initial program 68.2%
Taylor expanded in b around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
Applied rewrites91.2%
if 8.80000000000000004e-94 < a Initial program 53.1%
Taylor expanded in z around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
div-subN/A
Applied rewrites67.7%
Taylor expanded in a around -inf
Applied rewrites98.7%
Final simplification96.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ t x) y))
(t_2 (/ (- (+ (* (+ y x) z) (* (+ t y) a)) (* b y)) t_1))
(t_3 (- (+ z a) b)))
(if (<= t_2 -2e+39)
t_3
(if (<= t_2 -2e-130)
(/ (fma t a (* z x)) (+ t x))
(if (<= t_2 1.6e+98) (/ (fma x z (* (- z b) y)) t_1) t_3)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + x) + y;
double t_2 = ((((y + x) * z) + ((t + y) * a)) - (b * y)) / t_1;
double t_3 = (z + a) - b;
double tmp;
if (t_2 <= -2e+39) {
tmp = t_3;
} else if (t_2 <= -2e-130) {
tmp = fma(t, a, (z * x)) / (t + x);
} else if (t_2 <= 1.6e+98) {
tmp = fma(x, z, ((z - b) * y)) / t_1;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + x) + y) t_2 = Float64(Float64(Float64(Float64(Float64(y + x) * z) + Float64(Float64(t + y) * a)) - Float64(b * y)) / t_1) t_3 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_2 <= -2e+39) tmp = t_3; elseif (t_2 <= -2e-130) tmp = Float64(fma(t, a, Float64(z * x)) / Float64(t + x)); elseif (t_2 <= 1.6e+98) tmp = Float64(fma(x, z, Float64(Float64(z - b) * y)) / t_1); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(y + x), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+39], t$95$3, If[LessEqual[t$95$2, -2e-130], N[(N[(t * a + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1.6e+98], N[(N[(x * z + N[(N[(z - b), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + x\right) + y\\
t_2 := \frac{\left(\left(y + x\right) \cdot z + \left(t + y\right) \cdot a\right) - b \cdot y}{t\_1}\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+39}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-130}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, a, z \cdot x\right)}{t + x}\\
\mathbf{elif}\;t\_2 \leq 1.6 \cdot 10^{+98}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, z, \left(z - b\right) \cdot y\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -1.99999999999999988e39 or 1.6000000000000001e98 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 39.4%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6464.4
Applied rewrites64.4%
if -1.99999999999999988e39 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2.0000000000000002e-130Initial program 99.7%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6475.4
Applied rewrites75.4%
Applied rewrites75.4%
if -2.0000000000000002e-130 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.6000000000000001e98Initial program 99.7%
Taylor expanded in a around 0
distribute-rgt-inN/A
associate--l+N/A
lower-fma.f64N/A
*-commutativeN/A
distribute-lft-out--N/A
lower-*.f64N/A
lower--.f6467.1
Applied rewrites67.1%
Final simplification66.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y x) t))
(t_2 (/ (- (+ (* (+ y x) z) (* (+ t y) a)) (* b y)) (+ (+ t x) y)))
(t_3 (- (+ z a) b)))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 2e+283)
(fma (+ (/ t t_1) (/ y t_1)) a (/ (fma x z (* (- z b) y)) t_1))
t_3))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + x) + t;
double t_2 = ((((y + x) * z) + ((t + y) * a)) - (b * y)) / ((t + x) + y);
double t_3 = (z + a) - b;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= 2e+283) {
tmp = fma(((t / t_1) + (y / t_1)), a, (fma(x, z, ((z - b) * y)) / t_1));
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + x) + t) t_2 = Float64(Float64(Float64(Float64(Float64(y + x) * z) + Float64(Float64(t + y) * a)) - Float64(b * y)) / Float64(Float64(t + x) + y)) t_3 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= 2e+283) tmp = fma(Float64(Float64(t / t_1) + Float64(y / t_1)), a, Float64(fma(x, z, Float64(Float64(z - b) * y)) / t_1)); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(y + x), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, 2e+283], N[(N[(N[(t / t$95$1), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision] * a + N[(N[(x * z + N[(N[(z - b), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) + t\\
t_2 := \frac{\left(\left(y + x\right) \cdot z + \left(t + y\right) \cdot a\right) - b \cdot y}{\left(t + x\right) + y}\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+283}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{t\_1} + \frac{y}{t\_1}, a, \frac{\mathsf{fma}\left(x, z, \left(z - b\right) \cdot y\right)}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 1.99999999999999991e283 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.3%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6461.8
Applied rewrites61.8%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.99999999999999991e283Initial program 99.7%
Taylor expanded in a around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
div-subN/A
Applied rewrites99.8%
Final simplification84.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ t x) y))
(t_2 (/ (- (+ (* (+ y x) z) (* (+ t y) a)) (* b y)) t_1))
(t_3 (- (+ z a) b)))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 2e+283)
(/ (fma (+ t y) a (fma x z (* (- z b) y))) t_1)
t_3))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + x) + y;
double t_2 = ((((y + x) * z) + ((t + y) * a)) - (b * y)) / t_1;
double t_3 = (z + a) - b;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= 2e+283) {
tmp = fma((t + y), a, fma(x, z, ((z - b) * y))) / t_1;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + x) + y) t_2 = Float64(Float64(Float64(Float64(Float64(y + x) * z) + Float64(Float64(t + y) * a)) - Float64(b * y)) / t_1) t_3 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= 2e+283) tmp = Float64(fma(Float64(t + y), a, fma(x, z, Float64(Float64(z - b) * y))) / t_1); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(y + x), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, 2e+283], N[(N[(N[(t + y), $MachinePrecision] * a + N[(x * z + N[(N[(z - b), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + x\right) + y\\
t_2 := \frac{\left(\left(y + x\right) \cdot z + \left(t + y\right) \cdot a\right) - b \cdot y}{t\_1}\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+283}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t + y, a, \mathsf{fma}\left(x, z, \left(z - b\right) \cdot y\right)\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 1.99999999999999991e283 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.3%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6461.8
Applied rewrites61.8%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.99999999999999991e283Initial program 99.7%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
sub-negN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64N/A
distribute-rgt-inN/A
associate--l+N/A
lower-fma.f64N/A
*-commutativeN/A
distribute-lft-out--N/A
lower-*.f64N/A
lower--.f6499.7
Applied rewrites99.7%
Final simplification84.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ t y) a))
(t_2 (+ (+ t x) y))
(t_3 (/ (- (+ (* (+ y x) z) t_1) (* b y)) t_2))
(t_4 (- (+ z a) b)))
(if (<= t_3 -1e+190)
t_4
(if (<= t_3 2e+152) (/ (fma (+ y x) z t_1) t_2) t_4))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) * a;
double t_2 = (t + x) + y;
double t_3 = ((((y + x) * z) + t_1) - (b * y)) / t_2;
double t_4 = (z + a) - b;
double tmp;
if (t_3 <= -1e+190) {
tmp = t_4;
} else if (t_3 <= 2e+152) {
tmp = fma((y + x), z, t_1) / t_2;
} else {
tmp = t_4;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) * a) t_2 = Float64(Float64(t + x) + y) t_3 = Float64(Float64(Float64(Float64(Float64(y + x) * z) + t_1) - Float64(b * y)) / t_2) t_4 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_3 <= -1e+190) tmp = t_4; elseif (t_3 <= 2e+152) tmp = Float64(fma(Float64(y + x), z, t_1) / t_2); else tmp = t_4; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(y + x), $MachinePrecision] * z), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$3, -1e+190], t$95$4, If[LessEqual[t$95$3, 2e+152], N[(N[(N[(y + x), $MachinePrecision] * z + t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) \cdot a\\
t_2 := \left(t + x\right) + y\\
t_3 := \frac{\left(\left(y + x\right) \cdot z + t\_1\right) - b \cdot y}{t\_2}\\
t_4 := \left(z + a\right) - b\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{+190}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+152}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y + x, z, t\_1\right)}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -1.0000000000000001e190 or 2.0000000000000001e152 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 19.0%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6463.8
Applied rewrites63.8%
if -1.0000000000000001e190 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.0000000000000001e152Initial program 99.7%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6482.0
Applied rewrites82.0%
Final simplification73.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ y x) z) (* (+ t y) a)) (* b y)) (+ (+ t x) y)))
(t_2 (- (+ z a) b)))
(if (<= t_1 -2e+39)
t_2
(if (<= t_1 1.6e+98) (/ (fma t a (* z x)) (+ t x)) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((y + x) * z) + ((t + y) * a)) - (b * y)) / ((t + x) + y);
double t_2 = (z + a) - b;
double tmp;
if (t_1 <= -2e+39) {
tmp = t_2;
} else if (t_1 <= 1.6e+98) {
tmp = fma(t, a, (z * x)) / (t + x);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(y + x) * z) + Float64(Float64(t + y) * a)) - Float64(b * y)) / Float64(Float64(t + x) + y)) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_1 <= -2e+39) tmp = t_2; elseif (t_1 <= 1.6e+98) tmp = Float64(fma(t, a, Float64(z * x)) / Float64(t + x)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(y + x), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+39], t$95$2, If[LessEqual[t$95$1, 1.6e+98], N[(N[(t * a + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(y + x\right) \cdot z + \left(t + y\right) \cdot a\right) - b \cdot y}{\left(t + x\right) + y}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+39}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 1.6 \cdot 10^{+98}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, a, z \cdot x\right)}{t + x}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -1.99999999999999988e39 or 1.6000000000000001e98 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 39.4%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6464.4
Applied rewrites64.4%
if -1.99999999999999988e39 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.6000000000000001e98Initial program 99.7%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6463.8
Applied rewrites63.8%
Applied rewrites63.8%
Final simplification64.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y x) t))
(t_2 (/ y t_1))
(t_3 (+ t_2 (/ x t_1)))
(t_4
(fma t_3 z (* (fma (/ b t_1) (/ y a) (/ (- (- y) t) t_1)) (- a)))))
(if (<= a -4.6e-108)
t_4
(if (<= a 2.2e-250)
(fma t_3 z (/ (fma (- y) b (* (+ t y) a)) t_1))
(if (<= a 8.8e-94)
(* (- (/ (fma (+ y x) (/ z t_1) (* (/ a t_1) (+ t y))) b) t_2) b)
t_4)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + x) + t;
double t_2 = y / t_1;
double t_3 = t_2 + (x / t_1);
double t_4 = fma(t_3, z, (fma((b / t_1), (y / a), ((-y - t) / t_1)) * -a));
double tmp;
if (a <= -4.6e-108) {
tmp = t_4;
} else if (a <= 2.2e-250) {
tmp = fma(t_3, z, (fma(-y, b, ((t + y) * a)) / t_1));
} else if (a <= 8.8e-94) {
tmp = ((fma((y + x), (z / t_1), ((a / t_1) * (t + y))) / b) - t_2) * b;
} else {
tmp = t_4;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + x) + t) t_2 = Float64(y / t_1) t_3 = Float64(t_2 + Float64(x / t_1)) t_4 = fma(t_3, z, Float64(fma(Float64(b / t_1), Float64(y / a), Float64(Float64(Float64(-y) - t) / t_1)) * Float64(-a))) tmp = 0.0 if (a <= -4.6e-108) tmp = t_4; elseif (a <= 2.2e-250) tmp = fma(t_3, z, Float64(fma(Float64(-y), b, Float64(Float64(t + y) * a)) / t_1)); elseif (a <= 8.8e-94) tmp = Float64(Float64(Float64(fma(Float64(y + x), Float64(z / t_1), Float64(Float64(a / t_1) * Float64(t + y))) / b) - t_2) * b); else tmp = t_4; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(y / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * z + N[(N[(N[(b / t$95$1), $MachinePrecision] * N[(y / a), $MachinePrecision] + N[(N[((-y) - t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] * (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.6e-108], t$95$4, If[LessEqual[a, 2.2e-250], N[(t$95$3 * z + N[(N[((-y) * b + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.8e-94], N[(N[(N[(N[(N[(y + x), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision] + N[(N[(a / t$95$1), $MachinePrecision] * N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] - t$95$2), $MachinePrecision] * b), $MachinePrecision], t$95$4]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) + t\\
t_2 := \frac{y}{t\_1}\\
t_3 := t\_2 + \frac{x}{t\_1}\\
t_4 := \mathsf{fma}\left(t\_3, z, \mathsf{fma}\left(\frac{b}{t\_1}, \frac{y}{a}, \frac{\left(-y\right) - t}{t\_1}\right) \cdot \left(-a\right)\right)\\
\mathbf{if}\;a \leq -4.6 \cdot 10^{-108}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;a \leq 2.2 \cdot 10^{-250}:\\
\;\;\;\;\mathsf{fma}\left(t\_3, z, \frac{\mathsf{fma}\left(-y, b, \left(t + y\right) \cdot a\right)}{t\_1}\right)\\
\mathbf{elif}\;a \leq 8.8 \cdot 10^{-94}:\\
\;\;\;\;\left(\frac{\mathsf{fma}\left(y + x, \frac{z}{t\_1}, \frac{a}{t\_1} \cdot \left(t + y\right)\right)}{b} - t\_2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if a < -4.59999999999999992e-108 or 8.80000000000000004e-94 < a Initial program 57.3%
Taylor expanded in z around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
div-subN/A
Applied rewrites68.5%
Taylor expanded in a around -inf
Applied rewrites97.0%
if -4.59999999999999992e-108 < a < 2.2e-250Initial program 74.9%
Taylor expanded in z around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
div-subN/A
Applied rewrites94.1%
if 2.2e-250 < a < 8.80000000000000004e-94Initial program 68.2%
Taylor expanded in b around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
Applied rewrites91.2%
Final simplification95.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y x) t))
(t_2 (/ y t_1))
(t_3
(* (- (/ (fma (+ y x) (/ z t_1) (* (/ a t_1) (+ t y))) b) t_2) b)))
(if (<= b -8.2e-144)
t_3
(if (<= b 4.8e+58)
(fma (+ t_2 (/ x t_1)) z (/ (fma (- y) b (* (+ t y) a)) t_1))
t_3))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + x) + t;
double t_2 = y / t_1;
double t_3 = ((fma((y + x), (z / t_1), ((a / t_1) * (t + y))) / b) - t_2) * b;
double tmp;
if (b <= -8.2e-144) {
tmp = t_3;
} else if (b <= 4.8e+58) {
tmp = fma((t_2 + (x / t_1)), z, (fma(-y, b, ((t + y) * a)) / t_1));
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + x) + t) t_2 = Float64(y / t_1) t_3 = Float64(Float64(Float64(fma(Float64(y + x), Float64(z / t_1), Float64(Float64(a / t_1) * Float64(t + y))) / b) - t_2) * b) tmp = 0.0 if (b <= -8.2e-144) tmp = t_3; elseif (b <= 4.8e+58) tmp = fma(Float64(t_2 + Float64(x / t_1)), z, Float64(fma(Float64(-y), b, Float64(Float64(t + y) * a)) / t_1)); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(y / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(y + x), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision] + N[(N[(a / t$95$1), $MachinePrecision] * N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] - t$95$2), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -8.2e-144], t$95$3, If[LessEqual[b, 4.8e+58], N[(N[(t$95$2 + N[(x / t$95$1), $MachinePrecision]), $MachinePrecision] * z + N[(N[((-y) * b + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) + t\\
t_2 := \frac{y}{t\_1}\\
t_3 := \left(\frac{\mathsf{fma}\left(y + x, \frac{z}{t\_1}, \frac{a}{t\_1} \cdot \left(t + y\right)\right)}{b} - t\_2\right) \cdot b\\
\mathbf{if}\;b \leq -8.2 \cdot 10^{-144}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;b \leq 4.8 \cdot 10^{+58}:\\
\;\;\;\;\mathsf{fma}\left(t\_2 + \frac{x}{t\_1}, z, \frac{\mathsf{fma}\left(-y, b, \left(t + y\right) \cdot a\right)}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if b < -8.2e-144 or 4.8e58 < b Initial program 54.9%
Taylor expanded in b around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
Applied rewrites94.0%
if -8.2e-144 < b < 4.8e58Initial program 71.2%
Taylor expanded in z around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
div-subN/A
Applied rewrites85.7%
Final simplification90.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ t y) (/ (+ (+ y x) t) a))) (t_2 (+ (+ t x) y)))
(if (<= a -4e+57)
t_1
(if (<= a -3.2e-132)
(/ (fma (- y) b (* (+ t y) a)) t_2)
(if (<= a 1.05e-116)
(/ (fma x z (* (- z b) y)) t_2)
(if (<= a 2.85e+110) (- (+ z a) b) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) / (((y + x) + t) / a);
double t_2 = (t + x) + y;
double tmp;
if (a <= -4e+57) {
tmp = t_1;
} else if (a <= -3.2e-132) {
tmp = fma(-y, b, ((t + y) * a)) / t_2;
} else if (a <= 1.05e-116) {
tmp = fma(x, z, ((z - b) * y)) / t_2;
} else if (a <= 2.85e+110) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) / Float64(Float64(Float64(y + x) + t) / a)) t_2 = Float64(Float64(t + x) + y) tmp = 0.0 if (a <= -4e+57) tmp = t_1; elseif (a <= -3.2e-132) tmp = Float64(fma(Float64(-y), b, Float64(Float64(t + y) * a)) / t_2); elseif (a <= 1.05e-116) tmp = Float64(fma(x, z, Float64(Float64(z - b) * y)) / t_2); elseif (a <= 2.85e+110) tmp = Float64(Float64(z + a) - b); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] / N[(N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[a, -4e+57], t$95$1, If[LessEqual[a, -3.2e-132], N[(N[((-y) * b + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[a, 1.05e-116], N[(N[(x * z + N[(N[(z - b), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[a, 2.85e+110], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t + y}{\frac{\left(y + x\right) + t}{a}}\\
t_2 := \left(t + x\right) + y\\
\mathbf{if}\;a \leq -4 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -3.2 \cdot 10^{-132}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-y, b, \left(t + y\right) \cdot a\right)}{t\_2}\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{-116}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, z, \left(z - b\right) \cdot y\right)}{t\_2}\\
\mathbf{elif}\;a \leq 2.85 \cdot 10^{+110}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.00000000000000019e57 or 2.8500000000000001e110 < a Initial program 46.0%
Taylor expanded in a around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f6473.2
Applied rewrites73.2%
Applied rewrites74.4%
if -4.00000000000000019e57 < a < -3.2000000000000002e-132Initial program 77.7%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6459.4
Applied rewrites59.4%
if -3.2000000000000002e-132 < a < 1.05e-116Initial program 71.9%
Taylor expanded in a around 0
distribute-rgt-inN/A
associate--l+N/A
lower-fma.f64N/A
*-commutativeN/A
distribute-lft-out--N/A
lower-*.f64N/A
lower--.f6467.1
Applied rewrites67.1%
if 1.05e-116 < a < 2.8500000000000001e110Initial program 63.2%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6468.4
Applied rewrites68.4%
Final simplification68.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ t (+ t x)) a)))
(if (<= t -1.3e+136)
t_1
(if (<= t -1.9e+40)
(* (/ z (+ (+ y x) t)) (+ y x))
(if (<= t 7.2e+132) (- (+ z a) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t / (t + x)) * a;
double tmp;
if (t <= -1.3e+136) {
tmp = t_1;
} else if (t <= -1.9e+40) {
tmp = (z / ((y + x) + t)) * (y + x);
} else if (t <= 7.2e+132) {
tmp = (z + a) - 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 = (t / (t + x)) * a
if (t <= (-1.3d+136)) then
tmp = t_1
else if (t <= (-1.9d+40)) then
tmp = (z / ((y + x) + t)) * (y + x)
else if (t <= 7.2d+132) then
tmp = (z + a) - 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 = (t / (t + x)) * a;
double tmp;
if (t <= -1.3e+136) {
tmp = t_1;
} else if (t <= -1.9e+40) {
tmp = (z / ((y + x) + t)) * (y + x);
} else if (t <= 7.2e+132) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t / (t + x)) * a tmp = 0 if t <= -1.3e+136: tmp = t_1 elif t <= -1.9e+40: tmp = (z / ((y + x) + t)) * (y + x) elif t <= 7.2e+132: tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t / Float64(t + x)) * a) tmp = 0.0 if (t <= -1.3e+136) tmp = t_1; elseif (t <= -1.9e+40) tmp = Float64(Float64(z / Float64(Float64(y + x) + t)) * Float64(y + x)); elseif (t <= 7.2e+132) tmp = Float64(Float64(z + a) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t / (t + x)) * a; tmp = 0.0; if (t <= -1.3e+136) tmp = t_1; elseif (t <= -1.9e+40) tmp = (z / ((y + x) + t)) * (y + x); elseif (t <= 7.2e+132) tmp = (z + a) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[t, -1.3e+136], t$95$1, If[LessEqual[t, -1.9e+40], N[(N[(z / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e+132], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{t + x} \cdot a\\
\mathbf{if}\;t \leq -1.3 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.9 \cdot 10^{+40}:\\
\;\;\;\;\frac{z}{\left(y + x\right) + t} \cdot \left(y + x\right)\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+132}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.3000000000000001e136 or 7.20000000000000031e132 < t Initial program 49.5%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6437.3
Applied rewrites37.3%
Taylor expanded in a around inf
Applied rewrites61.6%
if -1.3000000000000001e136 < t < -1.90000000000000002e40Initial program 66.7%
Taylor expanded in z around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f6457.9
Applied rewrites57.9%
if -1.90000000000000002e40 < t < 7.20000000000000031e132Initial program 69.0%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6459.9
Applied rewrites59.9%
Final simplification60.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (/ a (+ (+ y x) t)) (+ t y)))) (if (<= a -1.45e+14) t_1 (if (<= a 1.6e+115) (- (+ z a) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a / ((y + x) + t)) * (t + y);
double tmp;
if (a <= -1.45e+14) {
tmp = t_1;
} else if (a <= 1.6e+115) {
tmp = (z + a) - 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 = (a / ((y + x) + t)) * (t + y)
if (a <= (-1.45d+14)) then
tmp = t_1
else if (a <= 1.6d+115) then
tmp = (z + a) - 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 = (a / ((y + x) + t)) * (t + y);
double tmp;
if (a <= -1.45e+14) {
tmp = t_1;
} else if (a <= 1.6e+115) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a / ((y + x) + t)) * (t + y) tmp = 0 if a <= -1.45e+14: tmp = t_1 elif a <= 1.6e+115: tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a / Float64(Float64(y + x) + t)) * Float64(t + y)) tmp = 0.0 if (a <= -1.45e+14) tmp = t_1; elseif (a <= 1.6e+115) tmp = Float64(Float64(z + a) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a / ((y + x) + t)) * (t + y); tmp = 0.0; if (a <= -1.45e+14) tmp = t_1; elseif (a <= 1.6e+115) tmp = (z + a) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * N[(t + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.45e+14], t$95$1, If[LessEqual[a, 1.6e+115], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{\left(y + x\right) + t} \cdot \left(t + y\right)\\
\mathbf{if}\;a \leq -1.45 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{+115}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.45e14 or 1.6e115 < a Initial program 49.6%
Taylor expanded in a around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f6469.6
Applied rewrites69.6%
if -1.45e14 < a < 1.6e115Initial program 70.8%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6456.5
Applied rewrites56.5%
Final simplification61.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (/ t (+ t x)) a))) (if (<= t -1.52e+150) t_1 (if (<= t 7.2e+132) (- (+ z a) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t / (t + x)) * a;
double tmp;
if (t <= -1.52e+150) {
tmp = t_1;
} else if (t <= 7.2e+132) {
tmp = (z + a) - 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 = (t / (t + x)) * a
if (t <= (-1.52d+150)) then
tmp = t_1
else if (t <= 7.2d+132) then
tmp = (z + a) - 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 = (t / (t + x)) * a;
double tmp;
if (t <= -1.52e+150) {
tmp = t_1;
} else if (t <= 7.2e+132) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t / (t + x)) * a tmp = 0 if t <= -1.52e+150: tmp = t_1 elif t <= 7.2e+132: tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t / Float64(t + x)) * a) tmp = 0.0 if (t <= -1.52e+150) tmp = t_1; elseif (t <= 7.2e+132) tmp = Float64(Float64(z + a) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t / (t + x)) * a; tmp = 0.0; if (t <= -1.52e+150) tmp = t_1; elseif (t <= 7.2e+132) tmp = (z + a) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[t, -1.52e+150], t$95$1, If[LessEqual[t, 7.2e+132], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{t + x} \cdot a\\
\mathbf{if}\;t \leq -1.52 \cdot 10^{+150}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+132}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.52e150 or 7.20000000000000031e132 < t Initial program 48.1%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6436.6
Applied rewrites36.6%
Taylor expanded in a around inf
Applied rewrites62.1%
if -1.52e150 < t < 7.20000000000000031e132Initial program 68.9%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6457.2
Applied rewrites57.2%
Final simplification58.7%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.15e+150) (* 1.0 a) (if (<= t 3.2e+133) (- (+ z a) b) (* 1.0 a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.15e+150) {
tmp = 1.0 * a;
} else if (t <= 3.2e+133) {
tmp = (z + a) - b;
} else {
tmp = 1.0 * a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-3.15d+150)) then
tmp = 1.0d0 * a
else if (t <= 3.2d+133) then
tmp = (z + a) - b
else
tmp = 1.0d0 * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.15e+150) {
tmp = 1.0 * a;
} else if (t <= 3.2e+133) {
tmp = (z + a) - b;
} else {
tmp = 1.0 * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.15e+150: tmp = 1.0 * a elif t <= 3.2e+133: tmp = (z + a) - b else: tmp = 1.0 * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.15e+150) tmp = Float64(1.0 * a); elseif (t <= 3.2e+133) tmp = Float64(Float64(z + a) - b); else tmp = Float64(1.0 * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -3.15e+150) tmp = 1.0 * a; elseif (t <= 3.2e+133) tmp = (z + a) - b; else tmp = 1.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.15e+150], N[(1.0 * a), $MachinePrecision], If[LessEqual[t, 3.2e+133], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(1.0 * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.15 \cdot 10^{+150}:\\
\;\;\;\;1 \cdot a\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{+133}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;1 \cdot a\\
\end{array}
\end{array}
if t < -3.15000000000000015e150 or 3.19999999999999997e133 < t Initial program 48.1%
Taylor expanded in z around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
div-subN/A
Applied rewrites53.2%
Taylor expanded in a around inf
Applied rewrites83.9%
Taylor expanded in t around inf
Applied rewrites56.6%
if -3.15000000000000015e150 < t < 3.19999999999999997e133Initial program 68.9%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6457.2
Applied rewrites57.2%
(FPCore (x y z t a b) :precision binary64 (if (<= a -3300000000000.0) (* 1.0 a) (if (<= a 7.5e-41) (- z b) (+ z a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -3300000000000.0) {
tmp = 1.0 * a;
} else if (a <= 7.5e-41) {
tmp = z - b;
} else {
tmp = z + 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 <= (-3300000000000.0d0)) then
tmp = 1.0d0 * a
else if (a <= 7.5d-41) then
tmp = z - b
else
tmp = z + 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 <= -3300000000000.0) {
tmp = 1.0 * a;
} else if (a <= 7.5e-41) {
tmp = z - b;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -3300000000000.0: tmp = 1.0 * a elif a <= 7.5e-41: tmp = z - b else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -3300000000000.0) tmp = Float64(1.0 * a); elseif (a <= 7.5e-41) tmp = Float64(z - b); else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -3300000000000.0) tmp = 1.0 * a; elseif (a <= 7.5e-41) tmp = z - b; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -3300000000000.0], N[(1.0 * a), $MachinePrecision], If[LessEqual[a, 7.5e-41], N[(z - b), $MachinePrecision], N[(z + a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3300000000000:\\
\;\;\;\;1 \cdot a\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{-41}:\\
\;\;\;\;z - b\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if a < -3.3e12Initial program 54.6%
Taylor expanded in z around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
div-subN/A
Applied rewrites63.7%
Taylor expanded in a around inf
Applied rewrites99.7%
Taylor expanded in t around inf
Applied rewrites46.1%
if -3.3e12 < a < 7.50000000000000049e-41Initial program 72.2%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6454.0
Applied rewrites54.0%
Taylor expanded in a around 0
Applied rewrites53.7%
if 7.50000000000000049e-41 < a Initial program 52.4%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6454.3
Applied rewrites54.3%
Taylor expanded in b around 0
Applied rewrites59.1%
Final simplification53.2%
(FPCore (x y z t a b) :precision binary64 (if (<= a -9e-86) (- a b) (if (<= a 7.5e-41) (- z b) (+ z a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -9e-86) {
tmp = a - b;
} else if (a <= 7.5e-41) {
tmp = z - b;
} else {
tmp = z + 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 <= (-9d-86)) then
tmp = a - b
else if (a <= 7.5d-41) then
tmp = z - b
else
tmp = z + 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 <= -9e-86) {
tmp = a - b;
} else if (a <= 7.5e-41) {
tmp = z - b;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -9e-86: tmp = a - b elif a <= 7.5e-41: tmp = z - b else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -9e-86) tmp = Float64(a - b); elseif (a <= 7.5e-41) tmp = Float64(z - b); else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -9e-86) tmp = a - b; elseif (a <= 7.5e-41) tmp = z - b; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -9e-86], N[(a - b), $MachinePrecision], If[LessEqual[a, 7.5e-41], N[(z - b), $MachinePrecision], N[(z + a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9 \cdot 10^{-86}:\\
\;\;\;\;a - b\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{-41}:\\
\;\;\;\;z - b\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if a < -8.9999999999999995e-86Initial program 60.0%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6445.8
Applied rewrites45.8%
Taylor expanded in z around 0
Applied rewrites47.1%
if -8.9999999999999995e-86 < a < 7.50000000000000049e-41Initial program 71.5%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6452.8
Applied rewrites52.8%
Taylor expanded in a around 0
Applied rewrites54.2%
if 7.50000000000000049e-41 < a Initial program 52.4%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6454.3
Applied rewrites54.3%
Taylor expanded in b around 0
Applied rewrites59.1%
Final simplification53.1%
(FPCore (x y z t a b) :precision binary64 (if (<= a -5.5e-88) (- a b) (+ z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.5e-88) {
tmp = a - b;
} else {
tmp = z + 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 <= (-5.5d-88)) then
tmp = a - b
else
tmp = z + 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 <= -5.5e-88) {
tmp = a - b;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -5.5e-88: tmp = a - b else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -5.5e-88) tmp = Float64(a - b); else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -5.5e-88) tmp = a - b; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -5.5e-88], N[(a - b), $MachinePrecision], N[(z + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{-88}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if a < -5.49999999999999971e-88Initial program 60.0%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6445.8
Applied rewrites45.8%
Taylor expanded in z around 0
Applied rewrites47.1%
if -5.49999999999999971e-88 < a Initial program 63.8%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6453.4
Applied rewrites53.4%
Taylor expanded in b around 0
Applied rewrites52.3%
Final simplification50.5%
(FPCore (x y z t a b) :precision binary64 (+ z a))
double code(double x, double y, double z, double t, double a, double b) {
return z + 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 = z + a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return z + a;
}
def code(x, y, z, t, a, b): return z + a
function code(x, y, z, t, a, b) return Float64(z + a) end
function tmp = code(x, y, z, t, a, b) tmp = z + a; end
code[x_, y_, z_, t_, a_, b_] := N[(z + a), $MachinePrecision]
\begin{array}{l}
\\
z + a
\end{array}
Initial program 62.5%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6450.8
Applied rewrites50.8%
Taylor expanded in b around 0
Applied rewrites48.3%
Final simplification48.3%
(FPCore (x y z t a b) :precision binary64 (- b))
double code(double x, double y, double z, double t, double a, double b) {
return -b;
}
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 = -b
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return -b;
}
def code(x, y, z, t, a, b): return -b
function code(x, y, z, t, a, b) return Float64(-b) end
function tmp = code(x, y, z, t, a, b) tmp = -b; end
code[x_, y_, z_, t_, a_, b_] := (-b)
\begin{array}{l}
\\
-b
\end{array}
Initial program 62.5%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6450.8
Applied rewrites50.8%
Taylor expanded in b around inf
Applied rewrites11.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))
(t_3 (/ t_2 t_1))
(t_4 (- (+ z a) b)))
(if (< t_3 -3.5813117084150564e+153)
t_4
(if (< t_3 1.2285964308315609e+82) (/ 1.0 (/ t_1 t_2)) t_4))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
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) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (x + t) + y
t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b)
t_3 = t_2 / t_1
t_4 = (z + a) - b
if (t_3 < (-3.5813117084150564d+153)) then
tmp = t_4
else if (t_3 < 1.2285964308315609d+82) then
tmp = 1.0d0 / (t_1 / t_2)
else
tmp = t_4
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 + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + t) + y t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b) t_3 = t_2 / t_1 t_4 = (z + a) - b tmp = 0 if t_3 < -3.5813117084150564e+153: tmp = t_4 elif t_3 < 1.2285964308315609e+82: tmp = 1.0 / (t_1 / t_2) else: tmp = t_4 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) t_3 = Float64(t_2 / t_1) t_4 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = Float64(1.0 / Float64(t_1 / t_2)); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + t) + y; t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b); t_3 = t_2 / t_1; t_4 = (z + a) - b; tmp = 0.0; if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = 1.0 / (t_1 / t_2); else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Less[t$95$3, -3.5813117084150564e+153], t$95$4, If[Less[t$95$3, 1.2285964308315609e+82], N[(1.0 / N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\\
t_3 := \frac{t\_2}{t\_1}\\
t_4 := \left(z + a\right) - b\\
\mathbf{if}\;t\_3 < -3.5813117084150564 \cdot 10^{+153}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 < 1.2285964308315609 \cdot 10^{+82}:\\
\;\;\;\;\frac{1}{\frac{t\_1}{t\_2}}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
herbie shell --seed 2024254
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3581311708415056400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 12285964308315609000000000000000000000000000000000000000000000000000000000000000000) (/ 1 (/ (+ (+ x t) y) (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))) (- (+ z a) b))))
(/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))