
(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 13 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 x)))
(t_2 (/ (- (+ (* (+ t y) a) (* z (+ y x))) (* b y)) (+ (+ t x) y))))
(if (<= t_2 (- INFINITY))
(fma y (/ (- z b) (+ t y)) a)
(if (<= t_2 1e+307)
t_2
(*
(- (/ (fma (+ y x) (/ z t_1) (* (/ a t_1) (+ t y))) b) (/ y t_1))
b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (y + x);
double t_2 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / ((t + x) + y);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = fma(y, ((z - b) / (t + y)), a);
} else if (t_2 <= 1e+307) {
tmp = t_2;
} else {
tmp = ((fma((y + x), (z / t_1), ((a / t_1) * (t + y))) / b) - (y / t_1)) * b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(y + x)) t_2 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(z * Float64(y + x))) - Float64(b * y)) / Float64(Float64(t + x) + y)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a); elseif (t_2 <= 1e+307) tmp = t_2; else tmp = Float64(Float64(Float64(fma(Float64(y + x), Float64(z / t_1), Float64(Float64(a / t_1) * Float64(t + y))) / b) - Float64(y / t_1)) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, If[LessEqual[t$95$2, (-Infinity)], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t$95$2, 1e+307], t$95$2, N[(N[(N[(N[(N[(y + x), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision] + N[(N[(a / t$95$1), $MachinePrecision] * N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] - N[(y / t$95$1), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(y + x\right)\\
t_2 := \frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{\left(t + x\right) + y}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+307}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\mathsf{fma}\left(y + x, \frac{z}{t\_1}, \frac{a}{t\_1} \cdot \left(t + y\right)\right)}{b} - \frac{y}{t\_1}\right) \cdot b\\
\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.0Initial program 6.4%
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-+.f6417.5
Applied rewrites17.5%
Taylor expanded in a around 0
Applied rewrites76.1%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.99999999999999986e306Initial program 99.7%
if 9.99999999999999986e306 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 4.3%
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 rewrites86.0%
Final simplification92.5%
(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+278) 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+278) {
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+278) 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+278], 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^{+278}:\\
\;\;\;\;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 9.99999999999999964e277 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 7.6%
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-+.f6415.3
Applied rewrites15.3%
Taylor expanded in a around 0
Applied rewrites77.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)) < 9.99999999999999964e277Initial program 99.7%
Final simplification90.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ t x) y))
(t_2 (* (+ t y) a))
(t_3 (/ (- (+ t_2 (* z (+ y x))) (* b y)) t_1)))
(if (<= t_3 -1e+259)
(- (+ a z) b)
(if (<= t_3 1e+230)
(/ (fma (+ y x) z t_2) t_1)
(fma y (/ (- z b) (+ t y)) a)))))
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;
double t_3 = ((t_2 + (z * (y + x))) - (b * y)) / t_1;
double tmp;
if (t_3 <= -1e+259) {
tmp = (a + z) - b;
} else if (t_3 <= 1e+230) {
tmp = fma((y + x), z, t_2) / t_1;
} else {
tmp = fma(y, ((z - b) / (t + y)), a);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + x) + y) t_2 = Float64(Float64(t + y) * a) t_3 = Float64(Float64(Float64(t_2 + Float64(z * Float64(y + x))) - Float64(b * y)) / t_1) tmp = 0.0 if (t_3 <= -1e+259) tmp = Float64(Float64(a + z) - b); elseif (t_3 <= 1e+230) tmp = Float64(fma(Float64(y + x), z, t_2) / t_1); else tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a); 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[(t + y), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, -1e+259], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[t$95$3, 1e+230], N[(N[(N[(y + x), $MachinePrecision] * z + t$95$2), $MachinePrecision] / t$95$1), $MachinePrecision], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + x\right) + y\\
t_2 := \left(t + y\right) \cdot a\\
t_3 := \frac{\left(t\_2 + z \cdot \left(y + x\right)\right) - b \cdot y}{t\_1}\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{+259}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{elif}\;t\_3 \leq 10^{+230}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y + x, z, t\_2\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\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)) < -9.999999999999999e258Initial program 12.9%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6475.8
Applied rewrites75.8%
if -9.999999999999999e258 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.0000000000000001e230Initial program 99.8%
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-+.f6480.8
Applied rewrites80.8%
if 1.0000000000000001e230 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 13.2%
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-+.f6418.6
Applied rewrites18.6%
Taylor expanded in a around 0
Applied rewrites77.8%
Final simplification79.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma y (/ (- z b) (+ t y)) a)))
(if (<= y -7.4e-93)
t_1
(if (<= y 2e-98) (/ (- (fma x z (* a t)) (* b y)) (+ (+ 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 <= -7.4e-93) {
tmp = t_1;
} else if (y <= 2e-98) {
tmp = (fma(x, z, (a * t)) - (b * y)) / ((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 <= -7.4e-93) tmp = t_1; elseif (y <= 2e-98) tmp = Float64(Float64(fma(x, z, Float64(a * t)) - Float64(b * y)) / 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, -7.4e-93], t$95$1, If[LessEqual[y, 2e-98], N[(N[(N[(x * z + N[(a * t), $MachinePrecision]), $MachinePrecision] - N[(b * y), $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 -7.4 \cdot 10^{-93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-98}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, z, a \cdot t\right) - b \cdot y}{\left(t + x\right) + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.40000000000000005e-93 or 1.99999999999999988e-98 < y Initial program 50.1%
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-+.f6446.7
Applied rewrites46.7%
Taylor expanded in a around 0
Applied rewrites80.4%
if -7.40000000000000005e-93 < y < 1.99999999999999988e-98Initial program 81.5%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6478.1
Applied rewrites78.1%
Final simplification79.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma y (/ (- z b) (+ t y)) a)))
(if (<= y -3.7e-19)
t_1
(if (<= y -1.8e-167)
(+ a z)
(if (<= y 4.2e-101) (/ (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 <= -3.7e-19) {
tmp = t_1;
} else if (y <= -1.8e-167) {
tmp = a + z;
} else if (y <= 4.2e-101) {
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 <= -3.7e-19) tmp = t_1; elseif (y <= -1.8e-167) tmp = Float64(a + z); elseif (y <= 4.2e-101) 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, -3.7e-19], t$95$1, If[LessEqual[y, -1.8e-167], N[(a + z), $MachinePrecision], If[LessEqual[y, 4.2e-101], 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 -3.7 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{-167}:\\
\;\;\;\;a + z\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-101}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, z, a \cdot t\right)}{t + x}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.70000000000000005e-19 or 4.20000000000000031e-101 < y Initial program 49.8%
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-+.f6446.8
Applied rewrites46.8%
Taylor expanded in a around 0
Applied rewrites82.7%
if -3.70000000000000005e-19 < y < -1.8e-167Initial program 62.5%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6456.2
Applied rewrites56.2%
Taylor expanded in b around 0
Applied rewrites65.8%
if -1.8e-167 < y < 4.20000000000000031e-101Initial program 84.9%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6473.5
Applied rewrites73.5%
Final simplification78.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b)))
(if (<= y -3.7e+134)
t_1
(if (<= y -1.22e-172)
(+ a z)
(if (<= y 4.5e-22) (* (/ t (+ t x)) a) 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 <= -3.7e+134) {
tmp = t_1;
} else if (y <= -1.22e-172) {
tmp = a + z;
} else if (y <= 4.5e-22) {
tmp = (t / (t + x)) * a;
} 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 <= (-3.7d+134)) then
tmp = t_1
else if (y <= (-1.22d-172)) then
tmp = a + z
else if (y <= 4.5d-22) then
tmp = (t / (t + x)) * a
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 <= -3.7e+134) {
tmp = t_1;
} else if (y <= -1.22e-172) {
tmp = a + z;
} else if (y <= 4.5e-22) {
tmp = (t / (t + x)) * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + z) - b tmp = 0 if y <= -3.7e+134: tmp = t_1 elif y <= -1.22e-172: tmp = a + z elif y <= 4.5e-22: tmp = (t / (t + x)) * a 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 <= -3.7e+134) tmp = t_1; elseif (y <= -1.22e-172) tmp = Float64(a + z); elseif (y <= 4.5e-22) tmp = Float64(Float64(t / Float64(t + x)) * a); 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 <= -3.7e+134) tmp = t_1; elseif (y <= -1.22e-172) tmp = a + z; elseif (y <= 4.5e-22) tmp = (t / (t + x)) * a; 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, -3.7e+134], t$95$1, If[LessEqual[y, -1.22e-172], N[(a + z), $MachinePrecision], If[LessEqual[y, 4.5e-22], N[(N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -3.7 \cdot 10^{+134}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.22 \cdot 10^{-172}:\\
\;\;\;\;a + z\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-22}:\\
\;\;\;\;\frac{t}{t + x} \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.70000000000000013e134 or 4.49999999999999987e-22 < y Initial program 45.3%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6480.8
Applied rewrites80.8%
if -3.70000000000000013e134 < y < -1.22e-172Initial program 60.9%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6450.9
Applied rewrites50.9%
Taylor expanded in b around 0
Applied rewrites59.0%
if -1.22e-172 < y < 4.49999999999999987e-22Initial program 82.4%
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-+.f6439.7
Applied rewrites39.7%
Taylor expanded in y around 0
Applied rewrites50.6%
Final simplification66.5%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.1e+131) (+ a z) (if (<= x 2.65e+135) (fma y (/ (- z b) (+ t y)) a) (/ 1.0 (/ 1.0 z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.1e+131) {
tmp = a + z;
} else if (x <= 2.65e+135) {
tmp = fma(y, ((z - b) / (t + y)), a);
} else {
tmp = 1.0 / (1.0 / z);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.1e+131) tmp = Float64(a + z); elseif (x <= 2.65e+135) tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a); else tmp = Float64(1.0 / Float64(1.0 / z)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.1e+131], N[(a + z), $MachinePrecision], If[LessEqual[x, 2.65e+135], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[(1.0 / N[(1.0 / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{+131}:\\
\;\;\;\;a + z\\
\mathbf{elif}\;x \leq 2.65 \cdot 10^{+135}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{z}}\\
\end{array}
\end{array}
if x < -1.0999999999999999e131Initial program 45.0%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6441.1
Applied rewrites41.1%
Taylor expanded in b around 0
Applied rewrites61.8%
if -1.0999999999999999e131 < x < 2.65000000000000008e135Initial program 66.4%
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-+.f6452.7
Applied rewrites52.7%
Taylor expanded in a around 0
Applied rewrites82.1%
if 2.65000000000000008e135 < x Initial program 39.8%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6439.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6439.8
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f6440.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6440.5
Applied rewrites40.5%
Taylor expanded in x around inf
lower-/.f6450.8
Applied rewrites50.8%
Final simplification75.3%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.9e+97) (fma (/ (- z b) t) y a) (if (<= t 4.6e+147) (- (+ a z) b) (fma y (/ z (+ t y)) a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.9e+97) {
tmp = fma(((z - b) / t), y, a);
} else if (t <= 4.6e+147) {
tmp = (a + z) - b;
} else {
tmp = fma(y, (z / (t + y)), a);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.9e+97) tmp = fma(Float64(Float64(z - b) / t), y, a); elseif (t <= 4.6e+147) tmp = Float64(Float64(a + z) - b); else tmp = fma(y, Float64(z / Float64(t + y)), a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.9e+97], N[(N[(N[(z - b), $MachinePrecision] / t), $MachinePrecision] * y + a), $MachinePrecision], If[LessEqual[t, 4.6e+147], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(y * N[(z / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.9 \cdot 10^{+97}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - b}{t}, y, a\right)\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{+147}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{t + y}, a\right)\\
\end{array}
\end{array}
if t < -3.8999999999999999e97Initial program 67.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-+.f6453.9
Applied rewrites53.9%
Taylor expanded in a around 0
Applied rewrites81.6%
Taylor expanded in y around 0
Applied rewrites76.0%
if -3.8999999999999999e97 < t < 4.5999999999999998e147Initial program 59.6%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6465.1
Applied rewrites65.1%
if 4.5999999999999998e147 < t Initial program 54.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-+.f6447.5
Applied rewrites47.5%
Taylor expanded in a around 0
Applied rewrites89.2%
Taylor expanded in b around 0
Applied rewrites83.7%
Final simplification69.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (fma y (/ z (+ t y)) a))) (if (<= t -2.3e+80) t_1 (if (<= t 4.6e+147) (- (+ a z) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(y, (z / (t + y)), a);
double tmp;
if (t <= -2.3e+80) {
tmp = t_1;
} else if (t <= 4.6e+147) {
tmp = (a + z) - b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(y, Float64(z / Float64(t + y)), a) tmp = 0.0 if (t <= -2.3e+80) tmp = t_1; elseif (t <= 4.6e+147) 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[(y * N[(z / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]}, If[LessEqual[t, -2.3e+80], t$95$1, If[LessEqual[t, 4.6e+147], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{z}{t + y}, a\right)\\
\mathbf{if}\;t \leq -2.3 \cdot 10^{+80}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{+147}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.30000000000000004e80 or 4.5999999999999998e147 < t Initial program 62.6%
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.4
Applied rewrites50.4%
Taylor expanded in a around 0
Applied rewrites83.7%
Taylor expanded in b around 0
Applied rewrites72.0%
if -2.30000000000000004e80 < t < 4.5999999999999998e147Initial program 59.0%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6465.7
Applied rewrites65.7%
Final simplification67.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (- (+ a z) b))) (if (<= y -3.7e+134) t_1 (if (<= y 1.35e-18) (+ 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 <= -3.7e+134) {
tmp = t_1;
} else if (y <= 1.35e-18) {
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 <= (-3.7d+134)) then
tmp = t_1
else if (y <= 1.35d-18) 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 <= -3.7e+134) {
tmp = t_1;
} else if (y <= 1.35e-18) {
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 <= -3.7e+134: tmp = t_1 elif y <= 1.35e-18: 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 <= -3.7e+134) tmp = t_1; elseif (y <= 1.35e-18) 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 <= -3.7e+134) tmp = t_1; elseif (y <= 1.35e-18) 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, -3.7e+134], t$95$1, If[LessEqual[y, 1.35e-18], N[(a + z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -3.7 \cdot 10^{+134}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-18}:\\
\;\;\;\;a + z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.70000000000000013e134 or 1.34999999999999994e-18 < y Initial program 44.9%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6481.5
Applied rewrites81.5%
if -3.70000000000000013e134 < y < 1.34999999999999994e-18Initial program 72.9%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6437.8
Applied rewrites37.8%
Taylor expanded in b around 0
Applied rewrites49.1%
Final simplification63.8%
(FPCore (x y z t a b) :precision binary64 (if (<= b -2.3e+195) (- a b) (if (<= b 2.3e+148) (+ a z) (- a b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.3e+195) {
tmp = a - b;
} else if (b <= 2.3e+148) {
tmp = a + z;
} 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 <= (-2.3d+195)) then
tmp = a - b
else if (b <= 2.3d+148) then
tmp = a + z
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 <= -2.3e+195) {
tmp = a - b;
} else if (b <= 2.3e+148) {
tmp = a + z;
} else {
tmp = a - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -2.3e+195: tmp = a - b elif b <= 2.3e+148: tmp = a + z else: tmp = a - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2.3e+195) tmp = Float64(a - b); elseif (b <= 2.3e+148) tmp = Float64(a + z); else tmp = Float64(a - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -2.3e+195) tmp = a - b; elseif (b <= 2.3e+148) tmp = a + z; else tmp = a - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.3e+195], N[(a - b), $MachinePrecision], If[LessEqual[b, 2.3e+148], N[(a + z), $MachinePrecision], N[(a - b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.3 \cdot 10^{+195}:\\
\;\;\;\;a - b\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{+148}:\\
\;\;\;\;a + z\\
\mathbf{else}:\\
\;\;\;\;a - b\\
\end{array}
\end{array}
if b < -2.3000000000000001e195 or 2.3000000000000001e148 < b Initial program 32.7%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6446.6
Applied rewrites46.6%
Taylor expanded in z around 0
Applied rewrites45.9%
if -2.3000000000000001e195 < b < 2.3000000000000001e148Initial program 67.4%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6460.4
Applied rewrites60.4%
Taylor expanded in b around 0
Applied rewrites62.2%
Final simplification58.8%
(FPCore (x y z t a b) :precision binary64 (if (<= b -1.15e+196) (- b) (if (<= b 1.6e+160) (+ a z) (- b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.15e+196) {
tmp = -b;
} else if (b <= 1.6e+160) {
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 <= (-1.15d+196)) then
tmp = -b
else if (b <= 1.6d+160) 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 <= -1.15e+196) {
tmp = -b;
} else if (b <= 1.6e+160) {
tmp = a + z;
} else {
tmp = -b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.15e+196: tmp = -b elif b <= 1.6e+160: tmp = a + z else: tmp = -b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.15e+196) tmp = Float64(-b); elseif (b <= 1.6e+160) 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 <= -1.15e+196) tmp = -b; elseif (b <= 1.6e+160) tmp = a + z; else tmp = -b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.15e+196], (-b), If[LessEqual[b, 1.6e+160], N[(a + z), $MachinePrecision], (-b)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.15 \cdot 10^{+196}:\\
\;\;\;\;-b\\
\mathbf{elif}\;b \leq 1.6 \cdot 10^{+160}:\\
\;\;\;\;a + z\\
\mathbf{else}:\\
\;\;\;\;-b\\
\end{array}
\end{array}
if b < -1.1499999999999999e196 or 1.5999999999999999e160 < b Initial program 32.4%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6445.3
Applied rewrites45.3%
Taylor expanded in b around inf
Applied rewrites38.7%
if -1.1499999999999999e196 < b < 1.5999999999999999e160Initial program 66.9%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6460.6
Applied rewrites60.6%
Taylor expanded in b around 0
Applied rewrites62.3%
Final simplification57.7%
(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 60.2%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6457.6
Applied rewrites57.6%
Taylor expanded in b around inf
Applied rewrites12.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 2024277
(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)))