
(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 15 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 (/ (- (+ (* (+ t y) a) (* z (+ y x))) (* b y)) (+ (+ t x) y)))
(t_2 (fma y (/ (- z b) (+ t y)) a)))
(if (<= t_1 (- INFINITY)) t_2 (if (<= t_1 1e+294) t_1 t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / ((t + x) + y);
double t_2 = fma(y, ((z - b) / (t + y)), a);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= 1e+294) {
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(z * Float64(y + x))) - Float64(b * y)) / Float64(Float64(t + x) + y)) t_2 = fma(y, Float64(Float64(z - b) / Float64(t + y)), a) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= 1e+294) tmp = t_1; 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[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, 1e+294], t$95$1, t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{\left(t + x\right) + y}\\
t_2 := \mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+294}:\\
\;\;\;\;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)) < -inf.0 or 1.00000000000000007e294 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.3%
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-+.f6410.3
Applied rewrites10.3%
Taylor expanded in a around 0
Applied rewrites81.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.00000000000000007e294Initial program 99.7%
Final simplification92.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ t y) a) (* z (+ y x))) (* b y)) (+ (+ t x) y)))
(t_2 (fma y (/ (- z b) (+ t y)) a)))
(if (<= t_1 (- INFINITY))
t_2
(if (<= t_1 1e+294)
(fma 1.0 a (/ (fma x z (* (- z b) y)) (+ t (+ y x))))
t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / ((t + x) + y);
double t_2 = fma(y, ((z - b) / (t + y)), a);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= 1e+294) {
tmp = fma(1.0, a, (fma(x, z, ((z - b) * y)) / (t + (y + 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(z * Float64(y + x))) - Float64(b * y)) / Float64(Float64(t + x) + y)) t_2 = fma(y, Float64(Float64(z - b) / Float64(t + y)), a) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= 1e+294) tmp = fma(1.0, a, Float64(fma(x, z, Float64(Float64(z - b) * y)) / Float64(t + Float64(y + 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[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, 1e+294], N[(1.0 * a + N[(N[(x * z + N[(N[(z - b), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{\left(t + x\right) + y}\\
t_2 := \mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+294}:\\
\;\;\;\;\mathsf{fma}\left(1, a, \frac{\mathsf{fma}\left(x, z, \left(z - b\right) \cdot y\right)}{t + \left(y + x\right)}\right)\\
\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)) < -inf.0 or 1.00000000000000007e294 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.3%
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-+.f6410.3
Applied rewrites10.3%
Taylor expanded in a around 0
Applied rewrites81.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.00000000000000007e294Initial 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.6%
Taylor expanded in t around inf
Applied rewrites81.7%
Final simplification81.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma y (/ (- z b) (+ t y)) a)))
(if (<= y -5e-118)
t_1
(if (<= y 6e-137) (/ (fma (+ y x) z (* (+ t y) a)) (+ (+ t x) y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(y, ((z - b) / (t + y)), a);
double tmp;
if (y <= -5e-118) {
tmp = t_1;
} else if (y <= 6e-137) {
tmp = fma((y + x), z, ((t + y) * a)) / ((t + x) + y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(y, Float64(Float64(z - b) / Float64(t + y)), a) tmp = 0.0 if (y <= -5e-118) tmp = t_1; elseif (y <= 6e-137) tmp = Float64(fma(Float64(y + x), z, Float64(Float64(t + y) * a)) / Float64(Float64(t + x) + y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]}, If[LessEqual[y, -5e-118], t$95$1, If[LessEqual[y, 6e-137], N[(N[(N[(y + x), $MachinePrecision] * z + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\mathbf{if}\;y \leq -5 \cdot 10^{-118}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-137}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y + x, z, \left(t + y\right) \cdot a\right)}{\left(t + x\right) + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.00000000000000015e-118 or 5.9999999999999996e-137 < y Initial program 53.9%
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-+.f6448.6
Applied rewrites48.6%
Taylor expanded in a around 0
Applied rewrites81.7%
if -5.00000000000000015e-118 < y < 5.9999999999999996e-137Initial program 83.6%
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-+.f6475.4
Applied rewrites75.4%
Final simplification79.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma y (/ (- z b) (+ t y)) a)))
(if (<= y -4.3e-118)
t_1
(if (<= y 3.6e-138) (/ (fma x z (* a t)) (+ t x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(y, ((z - b) / (t + y)), a);
double tmp;
if (y <= -4.3e-118) {
tmp = t_1;
} else if (y <= 3.6e-138) {
tmp = fma(x, z, (a * t)) / (t + x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(y, Float64(Float64(z - b) / Float64(t + y)), a) tmp = 0.0 if (y <= -4.3e-118) tmp = t_1; elseif (y <= 3.6e-138) tmp = Float64(fma(x, z, Float64(a * t)) / Float64(t + x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]}, If[LessEqual[y, -4.3e-118], t$95$1, If[LessEqual[y, 3.6e-138], N[(N[(x * z + N[(a * t), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\mathbf{if}\;y \leq -4.3 \cdot 10^{-118}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{-138}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, z, a \cdot t\right)}{t + x}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.30000000000000018e-118 or 3.60000000000000018e-138 < y Initial program 53.9%
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-+.f6448.6
Applied rewrites48.6%
Taylor expanded in a around 0
Applied rewrites81.7%
if -4.30000000000000018e-118 < y < 3.60000000000000018e-138Initial program 83.6%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6474.5
Applied rewrites74.5%
Final simplification79.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -4.4e+252)
(- z (* (/ (- b a) x) y))
(if (<= x 3.3e+31)
(fma y (/ (- z b) (+ t y)) a)
(- z (* (- a) (/ (+ t y) x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -4.4e+252) {
tmp = z - (((b - a) / x) * y);
} else if (x <= 3.3e+31) {
tmp = fma(y, ((z - b) / (t + y)), a);
} else {
tmp = z - (-a * ((t + y) / x));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -4.4e+252) tmp = Float64(z - Float64(Float64(Float64(b - a) / x) * y)); elseif (x <= 3.3e+31) tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a); else tmp = Float64(z - Float64(Float64(-a) * Float64(Float64(t + y) / x))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -4.4e+252], N[(z - N[(N[(N[(b - a), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.3e+31], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[(z - N[((-a) * N[(N[(t + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{+252}:\\
\;\;\;\;z - \frac{b - a}{x} \cdot y\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+31}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\mathbf{else}:\\
\;\;\;\;z - \left(-a\right) \cdot \frac{t + y}{x}\\
\end{array}
\end{array}
if x < -4.4000000000000001e252Initial program 27.5%
Taylor expanded in x around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites64.2%
Taylor expanded in y around inf
Applied rewrites87.6%
if -4.4000000000000001e252 < x < 3.29999999999999992e31Initial program 63.3%
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-+.f6450.3
Applied rewrites50.3%
Taylor expanded in a around 0
Applied rewrites79.4%
if 3.29999999999999992e31 < x Initial program 66.6%
Taylor expanded in x around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites61.7%
Taylor expanded in a around -inf
Applied rewrites66.5%
Final simplification77.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -4.4e+252)
(- z (* (/ (- b a) x) y))
(if (<= x 3.3e+31)
(fma y (/ (- z b) (+ t y)) a)
(- z (* (/ (- z a) x) t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -4.4e+252) {
tmp = z - (((b - a) / x) * y);
} else if (x <= 3.3e+31) {
tmp = fma(y, ((z - b) / (t + y)), a);
} else {
tmp = z - (((z - a) / x) * t);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -4.4e+252) tmp = Float64(z - Float64(Float64(Float64(b - a) / x) * y)); elseif (x <= 3.3e+31) tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a); else tmp = Float64(z - Float64(Float64(Float64(z - a) / x) * t)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -4.4e+252], N[(z - N[(N[(N[(b - a), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.3e+31], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[(z - N[(N[(N[(z - a), $MachinePrecision] / x), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{+252}:\\
\;\;\;\;z - \frac{b - a}{x} \cdot y\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+31}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\mathbf{else}:\\
\;\;\;\;z - \frac{z - a}{x} \cdot t\\
\end{array}
\end{array}
if x < -4.4000000000000001e252Initial program 27.5%
Taylor expanded in x around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites64.2%
Taylor expanded in y around inf
Applied rewrites87.6%
if -4.4000000000000001e252 < x < 3.29999999999999992e31Initial program 63.3%
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-+.f6450.3
Applied rewrites50.3%
Taylor expanded in a around 0
Applied rewrites79.4%
if 3.29999999999999992e31 < x Initial program 66.6%
Taylor expanded in x around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites61.7%
Taylor expanded in t around inf
Applied rewrites63.3%
Final simplification76.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (fma (/ (- z b) t) y a))) (if (<= t -1.3e+141) t_1 (if (<= t 3.7e+121) (- (+ a z) 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 <= -1.3e+141) {
tmp = t_1;
} else if (t <= 3.7e+121) {
tmp = (a + z) - 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 <= -1.3e+141) tmp = t_1; elseif (t <= 3.7e+121) tmp = Float64(Float64(a + z) - 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, -1.3e+141], t$95$1, If[LessEqual[t, 3.7e+121], N[(N[(a + z), $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 -1.3 \cdot 10^{+141}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{+121}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.3e141 or 3.70000000000000013e121 < t Initial program 49.5%
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-+.f6439.6
Applied rewrites39.6%
Taylor expanded in a around 0
Applied rewrites80.2%
Taylor expanded in y around 0
Applied rewrites73.1%
if -1.3e141 < t < 3.70000000000000013e121Initial program 69.2%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6461.9
Applied rewrites61.9%
Final simplification65.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (- (+ a z) b))) (if (<= y -1.36e-98) t_1 (if (<= y 9e-149) (* (/ z (+ t x)) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + z) - b;
double tmp;
if (y <= -1.36e-98) {
tmp = t_1;
} else if (y <= 9e-149) {
tmp = (z / (t + x)) * x;
} 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 + z) - b
if (y <= (-1.36d-98)) then
tmp = t_1
else if (y <= 9d-149) then
tmp = (z / (t + x)) * x
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 + z) - b;
double tmp;
if (y <= -1.36e-98) {
tmp = t_1;
} else if (y <= 9e-149) {
tmp = (z / (t + x)) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + z) - b tmp = 0 if y <= -1.36e-98: tmp = t_1 elif y <= 9e-149: tmp = (z / (t + x)) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + z) - b) tmp = 0.0 if (y <= -1.36e-98) tmp = t_1; elseif (y <= 9e-149) tmp = Float64(Float64(z / Float64(t + x)) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + z) - b; tmp = 0.0; if (y <= -1.36e-98) tmp = t_1; elseif (y <= 9e-149) tmp = (z / (t + x)) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.36e-98], t$95$1, If[LessEqual[y, 9e-149], N[(N[(z / N[(t + x), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -1.36 \cdot 10^{-98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-149}:\\
\;\;\;\;\frac{z}{t + x} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.36000000000000003e-98 or 8.9999999999999996e-149 < y Initial program 53.4%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6467.8
Applied rewrites67.8%
if -1.36000000000000003e-98 < y < 8.9999999999999996e-149Initial program 82.5%
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-+.f6438.6
Applied rewrites38.6%
Taylor expanded in y around 0
Applied rewrites37.9%
Final simplification58.1%
(FPCore (x y z t a b) :precision binary64 (if (<= x 1e+29) (- (+ a z) b) (- z (/ (* b y) x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 1e+29) {
tmp = (a + z) - b;
} else {
tmp = z - ((b * y) / x);
}
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 <= 1d+29) then
tmp = (a + z) - b
else
tmp = z - ((b * y) / x)
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 <= 1e+29) {
tmp = (a + z) - b;
} else {
tmp = z - ((b * y) / x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 1e+29: tmp = (a + z) - b else: tmp = z - ((b * y) / x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 1e+29) tmp = Float64(Float64(a + z) - b); else tmp = Float64(z - Float64(Float64(b * y) / x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 1e+29) tmp = (a + z) - b; else tmp = z - ((b * y) / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 1e+29], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(z - N[(N[(b * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{+29}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;z - \frac{b \cdot y}{x}\\
\end{array}
\end{array}
if x < 9.99999999999999914e28Initial program 61.9%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6458.2
Applied rewrites58.2%
if 9.99999999999999914e28 < x Initial program 66.6%
Taylor expanded in x around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites61.7%
Taylor expanded in b around inf
Applied rewrites52.4%
Final simplification57.0%
(FPCore (x y z t a b) :precision binary64 (if (<= x 1.05e+157) (- (+ a z) b) (- z (* (/ z x) t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 1.05e+157) {
tmp = (a + z) - b;
} else {
tmp = z - ((z / x) * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= 1.05d+157) then
tmp = (a + z) - b
else
tmp = z - ((z / x) * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 1.05e+157) {
tmp = (a + z) - b;
} else {
tmp = z - ((z / x) * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 1.05e+157: tmp = (a + z) - b else: tmp = z - ((z / x) * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 1.05e+157) tmp = Float64(Float64(a + z) - b); else tmp = Float64(z - Float64(Float64(z / x) * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 1.05e+157) tmp = (a + z) - b; else tmp = z - ((z / x) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 1.05e+157], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(z - N[(N[(z / x), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.05 \cdot 10^{+157}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;z - \frac{z}{x} \cdot t\\
\end{array}
\end{array}
if x < 1.05e157Initial program 64.2%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6456.1
Applied rewrites56.1%
if 1.05e157 < x Initial program 50.1%
Taylor expanded in x around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites72.8%
Taylor expanded in z around inf
Applied rewrites61.3%
Final simplification56.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (- (+ a z) b))) (if (<= y -5.5e-83) t_1 (if (<= y 2.35e-88) (+ a z) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + z) - b;
double tmp;
if (y <= -5.5e-83) {
tmp = t_1;
} else if (y <= 2.35e-88) {
tmp = a + z;
} 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 + z) - b
if (y <= (-5.5d-83)) then
tmp = t_1
else if (y <= 2.35d-88) then
tmp = a + z
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 + z) - b;
double tmp;
if (y <= -5.5e-83) {
tmp = t_1;
} else if (y <= 2.35e-88) {
tmp = a + z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + z) - b tmp = 0 if y <= -5.5e-83: tmp = t_1 elif y <= 2.35e-88: tmp = a + z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + z) - b) tmp = 0.0 if (y <= -5.5e-83) tmp = t_1; elseif (y <= 2.35e-88) tmp = Float64(a + z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + z) - b; tmp = 0.0; if (y <= -5.5e-83) tmp = t_1; elseif (y <= 2.35e-88) tmp = a + z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -5.5e-83], t$95$1, If[LessEqual[y, 2.35e-88], N[(a + z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -5.5 \cdot 10^{-83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.35 \cdot 10^{-88}:\\
\;\;\;\;a + z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.49999999999999964e-83 or 2.35e-88 < y Initial program 51.1%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6469.2
Applied rewrites69.2%
if -5.49999999999999964e-83 < y < 2.35e-88Initial program 82.1%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6428.9
Applied rewrites28.9%
Taylor expanded in b around 0
Applied rewrites40.0%
Final simplification58.1%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2e-51) (- z b) (if (<= z 2.85e-116) (- a b) (+ a z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2e-51) {
tmp = z - b;
} else if (z <= 2.85e-116) {
tmp = a - b;
} else {
tmp = a + 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 (z <= (-2d-51)) then
tmp = z - b
else if (z <= 2.85d-116) then
tmp = a - b
else
tmp = a + 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 (z <= -2e-51) {
tmp = z - b;
} else if (z <= 2.85e-116) {
tmp = a - b;
} else {
tmp = a + z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2e-51: tmp = z - b elif z <= 2.85e-116: tmp = a - b else: tmp = a + z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2e-51) tmp = Float64(z - b); elseif (z <= 2.85e-116) tmp = Float64(a - b); else tmp = Float64(a + z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2e-51) tmp = z - b; elseif (z <= 2.85e-116) tmp = a - b; else tmp = a + z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2e-51], N[(z - b), $MachinePrecision], If[LessEqual[z, 2.85e-116], N[(a - b), $MachinePrecision], N[(a + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-51}:\\
\;\;\;\;z - b\\
\mathbf{elif}\;z \leq 2.85 \cdot 10^{-116}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;a + z\\
\end{array}
\end{array}
if z < -2e-51Initial program 65.9%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6451.6
Applied rewrites51.6%
Taylor expanded in a around 0
Applied rewrites46.8%
if -2e-51 < z < 2.8499999999999998e-116Initial program 66.8%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6460.6
Applied rewrites60.6%
Taylor expanded in z around 0
Applied rewrites58.5%
if 2.8499999999999998e-116 < z Initial program 54.4%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6446.6
Applied rewrites46.6%
Taylor expanded in b around 0
Applied rewrites51.2%
Final simplification53.1%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.3e-52) (+ a z) (if (<= z 2.85e-116) (- a b) (+ a z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.3e-52) {
tmp = a + z;
} else if (z <= 2.85e-116) {
tmp = a - b;
} else {
tmp = a + 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 (z <= (-2.3d-52)) then
tmp = a + z
else if (z <= 2.85d-116) then
tmp = a - b
else
tmp = a + 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 (z <= -2.3e-52) {
tmp = a + z;
} else if (z <= 2.85e-116) {
tmp = a - b;
} else {
tmp = a + z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.3e-52: tmp = a + z elif z <= 2.85e-116: tmp = a - b else: tmp = a + z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.3e-52) tmp = Float64(a + z); elseif (z <= 2.85e-116) tmp = Float64(a - b); else tmp = Float64(a + z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.3e-52) tmp = a + z; elseif (z <= 2.85e-116) tmp = a - b; else tmp = a + z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.3e-52], N[(a + z), $MachinePrecision], If[LessEqual[z, 2.85e-116], N[(a - b), $MachinePrecision], N[(a + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{-52}:\\
\;\;\;\;a + z\\
\mathbf{elif}\;z \leq 2.85 \cdot 10^{-116}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;a + z\\
\end{array}
\end{array}
if z < -2.29999999999999994e-52 or 2.8499999999999998e-116 < z Initial program 59.9%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6449.0
Applied rewrites49.0%
Taylor expanded in b around 0
Applied rewrites47.3%
if -2.29999999999999994e-52 < z < 2.8499999999999998e-116Initial program 66.8%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6460.6
Applied rewrites60.6%
Taylor expanded in z around 0
Applied rewrites58.5%
Final simplification52.1%
(FPCore (x y z t a b) :precision binary64 (if (<= b 4.8e+206) (+ a z) (- b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 4.8e+206) {
tmp = a + z;
} else {
tmp = -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 <= 4.8d+206) then
tmp = a + z
else
tmp = -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 <= 4.8e+206) {
tmp = a + z;
} else {
tmp = -b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= 4.8e+206: tmp = a + z else: tmp = -b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 4.8e+206) tmp = Float64(a + z); else tmp = Float64(-b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= 4.8e+206) tmp = a + z; else tmp = -b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 4.8e+206], N[(a + z), $MachinePrecision], (-b)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 4.8 \cdot 10^{+206}:\\
\;\;\;\;a + z\\
\mathbf{else}:\\
\;\;\;\;-b\\
\end{array}
\end{array}
if b < 4.7999999999999999e206Initial program 64.5%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6454.3
Applied rewrites54.3%
Taylor expanded in b around 0
Applied rewrites48.8%
if 4.7999999999999999e206 < b Initial program 41.2%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6448.5
Applied rewrites48.5%
Taylor expanded in b around inf
Applied rewrites39.5%
Final simplification48.2%
(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.8%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6453.9
Applied rewrites53.9%
Taylor expanded in b around inf
Applied rewrites16.0%
(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 2024267
(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)))