
(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 14 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 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y))))
(if (or (<= t_1 -1e+175) (not (<= t_1 1e+307)))
(- (+ a z) (* y (/ b (+ (+ t x) y))))
t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
double tmp;
if ((t_1 <= -1e+175) || !(t_1 <= 1e+307)) {
tmp = (a + z) - (y * (b / ((t + x) + y)));
} 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 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
if ((t_1 <= (-1d+175)) .or. (.not. (t_1 <= 1d+307))) then
tmp = (a + z) - (y * (b / ((t + x) + y)))
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 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
double tmp;
if ((t_1 <= -1e+175) || !(t_1 <= 1e+307)) {
tmp = (a + z) - (y * (b / ((t + x) + y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y) tmp = 0 if (t_1 <= -1e+175) or not (t_1 <= 1e+307): tmp = (a + z) - (y * (b / ((t + x) + y))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) tmp = 0.0 if ((t_1 <= -1e+175) || !(t_1 <= 1e+307)) tmp = Float64(Float64(a + z) - Float64(y * Float64(b / Float64(Float64(t + x) + y)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); tmp = 0.0; if ((t_1 <= -1e+175) || ~((t_1 <= 1e+307))) tmp = (a + z) - (y * (b / ((t + x) + y))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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]}, If[Or[LessEqual[t$95$1, -1e+175], N[Not[LessEqual[t$95$1, 1e+307]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - N[(y * N[(b / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+175} \lor \neg \left(t\_1 \leq 10^{+307}\right):\\
\;\;\;\;\left(a + z\right) - y \cdot \frac{b}{\left(t + x\right) + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\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.9999999999999994e174 or 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 12.4%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
associate-/l*N/A
cancel-sign-sub-invN/A
lower-+.f64N/A
Applied rewrites26.9%
Taylor expanded in y around inf
lower-+.f6485.2
Applied rewrites85.2%
if -9.9999999999999994e174 < (/.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.8%
Final simplification93.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_1)))
(if (or (<= t_2 -1e+175) (not (<= t_2 1e+307)))
(- (+ a z) (* y (/ b (+ (+ t x) y))))
(/ (fma (- (+ a z) b) y (fma a t (* z x))) t_1))))
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)) / t_1;
double tmp;
if ((t_2 <= -1e+175) || !(t_2 <= 1e+307)) {
tmp = (a + z) - (y * (b / ((t + x) + y)));
} else {
tmp = fma(((a + z) - b), y, fma(a, t, (z * x))) / t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / t_1) tmp = 0.0 if ((t_2 <= -1e+175) || !(t_2 <= 1e+307)) tmp = Float64(Float64(a + z) - Float64(y * Float64(b / Float64(Float64(t + x) + y)))); else tmp = Float64(fma(Float64(Float64(a + z) - b), y, fma(a, t, Float64(z * x))) / t_1); end return 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[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -1e+175], N[Not[LessEqual[t$95$2, 1e+307]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - N[(y * N[(b / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision] * y + N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+175} \lor \neg \left(t\_2 \leq 10^{+307}\right):\\
\;\;\;\;\left(a + z\right) - y \cdot \frac{b}{\left(t + x\right) + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(a + z\right) - b, y, \mathsf{fma}\left(a, t, z \cdot x\right)\right)}{t\_1}\\
\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.9999999999999994e174 or 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 12.4%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
associate-/l*N/A
cancel-sign-sub-invN/A
lower-+.f64N/A
Applied rewrites26.9%
Taylor expanded in y around inf
lower-+.f6485.2
Applied rewrites85.2%
if -9.9999999999999994e174 < (/.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.8%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6499.8
Applied rewrites99.8%
Final simplification93.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ t y) a))
(t_2 (/ (- (+ (* (+ x y) z) t_1) (* y b)) (+ (+ x t) y))))
(if (or (<= t_2 -2e+162) (not (<= t_2 1e+107)))
(- (+ a z) (* y (/ b (+ (+ t x) y))))
(/ (fma (+ y x) z t_1) (+ (+ y x) t)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) * a;
double t_2 = ((((x + y) * z) + t_1) - (y * b)) / ((x + t) + y);
double tmp;
if ((t_2 <= -2e+162) || !(t_2 <= 1e+107)) {
tmp = (a + z) - (y * (b / ((t + x) + y)));
} else {
tmp = fma((y + x), z, t_1) / ((y + x) + t);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) * a) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + t_1) - Float64(y * b)) / Float64(Float64(x + t) + y)) tmp = 0.0 if ((t_2 <= -2e+162) || !(t_2 <= 1e+107)) tmp = Float64(Float64(a + z) - Float64(y * Float64(b / Float64(Float64(t + x) + y)))); else tmp = Float64(fma(Float64(y + x), z, t_1) / Float64(Float64(y + x) + t)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -2e+162], N[Not[LessEqual[t$95$2, 1e+107]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - N[(y * N[(b / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y + x), $MachinePrecision] * z + t$95$1), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) \cdot a\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + t\_1\right) - y \cdot b}{\left(x + t\right) + y}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+162} \lor \neg \left(t\_2 \leq 10^{+107}\right):\\
\;\;\;\;\left(a + z\right) - y \cdot \frac{b}{\left(t + x\right) + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y + x, z, t\_1\right)}{\left(y + x\right) + t}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -1.9999999999999999e162 or 9.9999999999999997e106 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 28.3%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
associate-/l*N/A
cancel-sign-sub-invN/A
lower-+.f64N/A
Applied rewrites37.2%
Taylor expanded in y around inf
lower-+.f6484.1
Applied rewrites84.1%
if -1.9999999999999999e162 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.9999999999999997e106Initial program 99.8%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6479.1
Applied rewrites79.1%
Final simplification81.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) (* y (/ b (+ (+ t x) y))))))
(if (<= x -1.28e-42)
t_1
(if (<= x 4.3e+32)
(fma y (/ (- z b) (+ t y)) a)
(if (<= x 2.3e+235) t_1 (/ (fma (+ x y) z (* (+ y t) a)) (+ y x)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + z) - (y * (b / ((t + x) + y)));
double tmp;
if (x <= -1.28e-42) {
tmp = t_1;
} else if (x <= 4.3e+32) {
tmp = fma(y, ((z - b) / (t + y)), a);
} else if (x <= 2.3e+235) {
tmp = t_1;
} else {
tmp = fma((x + y), z, ((y + t) * a)) / (y + x);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + z) - Float64(y * Float64(b / Float64(Float64(t + x) + y)))) tmp = 0.0 if (x <= -1.28e-42) tmp = t_1; elseif (x <= 4.3e+32) tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a); elseif (x <= 2.3e+235) tmp = t_1; else tmp = Float64(fma(Float64(x + y), z, Float64(Float64(y + t) * a)) / Float64(y + x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - N[(y * N[(b / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.28e-42], t$95$1, If[LessEqual[x, 4.3e+32], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[x, 2.3e+235], t$95$1, N[(N[(N[(x + y), $MachinePrecision] * z + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - y \cdot \frac{b}{\left(t + x\right) + y}\\
\mathbf{if}\;x \leq -1.28 \cdot 10^{-42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{+32}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+235}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x + y, z, \left(y + t\right) \cdot a\right)}{y + x}\\
\end{array}
\end{array}
if x < -1.27999999999999994e-42 or 4.2999999999999997e32 < x < 2.3e235Initial program 54.6%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
associate-/l*N/A
cancel-sign-sub-invN/A
lower-+.f64N/A
Applied rewrites59.2%
Taylor expanded in y around inf
lower-+.f6470.5
Applied rewrites70.5%
if -1.27999999999999994e-42 < x < 4.2999999999999997e32Initial program 72.0%
Taylor expanded in x around 0
lower-/.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
*-commutativeN/A
distribute-lft-out--N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6460.5
Applied rewrites60.5%
Taylor expanded in a around 0
Applied rewrites85.5%
if 2.3e235 < x Initial program 73.8%
Taylor expanded in b around inf
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6410.4
Applied rewrites10.4%
Taylor expanded in t around 0
+-commutativeN/A
lower-+.f6410.4
Applied rewrites10.4%
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-+.f6461.8
Applied rewrites61.8%
Final simplification77.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -1.28e-42) (not (<= x 4.3e+32))) (- (+ a z) (* y (/ b (+ (+ t x) y)))) (fma y (/ (- z b) (+ t y)) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -1.28e-42) || !(x <= 4.3e+32)) {
tmp = (a + z) - (y * (b / ((t + x) + y)));
} else {
tmp = fma(y, ((z - b) / (t + y)), a);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -1.28e-42) || !(x <= 4.3e+32)) tmp = Float64(Float64(a + z) - Float64(y * Float64(b / Float64(Float64(t + x) + y)))); else tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -1.28e-42], N[Not[LessEqual[x, 4.3e+32]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - N[(y * N[(b / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.28 \cdot 10^{-42} \lor \neg \left(x \leq 4.3 \cdot 10^{+32}\right):\\
\;\;\;\;\left(a + z\right) - y \cdot \frac{b}{\left(t + x\right) + y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\end{array}
\end{array}
if x < -1.27999999999999994e-42 or 4.2999999999999997e32 < x Initial program 56.8%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
associate-/l*N/A
cancel-sign-sub-invN/A
lower-+.f64N/A
Applied rewrites61.3%
Taylor expanded in y around inf
lower-+.f6466.3
Applied rewrites66.3%
if -1.27999999999999994e-42 < x < 4.2999999999999997e32Initial program 72.0%
Taylor expanded in x around 0
lower-/.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
*-commutativeN/A
distribute-lft-out--N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6460.5
Applied rewrites60.5%
Taylor expanded in a around 0
Applied rewrites85.5%
Final simplification75.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -3.7e-42)
(- (+ a z) (* y (/ b (+ x y))))
(if (<= x 1.05e+54)
(fma y (/ (- z b) (+ t y)) a)
(* (+ y x) (/ z (+ (+ y x) t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.7e-42) {
tmp = (a + z) - (y * (b / (x + y)));
} else if (x <= 1.05e+54) {
tmp = fma(y, ((z - b) / (t + y)), a);
} else {
tmp = (y + x) * (z / ((y + x) + t));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3.7e-42) tmp = Float64(Float64(a + z) - Float64(y * Float64(b / Float64(x + y)))); elseif (x <= 1.05e+54) tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a); else tmp = Float64(Float64(y + x) * Float64(z / Float64(Float64(y + x) + t))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3.7e-42], N[(N[(a + z), $MachinePrecision] - N[(y * N[(b / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.05e+54], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[(N[(y + x), $MachinePrecision] * N[(z / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.7 \cdot 10^{-42}:\\
\;\;\;\;\left(a + z\right) - y \cdot \frac{b}{x + y}\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+54}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y + x\right) \cdot \frac{z}{\left(y + x\right) + t}\\
\end{array}
\end{array}
if x < -3.7000000000000002e-42Initial program 50.2%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
associate-/l*N/A
cancel-sign-sub-invN/A
lower-+.f64N/A
Applied rewrites54.3%
Taylor expanded in y around inf
lower-+.f6474.1
Applied rewrites74.1%
Taylor expanded in t around 0
lower-/.f64N/A
lower-+.f6471.2
Applied rewrites71.2%
if -3.7000000000000002e-42 < x < 1.04999999999999993e54Initial program 71.3%
Taylor expanded in x around 0
lower-/.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
*-commutativeN/A
distribute-lft-out--N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6459.7
Applied rewrites59.7%
Taylor expanded in a around 0
Applied rewrites85.6%
if 1.04999999999999993e54 < x Initial program 65.9%
Taylor expanded in z around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6452.2
Applied rewrites52.2%
Final simplification74.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -9.5e+159)
(* (- z) -1.0)
(if (<= x 1.05e+54)
(fma y (/ (- z b) (+ t y)) a)
(* (+ y x) (/ z (+ (+ y x) t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -9.5e+159) {
tmp = -z * -1.0;
} else if (x <= 1.05e+54) {
tmp = fma(y, ((z - b) / (t + y)), a);
} else {
tmp = (y + x) * (z / ((y + x) + t));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -9.5e+159) tmp = Float64(Float64(-z) * -1.0); elseif (x <= 1.05e+54) tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a); else tmp = Float64(Float64(y + x) * Float64(z / Float64(Float64(y + x) + t))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -9.5e+159], N[((-z) * -1.0), $MachinePrecision], If[LessEqual[x, 1.05e+54], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[(N[(y + x), $MachinePrecision] * N[(z / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+159}:\\
\;\;\;\;\left(-z\right) \cdot -1\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+54}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y + x\right) \cdot \frac{z}{\left(y + x\right) + t}\\
\end{array}
\end{array}
if x < -9.5000000000000003e159Initial program 34.5%
Taylor expanded in a around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites40.9%
Taylor expanded in z around -inf
Applied rewrites83.3%
Taylor expanded in x around inf
Applied rewrites67.8%
if -9.5000000000000003e159 < x < 1.04999999999999993e54Initial program 68.8%
Taylor expanded in x around 0
lower-/.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
*-commutativeN/A
distribute-lft-out--N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6452.8
Applied rewrites52.8%
Taylor expanded in a around 0
Applied rewrites80.8%
if 1.04999999999999993e54 < x Initial program 65.9%
Taylor expanded in z around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6452.2
Applied rewrites52.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -9.5e+159) (not (<= x 3.2e+183))) (* (- z) -1.0) (fma y (/ (- z b) (+ t y)) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -9.5e+159) || !(x <= 3.2e+183)) {
tmp = -z * -1.0;
} else {
tmp = fma(y, ((z - b) / (t + y)), a);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -9.5e+159) || !(x <= 3.2e+183)) tmp = Float64(Float64(-z) * -1.0); else tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -9.5e+159], N[Not[LessEqual[x, 3.2e+183]], $MachinePrecision]], N[((-z) * -1.0), $MachinePrecision], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+159} \lor \neg \left(x \leq 3.2 \cdot 10^{+183}\right):\\
\;\;\;\;\left(-z\right) \cdot -1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\end{array}
\end{array}
if x < -9.5000000000000003e159 or 3.2000000000000002e183 < x Initial program 50.3%
Taylor expanded in a around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites54.3%
Taylor expanded in z around -inf
Applied rewrites78.2%
Taylor expanded in x around inf
Applied rewrites58.8%
if -9.5000000000000003e159 < x < 3.2000000000000002e183Initial program 68.0%
Taylor expanded in x around 0
lower-/.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
*-commutativeN/A
distribute-lft-out--N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6449.4
Applied rewrites49.4%
Taylor expanded in a around 0
Applied rewrites77.0%
Final simplification73.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -4e+157) (not (<= t 1.45e+23))) (fma y (/ (- z b) t) a) (- (+ a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4e+157) || !(t <= 1.45e+23)) {
tmp = fma(y, ((z - b) / t), a);
} else {
tmp = (a + z) - b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -4e+157) || !(t <= 1.45e+23)) tmp = fma(y, Float64(Float64(z - b) / t), a); else tmp = Float64(Float64(a + z) - b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -4e+157], N[Not[LessEqual[t, 1.45e+23]], $MachinePrecision]], N[(y * N[(N[(z - b), $MachinePrecision] / t), $MachinePrecision] + a), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{+157} \lor \neg \left(t \leq 1.45 \cdot 10^{+23}\right):\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t}, a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if t < -3.99999999999999993e157 or 1.45000000000000006e23 < t Initial program 63.4%
Taylor expanded in x around 0
lower-/.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
*-commutativeN/A
distribute-lft-out--N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6447.1
Applied rewrites47.1%
Taylor expanded in t around inf
Applied rewrites63.8%
if -3.99999999999999993e157 < t < 1.45000000000000006e23Initial program 64.8%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6465.5
Applied rewrites65.5%
Final simplification64.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -3.35e+161) (not (<= x 8.6e+95))) (* (- z) -1.0) (- (+ a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -3.35e+161) || !(x <= 8.6e+95)) {
tmp = -z * -1.0;
} else {
tmp = (a + 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 ((x <= (-3.35d+161)) .or. (.not. (x <= 8.6d+95))) then
tmp = -z * (-1.0d0)
else
tmp = (a + 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 ((x <= -3.35e+161) || !(x <= 8.6e+95)) {
tmp = -z * -1.0;
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -3.35e+161) or not (x <= 8.6e+95): tmp = -z * -1.0 else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -3.35e+161) || !(x <= 8.6e+95)) tmp = Float64(Float64(-z) * -1.0); else tmp = Float64(Float64(a + z) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x <= -3.35e+161) || ~((x <= 8.6e+95))) tmp = -z * -1.0; else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -3.35e+161], N[Not[LessEqual[x, 8.6e+95]], $MachinePrecision]], N[((-z) * -1.0), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.35 \cdot 10^{+161} \lor \neg \left(x \leq 8.6 \cdot 10^{+95}\right):\\
\;\;\;\;\left(-z\right) \cdot -1\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if x < -3.35e161 or 8.6e95 < x Initial program 52.8%
Taylor expanded in a around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites56.2%
Taylor expanded in z around -inf
Applied rewrites78.1%
Taylor expanded in x around inf
Applied rewrites56.8%
if -3.35e161 < x < 8.6e95Initial program 68.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6463.2
Applied rewrites63.2%
Final simplification61.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6500000000000.0) (not (<= y 0.0074))) (- (+ a z) b) (+ z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6500000000000.0) || !(y <= 0.0074)) {
tmp = (a + z) - b;
} else {
tmp = z + a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-6500000000000.0d0)) .or. (.not. (y <= 0.0074d0))) then
tmp = (a + z) - b
else
tmp = z + a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6500000000000.0) || !(y <= 0.0074)) {
tmp = (a + z) - b;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6500000000000.0) or not (y <= 0.0074): tmp = (a + z) - b else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6500000000000.0) || !(y <= 0.0074)) tmp = Float64(Float64(a + z) - b); else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6500000000000.0) || ~((y <= 0.0074))) tmp = (a + z) - b; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6500000000000.0], N[Not[LessEqual[y, 0.0074]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(z + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6500000000000 \lor \neg \left(y \leq 0.0074\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if y < -6.5e12 or 0.0074000000000000003 < y Initial program 44.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6478.7
Applied rewrites78.7%
if -6.5e12 < y < 0.0074000000000000003Initial program 83.9%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6433.4
Applied rewrites33.4%
Taylor expanded in z around 0
Applied rewrites25.6%
Taylor expanded in b around 0
Applied rewrites43.4%
Final simplification60.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -1.08e-24) (not (<= x 1.7e-7))) (+ z a) (- a b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -1.08e-24) || !(x <= 1.7e-7)) {
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 ((x <= (-1.08d-24)) .or. (.not. (x <= 1.7d-7))) 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 ((x <= -1.08e-24) || !(x <= 1.7e-7)) {
tmp = z + a;
} else {
tmp = a - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -1.08e-24) or not (x <= 1.7e-7): tmp = z + a else: tmp = a - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -1.08e-24) || !(x <= 1.7e-7)) 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 ((x <= -1.08e-24) || ~((x <= 1.7e-7))) tmp = z + a; else tmp = a - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -1.08e-24], N[Not[LessEqual[x, 1.7e-7]], $MachinePrecision]], N[(z + a), $MachinePrecision], N[(a - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.08 \cdot 10^{-24} \lor \neg \left(x \leq 1.7 \cdot 10^{-7}\right):\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;a - b\\
\end{array}
\end{array}
if x < -1.08000000000000006e-24 or 1.69999999999999987e-7 < x Initial program 58.2%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6448.1
Applied rewrites48.1%
Taylor expanded in z around 0
Applied rewrites23.5%
Taylor expanded in b around 0
Applied rewrites52.5%
if -1.08000000000000006e-24 < x < 1.69999999999999987e-7Initial program 71.6%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6464.7
Applied rewrites64.7%
Taylor expanded in z around 0
Applied rewrites57.7%
Final simplification54.9%
(FPCore (x y z t a b) :precision binary64 (if (<= b -1.4e+126) (- b) (+ z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.4e+126) {
tmp = -b;
} else {
tmp = z + a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-1.4d+126)) then
tmp = -b
else
tmp = z + a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.4e+126) {
tmp = -b;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.4e+126: tmp = -b else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.4e+126) tmp = Float64(-b); else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -1.4e+126) tmp = -b; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.4e+126], (-b), N[(z + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.4 \cdot 10^{+126}:\\
\;\;\;\;-b\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if b < -1.40000000000000005e126Initial program 45.8%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6451.9
Applied rewrites51.9%
Taylor expanded in z around 0
Applied rewrites41.3%
Taylor expanded in a around 0
Applied rewrites36.7%
if -1.40000000000000005e126 < b Initial program 67.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.4
Applied rewrites56.4%
Taylor expanded in z around 0
Applied rewrites38.8%
Taylor expanded in b around 0
Applied rewrites54.4%
(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 64.3%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6455.7
Applied rewrites55.7%
Taylor expanded in z around 0
Applied rewrites39.2%
Taylor expanded in a around 0
Applied rewrites16.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))
(t_3 (/ t_2 t_1))
(t_4 (- (+ z a) b)))
(if (< t_3 -3.5813117084150564e+153)
t_4
(if (< t_3 1.2285964308315609e+82) (/ 1.0 (/ t_1 t_2)) t_4))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (x + t) + y
t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b)
t_3 = t_2 / t_1
t_4 = (z + a) - b
if (t_3 < (-3.5813117084150564d+153)) then
tmp = t_4
else if (t_3 < 1.2285964308315609d+82) then
tmp = 1.0d0 / (t_1 / t_2)
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + t) + y t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b) t_3 = t_2 / t_1 t_4 = (z + a) - b tmp = 0 if t_3 < -3.5813117084150564e+153: tmp = t_4 elif t_3 < 1.2285964308315609e+82: tmp = 1.0 / (t_1 / t_2) else: tmp = t_4 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) t_3 = Float64(t_2 / t_1) t_4 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = Float64(1.0 / Float64(t_1 / t_2)); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + t) + y; t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b); t_3 = t_2 / t_1; t_4 = (z + a) - b; tmp = 0.0; if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = 1.0 / (t_1 / t_2); else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Less[t$95$3, -3.5813117084150564e+153], t$95$4, If[Less[t$95$3, 1.2285964308315609e+82], N[(1.0 / N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\\
t_3 := \frac{t\_2}{t\_1}\\
t_4 := \left(z + a\right) - b\\
\mathbf{if}\;t\_3 < -3.5813117084150564 \cdot 10^{+153}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 < 1.2285964308315609 \cdot 10^{+82}:\\
\;\;\;\;\frac{1}{\frac{t\_1}{t\_2}}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
herbie shell --seed 2024323
(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)))