
(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 20 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 t_1) (+ t_2 (fma (/ x a) (/ z t_1) (* t_2 (/ (- z b) a)))))
a)))
(if (<= a -5.5e-31)
t_3
(if (<= a 4.9e-36)
(*
(-
(+ (/ x t_1) (fma (/ a z) (/ (+ t y) t_1) t_2))
(* (/ y (* t_1 z)) b))
z)
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 = ((t / t_1) + (t_2 + fma((x / a), (z / t_1), (t_2 * ((z - b) / a))))) * a;
double tmp;
if (a <= -5.5e-31) {
tmp = t_3;
} else if (a <= 4.9e-36) {
tmp = (((x / t_1) + fma((a / z), ((t + y) / t_1), t_2)) - ((y / (t_1 * z)) * b)) * z;
} 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(t / t_1) + Float64(t_2 + fma(Float64(x / a), Float64(z / t_1), Float64(t_2 * Float64(Float64(z - b) / a))))) * a) tmp = 0.0 if (a <= -5.5e-31) tmp = t_3; elseif (a <= 4.9e-36) tmp = Float64(Float64(Float64(Float64(x / t_1) + fma(Float64(a / z), Float64(Float64(t + y) / t_1), t_2)) - Float64(Float64(y / Float64(t_1 * z)) * b)) * z); 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[(t / t$95$1), $MachinePrecision] + N[(t$95$2 + N[(N[(x / a), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision] + N[(t$95$2 * N[(N[(z - b), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -5.5e-31], t$95$3, If[LessEqual[a, 4.9e-36], N[(N[(N[(N[(x / t$95$1), $MachinePrecision] + N[(N[(a / z), $MachinePrecision] * N[(N[(t + y), $MachinePrecision] / t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] - N[(N[(y / N[(t$95$1 * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] * z), $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{t}{t\_1} + \left(t\_2 + \mathsf{fma}\left(\frac{x}{a}, \frac{z}{t\_1}, t\_2 \cdot \frac{z - b}{a}\right)\right)\right) \cdot a\\
\mathbf{if}\;a \leq -5.5 \cdot 10^{-31}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \leq 4.9 \cdot 10^{-36}:\\
\;\;\;\;\left(\left(\frac{x}{t\_1} + \mathsf{fma}\left(\frac{a}{z}, \frac{t + y}{t\_1}, t\_2\right)\right) - \frac{y}{t\_1 \cdot z} \cdot b\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if a < -5.49999999999999958e-31 or 4.8999999999999997e-36 < a Initial program 51.6%
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 rewrites74.6%
Taylor expanded in a around inf
Applied rewrites96.4%
if -5.49999999999999958e-31 < a < 4.8999999999999997e-36Initial program 72.5%
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 rewrites72.6%
Taylor expanded in a around inf
Applied rewrites35.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
Applied rewrites89.1%
Final simplification93.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ t y) a) (* (+ y x) z)) (* b y)) (+ (+ t x) y)))
(t_2 (+ (+ y x) t))
(t_3 (/ y t_2))
(t_4
(* (- (/ (fma (+ y x) (/ z t_2) (* (/ a t_2) (+ t y))) b) t_3) b)))
(if (<= t_1 (- INFINITY))
t_4
(if (<= t_1 2e+293)
(fma (+ (/ t t_2) t_3) a (/ (fma x z (* (- z b) y)) t_2))
t_4))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((t + y) * a) + ((y + x) * z)) - (b * y)) / ((t + x) + y);
double t_2 = (y + x) + t;
double t_3 = y / t_2;
double t_4 = ((fma((y + x), (z / t_2), ((a / t_2) * (t + y))) / b) - t_3) * b;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_4;
} else if (t_1 <= 2e+293) {
tmp = fma(((t / t_2) + t_3), a, (fma(x, z, ((z - b) * y)) / t_2));
} else {
tmp = t_4;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(Float64(y + x) * z)) - Float64(b * y)) / Float64(Float64(t + x) + y)) t_2 = Float64(Float64(y + x) + t) t_3 = Float64(y / t_2) t_4 = Float64(Float64(Float64(fma(Float64(y + x), Float64(z / t_2), Float64(Float64(a / t_2) * Float64(t + y))) / b) - t_3) * b) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_4; elseif (t_1 <= 2e+293) tmp = fma(Float64(Float64(t / t_2) + t_3), a, Float64(fma(x, z, Float64(Float64(z - b) * y)) / t_2)); else tmp = t_4; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(N[(y + x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$3 = N[(y / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[(N[(y + x), $MachinePrecision] * N[(z / t$95$2), $MachinePrecision] + N[(N[(a / t$95$2), $MachinePrecision] * N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] - t$95$3), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$4, If[LessEqual[t$95$1, 2e+293], N[(N[(N[(t / t$95$2), $MachinePrecision] + t$95$3), $MachinePrecision] * a + N[(N[(x * z + N[(N[(z - b), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(t + y\right) \cdot a + \left(y + x\right) \cdot z\right) - b \cdot y}{\left(t + x\right) + y}\\
t_2 := \left(y + x\right) + t\\
t_3 := \frac{y}{t\_2}\\
t_4 := \left(\frac{\mathsf{fma}\left(y + x, \frac{z}{t\_2}, \frac{a}{t\_2} \cdot \left(t + y\right)\right)}{b} - t\_3\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+293}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{t\_2} + t\_3, a, \frac{\mathsf{fma}\left(x, z, \left(z - b\right) \cdot y\right)}{t\_2}\right)\\
\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)) < -inf.0 or 1.9999999999999998e293 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.0%
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 rewrites72.9%
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.9999999999999998e293Initial 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 simplification88.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ t y) a) (* (+ y x) z)) (* b y)) (+ (+ t x) y)))
(t_2 (- (+ z a) b)))
(if (<= t_1 -1e+292)
t_2
(if (<= t_1 5e+35)
(/ (fma x z (* t a)) (+ t x))
(if (<= t_1 2e+209) (/ (fma t a (* t_2 y)) (+ t y)) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((t + y) * a) + ((y + x) * z)) - (b * y)) / ((t + x) + y);
double t_2 = (z + a) - b;
double tmp;
if (t_1 <= -1e+292) {
tmp = t_2;
} else if (t_1 <= 5e+35) {
tmp = fma(x, z, (t * a)) / (t + x);
} else if (t_1 <= 2e+209) {
tmp = fma(t, a, (t_2 * y)) / (t + y);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(Float64(y + x) * z)) - Float64(b * y)) / Float64(Float64(t + x) + y)) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_1 <= -1e+292) tmp = t_2; elseif (t_1 <= 5e+35) tmp = Float64(fma(x, z, Float64(t * a)) / Float64(t + x)); elseif (t_1 <= 2e+209) tmp = Float64(fma(t, a, Float64(t_2 * y)) / Float64(t + y)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(N[(y + x), $MachinePrecision] * z), $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, -1e+292], t$95$2, If[LessEqual[t$95$1, 5e+35], N[(N[(x * z + N[(t * a), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+209], N[(N[(t * a + N[(t$95$2 * y), $MachinePrecision]), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(t + y\right) \cdot a + \left(y + x\right) \cdot z\right) - b \cdot y}{\left(t + x\right) + y}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+292}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+35}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, z, t \cdot a\right)}{t + x}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+209}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, a, t\_2 \cdot y\right)}{t + y}\\
\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)) < -1e292 or 2.0000000000000001e209 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 11.7%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6470.5
Applied rewrites70.5%
if -1e292 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.00000000000000021e35Initial 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-+.f6467.0
Applied rewrites67.0%
if 5.00000000000000021e35 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.0000000000000001e209Initial program 99.7%
Taylor expanded in x around 0
lower-/.f64N/A
associate--l+N/A
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
distribute-lft-out--N/A
distribute-lft-inN/A
associate--l+N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6479.8
Applied rewrites79.8%
Final simplification69.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y x) t))
(t_2 (/ (- (+ (* (+ t y) a) (* (+ y x) z)) (* b y)) (+ (+ t x) y)))
(t_3 (- (+ z a) b)))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 2e+234)
(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 = ((((t + y) * a) + ((y + x) * z)) - (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+234) {
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(t + y) * a) + Float64(Float64(y + x) * z)) - 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+234) 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[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(N[(y + x), $MachinePrecision] * z), $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+234], 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(t + y\right) \cdot a + \left(y + x\right) \cdot z\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^{+234}:\\
\;\;\;\;\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 2.00000000000000004e234 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 7.7%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6470.2
Applied rewrites70.2%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.00000000000000004e234Initial 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 simplification87.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ t y) a) (* (+ y x) z)) (* b y)) (+ (+ t x) y)))
(t_2 (- (+ z a) b)))
(if (<= t_1 -1e+292) t_2 (if (<= t_1 2e+234) t_1 t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((t + y) * a) + ((y + x) * z)) - (b * y)) / ((t + x) + y);
double t_2 = (z + a) - b;
double tmp;
if (t_1 <= -1e+292) {
tmp = t_2;
} else if (t_1 <= 2e+234) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((((t + y) * a) + ((y + x) * z)) - (b * y)) / ((t + x) + y)
t_2 = (z + a) - b
if (t_1 <= (-1d+292)) then
tmp = t_2
else if (t_1 <= 2d+234) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((t + y) * a) + ((y + x) * z)) - (b * y)) / ((t + x) + y);
double t_2 = (z + a) - b;
double tmp;
if (t_1 <= -1e+292) {
tmp = t_2;
} else if (t_1 <= 2e+234) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((((t + y) * a) + ((y + x) * z)) - (b * y)) / ((t + x) + y) t_2 = (z + a) - b tmp = 0 if t_1 <= -1e+292: tmp = t_2 elif t_1 <= 2e+234: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(Float64(y + x) * z)) - Float64(b * y)) / Float64(Float64(t + x) + y)) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_1 <= -1e+292) tmp = t_2; elseif (t_1 <= 2e+234) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((((t + y) * a) + ((y + x) * z)) - (b * y)) / ((t + x) + y); t_2 = (z + a) - b; tmp = 0.0; if (t_1 <= -1e+292) tmp = t_2; elseif (t_1 <= 2e+234) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(N[(y + x), $MachinePrecision] * z), $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, -1e+292], t$95$2, If[LessEqual[t$95$1, 2e+234], t$95$1, t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(t + y\right) \cdot a + \left(y + x\right) \cdot z\right) - b \cdot y}{\left(t + x\right) + y}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+292}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+234}:\\
\;\;\;\;t\_1\\
\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)) < -1e292 or 2.00000000000000004e234 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 8.5%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6470.5
Applied rewrites70.5%
if -1e292 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.00000000000000004e234Initial program 99.7%
Final simplification87.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ t x) y))
(t_2 (/ (- (+ (* (+ t y) a) (* (+ y x) z)) (* b y)) t_1))
(t_3 (- (+ z a) b)))
(if (<= t_2 -1e+292)
t_3
(if (<= t_2 2e+234)
(/ (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 = ((((t + y) * a) + ((y + x) * z)) - (b * y)) / t_1;
double t_3 = (z + a) - b;
double tmp;
if (t_2 <= -1e+292) {
tmp = t_3;
} else if (t_2 <= 2e+234) {
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(t + y) * a) + Float64(Float64(y + x) * z)) - Float64(b * y)) / t_1) t_3 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_2 <= -1e+292) tmp = t_3; elseif (t_2 <= 2e+234) 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[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(N[(y + x), $MachinePrecision] * z), $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, -1e+292], t$95$3, If[LessEqual[t$95$2, 2e+234], 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(t + y\right) \cdot a + \left(y + x\right) \cdot z\right) - b \cdot y}{t\_1}\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+292}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+234}:\\
\;\;\;\;\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)) < -1e292 or 2.00000000000000004e234 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 8.5%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6470.5
Applied rewrites70.5%
if -1e292 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.00000000000000004e234Initial 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 simplification87.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ t x) y))
(t_2 (/ (- (+ (* (+ t y) a) (* (+ y x) z)) (* b y)) t_1))
(t_3 (- (+ z a) b)))
(if (<= t_2 -4e+230)
t_3
(if (<= t_2 2e+234) (/ (- (fma x z (* t a)) (* 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 = ((((t + y) * a) + ((y + x) * z)) - (b * y)) / t_1;
double t_3 = (z + a) - b;
double tmp;
if (t_2 <= -4e+230) {
tmp = t_3;
} else if (t_2 <= 2e+234) {
tmp = (fma(x, z, (t * a)) - (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(t + y) * a) + Float64(Float64(y + x) * z)) - Float64(b * y)) / t_1) t_3 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_2 <= -4e+230) tmp = t_3; elseif (t_2 <= 2e+234) tmp = Float64(Float64(fma(x, z, Float64(t * a)) - Float64(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[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(N[(y + x), $MachinePrecision] * z), $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, -4e+230], t$95$3, If[LessEqual[t$95$2, 2e+234], N[(N[(N[(x * z + N[(t * a), $MachinePrecision]), $MachinePrecision] - N[(b * 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(t + y\right) \cdot a + \left(y + x\right) \cdot z\right) - b \cdot y}{t\_1}\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+230}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+234}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, z, t \cdot a\right) - b \cdot y}{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)) < -4.0000000000000004e230 or 2.00000000000000004e234 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 12.5%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6471.0
Applied rewrites71.0%
if -4.0000000000000004e230 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.00000000000000004e234Initial program 99.7%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6475.8
Applied rewrites75.8%
Final simplification73.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ t y) a) (* (+ y x) z)) (* b y)) (+ (+ t x) y)))
(t_2 (- (+ z a) b)))
(if (<= t_1 -1e+292)
t_2
(if (<= t_1 2e+37) (/ (fma x z (* t a)) (+ t x)) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((t + y) * a) + ((y + x) * z)) - (b * y)) / ((t + x) + y);
double t_2 = (z + a) - b;
double tmp;
if (t_1 <= -1e+292) {
tmp = t_2;
} else if (t_1 <= 2e+37) {
tmp = fma(x, z, (t * a)) / (t + x);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(Float64(y + x) * z)) - Float64(b * y)) / Float64(Float64(t + x) + y)) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_1 <= -1e+292) tmp = t_2; elseif (t_1 <= 2e+37) tmp = Float64(fma(x, z, Float64(t * a)) / 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[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(N[(y + x), $MachinePrecision] * z), $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, -1e+292], t$95$2, If[LessEqual[t$95$1, 2e+37], N[(N[(x * z + N[(t * a), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(t + y\right) \cdot a + \left(y + x\right) \cdot z\right) - b \cdot y}{\left(t + x\right) + y}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+292}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+37}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, z, t \cdot a\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)) < -1e292 or 1.99999999999999991e37 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 26.7%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6469.1
Applied rewrites69.1%
if -1e292 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.99999999999999991e37Initial 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-+.f6466.5
Applied rewrites66.5%
Final simplification67.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y x) t))
(t_2 (/ y t_1))
(t_3
(*
(-
(+ (/ x t_1) (fma (/ a z) (/ (+ t y) t_1) t_2))
(* (/ y (* t_1 z)) b))
z)))
(if (<= z -190.0)
t_3
(if (<= z 6e-88)
(fma (+ (/ t t_1) t_2) 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 / t_1;
double t_3 = (((x / t_1) + fma((a / z), ((t + y) / t_1), t_2)) - ((y / (t_1 * z)) * b)) * z;
double tmp;
if (z <= -190.0) {
tmp = t_3;
} else if (z <= 6e-88) {
tmp = fma(((t / t_1) + t_2), 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(y / t_1) t_3 = Float64(Float64(Float64(Float64(x / t_1) + fma(Float64(a / z), Float64(Float64(t + y) / t_1), t_2)) - Float64(Float64(y / Float64(t_1 * z)) * b)) * z) tmp = 0.0 if (z <= -190.0) tmp = t_3; elseif (z <= 6e-88) tmp = fma(Float64(Float64(t / t_1) + t_2), 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[(y / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(x / t$95$1), $MachinePrecision] + N[(N[(a / z), $MachinePrecision] * N[(N[(t + y), $MachinePrecision] / t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] - N[(N[(y / N[(t$95$1 * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -190.0], t$95$3, If[LessEqual[z, 6e-88], N[(N[(N[(t / t$95$1), $MachinePrecision] + t$95$2), $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{y}{t\_1}\\
t_3 := \left(\left(\frac{x}{t\_1} + \mathsf{fma}\left(\frac{a}{z}, \frac{t + y}{t\_1}, t\_2\right)\right) - \frac{y}{t\_1 \cdot z} \cdot b\right) \cdot z\\
\mathbf{if}\;z \leq -190:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-88}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{t\_1} + t\_2, 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 z < -190 or 5.9999999999999999e-88 < z Initial program 54.4%
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 rewrites62.5%
Taylor expanded in a around inf
Applied rewrites63.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
Applied rewrites93.0%
if -190 < z < 5.9999999999999999e-88Initial program 70.4%
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 rewrites88.5%
Final simplification91.1%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.05e+261) (- a (* (- z) (/ (+ y x) t))) (if (<= t 1.5e+46) (- (+ z a) b) (fma (/ (- z b) t) y a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.05e+261) {
tmp = a - (-z * ((y + x) / t));
} else if (t <= 1.5e+46) {
tmp = (z + a) - b;
} else {
tmp = fma(((z - b) / t), y, a);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.05e+261) tmp = Float64(a - Float64(Float64(-z) * Float64(Float64(y + x) / t))); elseif (t <= 1.5e+46) tmp = Float64(Float64(z + a) - b); else tmp = fma(Float64(Float64(z - b) / t), y, a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.05e+261], N[(a - N[((-z) * N[(N[(y + x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e+46], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(z - b), $MachinePrecision] / t), $MachinePrecision] * y + a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+261}:\\
\;\;\;\;a - \left(-z\right) \cdot \frac{y + x}{t}\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{+46}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - b}{t}, y, a\right)\\
\end{array}
\end{array}
if t < -1.05e261Initial program 67.9%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites78.1%
Taylor expanded in z around -inf
Applied rewrites99.8%
if -1.05e261 < t < 1.50000000000000012e46Initial program 61.9%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6461.2
Applied rewrites61.2%
if 1.50000000000000012e46 < t Initial program 57.6%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites56.9%
Taylor expanded in x around 0
Applied rewrites65.0%
Final simplification63.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (fma (/ (- z b) t) y a))) (if (<= t -5e+99) t_1 (if (<= t 1.5e+46) (- (+ z a) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(((z - b) / t), y, a);
double tmp;
if (t <= -5e+99) {
tmp = t_1;
} else if (t <= 1.5e+46) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(Float64(z - b) / t), y, a) tmp = 0.0 if (t <= -5e+99) tmp = t_1; elseif (t <= 1.5e+46) 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[(N[(z - b), $MachinePrecision] / t), $MachinePrecision] * y + a), $MachinePrecision]}, If[LessEqual[t, -5e+99], t$95$1, If[LessEqual[t, 1.5e+46], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{z - b}{t}, y, a\right)\\
\mathbf{if}\;t \leq -5 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{+46}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.00000000000000008e99 or 1.50000000000000012e46 < t Initial program 57.0%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites57.9%
Taylor expanded in x around 0
Applied rewrites63.8%
if -5.00000000000000008e99 < t < 1.50000000000000012e46Initial program 63.5%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6463.0
Applied rewrites63.0%
(FPCore (x y z t a b) :precision binary64 (if (<= t 1.25e+126) (- (+ z a) b) (* (/ t (+ t x)) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 1.25e+126) {
tmp = (z + a) - b;
} else {
tmp = (t / (t + x)) * a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= 1.25d+126) then
tmp = (z + a) - b
else
tmp = (t / (t + x)) * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 1.25e+126) {
tmp = (z + a) - b;
} else {
tmp = (t / (t + x)) * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= 1.25e+126: tmp = (z + a) - b else: tmp = (t / (t + x)) * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= 1.25e+126) tmp = Float64(Float64(z + a) - b); else tmp = Float64(Float64(t / Float64(t + x)) * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= 1.25e+126) tmp = (z + a) - b; else tmp = (t / (t + x)) * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 1.25e+126], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.25 \cdot 10^{+126}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{t + x} \cdot a\\
\end{array}
\end{array}
if t < 1.24999999999999994e126Initial program 63.0%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6459.2
Applied rewrites59.2%
if 1.24999999999999994e126 < t Initial program 51.3%
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-+.f6461.2
Applied rewrites61.2%
Taylor expanded in y around 0
Applied rewrites68.5%
Final simplification60.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -4e+156) (* 1.0 z) (if (<= x 4.8e-98) (- a b) (if (<= x 2.05e+144) (+ z a) (* 1.0 z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -4e+156) {
tmp = 1.0 * z;
} else if (x <= 4.8e-98) {
tmp = a - b;
} else if (x <= 2.05e+144) {
tmp = z + a;
} else {
tmp = 1.0 * z;
}
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 <= (-4d+156)) then
tmp = 1.0d0 * z
else if (x <= 4.8d-98) then
tmp = a - b
else if (x <= 2.05d+144) then
tmp = z + a
else
tmp = 1.0d0 * z
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 <= -4e+156) {
tmp = 1.0 * z;
} else if (x <= 4.8e-98) {
tmp = a - b;
} else if (x <= 2.05e+144) {
tmp = z + a;
} else {
tmp = 1.0 * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -4e+156: tmp = 1.0 * z elif x <= 4.8e-98: tmp = a - b elif x <= 2.05e+144: tmp = z + a else: tmp = 1.0 * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -4e+156) tmp = Float64(1.0 * z); elseif (x <= 4.8e-98) tmp = Float64(a - b); elseif (x <= 2.05e+144) tmp = Float64(z + a); else tmp = Float64(1.0 * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -4e+156) tmp = 1.0 * z; elseif (x <= 4.8e-98) tmp = a - b; elseif (x <= 2.05e+144) tmp = z + a; else tmp = 1.0 * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -4e+156], N[(1.0 * z), $MachinePrecision], If[LessEqual[x, 4.8e-98], N[(a - b), $MachinePrecision], If[LessEqual[x, 2.05e+144], N[(z + a), $MachinePrecision], N[(1.0 * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{+156}:\\
\;\;\;\;1 \cdot z\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-98}:\\
\;\;\;\;a - b\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{+144}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;1 \cdot z\\
\end{array}
\end{array}
if x < -3.9999999999999999e156 or 2.05000000000000001e144 < x Initial program 49.2%
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 rewrites56.6%
Taylor expanded in a around inf
Applied rewrites50.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
Applied rewrites88.6%
Taylor expanded in x around inf
Applied rewrites58.4%
if -3.9999999999999999e156 < x < 4.8000000000000001e-98Initial program 66.0%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6465.1
Applied rewrites65.1%
Taylor expanded in z around 0
Applied rewrites55.4%
if 4.8000000000000001e-98 < x < 2.05000000000000001e144Initial program 67.3%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6453.7
Applied rewrites53.7%
Taylor expanded in b around 0
Applied rewrites62.5%
Final simplification57.7%
(FPCore (x y z t a b) :precision binary64 (if (<= t 2.7e+127) (- (+ z a) b) (fma (/ z t) y a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 2.7e+127) {
tmp = (z + a) - b;
} else {
tmp = fma((z / t), y, a);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= 2.7e+127) tmp = Float64(Float64(z + a) - b); else tmp = fma(Float64(z / t), y, a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 2.7e+127], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(z / t), $MachinePrecision] * y + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.7 \cdot 10^{+127}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, y, a\right)\\
\end{array}
\end{array}
if t < 2.7000000000000002e127Initial program 63.2%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6459.0
Applied rewrites59.0%
if 2.7000000000000002e127 < t Initial program 50.0%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites61.5%
Taylor expanded in x around 0
Applied rewrites75.2%
Taylor expanded in b around 0
Applied rewrites65.2%
(FPCore (x y z t a b) :precision binary64 (if (<= x -8.4e+156) (* 1.0 z) (if (<= x 9.5e+97) (- (+ z a) b) (* 1.0 z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -8.4e+156) {
tmp = 1.0 * z;
} else if (x <= 9.5e+97) {
tmp = (z + a) - b;
} else {
tmp = 1.0 * z;
}
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 <= (-8.4d+156)) then
tmp = 1.0d0 * z
else if (x <= 9.5d+97) then
tmp = (z + a) - b
else
tmp = 1.0d0 * z
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 <= -8.4e+156) {
tmp = 1.0 * z;
} else if (x <= 9.5e+97) {
tmp = (z + a) - b;
} else {
tmp = 1.0 * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -8.4e+156: tmp = 1.0 * z elif x <= 9.5e+97: tmp = (z + a) - b else: tmp = 1.0 * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -8.4e+156) tmp = Float64(1.0 * z); elseif (x <= 9.5e+97) tmp = Float64(Float64(z + a) - b); else tmp = Float64(1.0 * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -8.4e+156) tmp = 1.0 * z; elseif (x <= 9.5e+97) tmp = (z + a) - b; else tmp = 1.0 * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -8.4e+156], N[(1.0 * z), $MachinePrecision], If[LessEqual[x, 9.5e+97], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(1.0 * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.4 \cdot 10^{+156}:\\
\;\;\;\;1 \cdot z\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+97}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;1 \cdot z\\
\end{array}
\end{array}
if x < -8.39999999999999925e156 or 9.49999999999999975e97 < x Initial program 51.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 rewrites58.5%
Taylor expanded in a around inf
Applied rewrites53.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
Applied rewrites89.6%
Taylor expanded in x around inf
Applied rewrites58.8%
if -8.39999999999999925e156 < x < 9.49999999999999975e97Initial program 66.0%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6462.3
Applied rewrites62.3%
Final simplification61.1%
(FPCore (x y z t a b) :precision binary64 (if (<= t 1.35e+126) (+ z a) (* 1.0 a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 1.35e+126) {
tmp = z + a;
} 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 <= 1.35d+126) then
tmp = z + a
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 <= 1.35e+126) {
tmp = z + a;
} else {
tmp = 1.0 * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= 1.35e+126: tmp = z + a else: tmp = 1.0 * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= 1.35e+126) tmp = Float64(z + a); 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 <= 1.35e+126) tmp = z + a; else tmp = 1.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 1.35e+126], N[(z + a), $MachinePrecision], N[(1.0 * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.35 \cdot 10^{+126}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;1 \cdot a\\
\end{array}
\end{array}
if t < 1.35000000000000001e126Initial program 63.0%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6459.2
Applied rewrites59.2%
Taylor expanded in b around 0
Applied rewrites54.2%
if 1.35000000000000001e126 < t Initial program 51.3%
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 rewrites80.5%
Taylor expanded in a around inf
Applied rewrites79.8%
Taylor expanded in t around inf
Applied rewrites56.1%
(FPCore (x y z t a b) :precision binary64 (if (<= b 5.6e+43) (+ z a) (- z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 5.6e+43) {
tmp = z + a;
} else {
tmp = z - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= 5.6d+43) then
tmp = z + a
else
tmp = z - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 5.6e+43) {
tmp = z + a;
} else {
tmp = z - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= 5.6e+43: tmp = z + a else: tmp = z - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 5.6e+43) tmp = Float64(z + a); else tmp = Float64(z - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= 5.6e+43) tmp = z + a; else tmp = z - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 5.6e+43], N[(z + a), $MachinePrecision], N[(z - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5.6 \cdot 10^{+43}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;z - b\\
\end{array}
\end{array}
if b < 5.60000000000000038e43Initial program 61.5%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6457.0
Applied rewrites57.0%
Taylor expanded in b around 0
Applied rewrites58.1%
if 5.60000000000000038e43 < b Initial program 60.4%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6447.1
Applied rewrites47.1%
Taylor expanded in a around 0
Applied rewrites38.7%
(FPCore (x y z t a b) :precision binary64 (if (<= b 6.5e+79) (+ z a) (- a b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 6.5e+79) {
tmp = z + a;
} else {
tmp = a - 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 (b <= 6.5d+79) then
tmp = z + a
else
tmp = a - 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 (b <= 6.5e+79) {
tmp = z + a;
} else {
tmp = a - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= 6.5e+79: tmp = z + a else: tmp = a - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 6.5e+79) tmp = Float64(z + a); else tmp = Float64(a - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= 6.5e+79) tmp = z + a; else tmp = a - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 6.5e+79], N[(z + a), $MachinePrecision], N[(a - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 6.5 \cdot 10^{+79}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;a - b\\
\end{array}
\end{array}
if b < 6.49999999999999954e79Initial program 62.4%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6456.8
Applied rewrites56.8%
Taylor expanded in b around 0
Applied rewrites56.9%
if 6.49999999999999954e79 < b Initial program 56.0%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6445.9
Applied rewrites45.9%
Taylor expanded in z around 0
Applied rewrites39.8%
(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 61.2%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6454.8
Applied rewrites54.8%
Taylor expanded in b around 0
Applied rewrites52.1%
(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 61.2%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6454.8
Applied rewrites54.8%
Taylor expanded in b around inf
Applied rewrites11.8%
(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 2024268
(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)))