
(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 12 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 t) y))
(t_2 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) t_1)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 1e+252)))
(+ (- z b) a)
(/ (fma (- y) b (fma a (+ t y) (* z (+ y 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 <= -((double) INFINITY)) || !(t_2 <= 1e+252)) {
tmp = (z - b) + a;
} else {
tmp = fma(-y, b, fma(a, (t + y), (z * (y + 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 <= Float64(-Inf)) || !(t_2 <= 1e+252)) tmp = Float64(Float64(z - b) + a); else tmp = Float64(fma(Float64(-y), b, fma(a, Float64(t + y), Float64(z * Float64(y + 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, (-Infinity)], N[Not[LessEqual[t$95$2, 1e+252]], $MachinePrecision]], N[(N[(z - b), $MachinePrecision] + a), $MachinePrecision], N[(N[((-y) * b + N[(a * N[(t + y), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $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 -\infty \lor \neg \left(t\_2 \leq 10^{+252}\right):\\
\;\;\;\;\left(z - b\right) + a\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-y, b, \mathsf{fma}\left(a, t + y, z \cdot \left(y + x\right)\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)) < -inf.0 or 1.0000000000000001e252 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 9.5%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6481.2
Applied rewrites81.2%
Applied rewrites81.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)) < 1.0000000000000001e252Initial program 99.0%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6499.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.0
Applied rewrites99.0%
Final simplification91.9%
(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)))
(t_3 (+ (- z b) a)))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 1e+67)
(/ (fma (+ y x) z t_1) (+ (+ y x) t))
(if (<= t_2 5e+153)
(/ (fma a y (fma z x (* y (- z b)))) (+ y x))
t_3)))))
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 t_3 = (z - b) + a;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= 1e+67) {
tmp = fma((y + x), z, t_1) / ((y + x) + t);
} else if (t_2 <= 5e+153) {
tmp = fma(a, y, fma(z, x, (y * (z - b)))) / (y + x);
} else {
tmp = t_3;
}
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)) t_3 = Float64(Float64(z - b) + a) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= 1e+67) tmp = Float64(fma(Float64(y + x), z, t_1) / Float64(Float64(y + x) + t)); elseif (t_2 <= 5e+153) tmp = Float64(fma(a, y, fma(z, x, Float64(y * Float64(z - b)))) / Float64(y + x)); else tmp = t_3; 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]}, Block[{t$95$3 = N[(N[(z - b), $MachinePrecision] + a), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, 1e+67], N[(N[(N[(y + x), $MachinePrecision] * z + t$95$1), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+153], N[(N[(a * y + N[(z * x + N[(y * N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]
\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}\\
t_3 := \left(z - b\right) + a\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 10^{+67}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y + x, z, t\_1\right)}{\left(y + x\right) + t}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, y, \mathsf{fma}\left(z, x, y \cdot \left(z - b\right)\right)\right)}{y + x}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 5.00000000000000018e153 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 17.5%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6480.4
Applied rewrites80.4%
Applied rewrites80.4%
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.99999999999999983e66Initial program 98.9%
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-+.f6481.4
Applied rewrites81.4%
if 9.99999999999999983e66 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.00000000000000018e153Initial program 99.3%
Taylor expanded in t around 0
lower-/.f64N/A
associate--l+N/A
lower-fma.f64N/A
distribute-rgt-inN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-lft-out--N/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6489.6
Applied rewrites89.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
(t_2 (+ (- z b) a)))
(if (<= t_1 -2e+195)
t_2
(if (<= t_1 1e+67)
(/ (fma a t (* z x)) (+ t x))
(if (<= t_1 5e+153)
(/ (fma a y (fma z x (* y (- z b)))) (+ y x))
t_2)))))
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 t_2 = (z - b) + a;
double tmp;
if (t_1 <= -2e+195) {
tmp = t_2;
} else if (t_1 <= 1e+67) {
tmp = fma(a, t, (z * x)) / (t + x);
} else if (t_1 <= 5e+153) {
tmp = fma(a, y, fma(z, x, (y * (z - b)))) / (y + x);
} else {
tmp = t_2;
}
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)) t_2 = Float64(Float64(z - b) + a) tmp = 0.0 if (t_1 <= -2e+195) tmp = t_2; elseif (t_1 <= 1e+67) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); elseif (t_1 <= 5e+153) tmp = Float64(fma(a, y, fma(z, x, Float64(y * Float64(z - b)))) / 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[(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]}, Block[{t$95$2 = N[(N[(z - b), $MachinePrecision] + a), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+195], t$95$2, If[LessEqual[t$95$1, 1e+67], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+153], N[(N[(a * y + N[(z * x + N[(y * N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\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}\\
t_2 := \left(z - b\right) + a\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+195}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+67}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, y, \mathsf{fma}\left(z, x, y \cdot \left(z - b\right)\right)\right)}{y + x}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -1.99999999999999995e195 or 5.00000000000000018e153 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 23.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6480.2
Applied rewrites80.2%
Applied rewrites80.2%
if -1.99999999999999995e195 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.99999999999999983e66Initial program 98.9%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6466.6
Applied rewrites66.6%
if 9.99999999999999983e66 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.00000000000000018e153Initial program 99.3%
Taylor expanded in t around 0
lower-/.f64N/A
associate--l+N/A
lower-fma.f64N/A
distribute-rgt-inN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-lft-out--N/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6489.6
Applied rewrites89.6%
(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)))
(t_3 (+ (- z b) a)))
(if (<= t_2 -2e+195)
t_3
(if (<= t_2 4e+42)
(/ (fma a t (* z x)) (+ t x))
(if (<= t_2 5e+153) (/ (fma (- b) y t_1) (+ (+ y x) t)) t_3)))))
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 t_3 = (z - b) + a;
double tmp;
if (t_2 <= -2e+195) {
tmp = t_3;
} else if (t_2 <= 4e+42) {
tmp = fma(a, t, (z * x)) / (t + x);
} else if (t_2 <= 5e+153) {
tmp = fma(-b, y, t_1) / ((y + x) + t);
} else {
tmp = t_3;
}
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)) t_3 = Float64(Float64(z - b) + a) tmp = 0.0 if (t_2 <= -2e+195) tmp = t_3; elseif (t_2 <= 4e+42) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); elseif (t_2 <= 5e+153) tmp = Float64(fma(Float64(-b), y, t_1) / Float64(Float64(y + x) + t)); else tmp = t_3; 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]}, Block[{t$95$3 = N[(N[(z - b), $MachinePrecision] + a), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+195], t$95$3, If[LessEqual[t$95$2, 4e+42], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+153], N[(N[((-b) * y + t$95$1), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]
\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}\\
t_3 := \left(z - b\right) + a\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+195}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+42}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-b, y, t\_1\right)}{\left(y + x\right) + t}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -1.99999999999999995e195 or 5.00000000000000018e153 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 23.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6480.2
Applied rewrites80.2%
Applied rewrites80.2%
if -1.99999999999999995e195 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.00000000000000018e42Initial program 98.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6466.0
Applied rewrites66.0%
if 4.00000000000000018e42 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.00000000000000018e153Initial program 99.4%
Taylor expanded in z around 0
lower-/.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6483.3
Applied rewrites83.3%
(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 -2e+195) (not (<= t_1 1e+67)))
(+ (- z b) a)
(/ (fma a t (* z x)) (+ t x)))))
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 <= -2e+195) || !(t_1 <= 1e+67)) {
tmp = (z - b) + a;
} else {
tmp = fma(a, t, (z * x)) / (t + x);
}
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 <= -2e+195) || !(t_1 <= 1e+67)) tmp = Float64(Float64(z - b) + a); else tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); end return 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, -2e+195], N[Not[LessEqual[t$95$1, 1e+67]], $MachinePrecision]], N[(N[(z - b), $MachinePrecision] + a), $MachinePrecision], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision]]]
\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 -2 \cdot 10^{+195} \lor \neg \left(t\_1 \leq 10^{+67}\right):\\
\;\;\;\;\left(z - b\right) + a\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\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.99999999999999995e195 or 9.99999999999999983e66 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 29.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6477.4
Applied rewrites77.4%
Applied rewrites77.5%
if -1.99999999999999995e195 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.99999999999999983e66Initial program 98.9%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6466.6
Applied rewrites66.6%
Final simplification72.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -2.9e+149)
(* (/ x (+ t x)) z)
(if (<= x -3.8e-32)
(+ z a)
(if (<= x 2.3e+125) (+ (- z b) a) (- z (* (/ (- b a) x) y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.9e+149) {
tmp = (x / (t + x)) * z;
} else if (x <= -3.8e-32) {
tmp = z + a;
} else if (x <= 2.3e+125) {
tmp = (z - b) + a;
} else {
tmp = z - (((b - a) / x) * y);
}
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 <= (-2.9d+149)) then
tmp = (x / (t + x)) * z
else if (x <= (-3.8d-32)) then
tmp = z + a
else if (x <= 2.3d+125) then
tmp = (z - b) + a
else
tmp = z - (((b - a) / x) * y)
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 <= -2.9e+149) {
tmp = (x / (t + x)) * z;
} else if (x <= -3.8e-32) {
tmp = z + a;
} else if (x <= 2.3e+125) {
tmp = (z - b) + a;
} else {
tmp = z - (((b - a) / x) * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.9e+149: tmp = (x / (t + x)) * z elif x <= -3.8e-32: tmp = z + a elif x <= 2.3e+125: tmp = (z - b) + a else: tmp = z - (((b - a) / x) * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.9e+149) tmp = Float64(Float64(x / Float64(t + x)) * z); elseif (x <= -3.8e-32) tmp = Float64(z + a); elseif (x <= 2.3e+125) tmp = Float64(Float64(z - b) + a); else tmp = Float64(z - Float64(Float64(Float64(b - a) / x) * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -2.9e+149) tmp = (x / (t + x)) * z; elseif (x <= -3.8e-32) tmp = z + a; elseif (x <= 2.3e+125) tmp = (z - b) + a; else tmp = z - (((b - a) / x) * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.9e+149], N[(N[(x / N[(t + x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[x, -3.8e-32], N[(z + a), $MachinePrecision], If[LessEqual[x, 2.3e+125], N[(N[(z - b), $MachinePrecision] + a), $MachinePrecision], N[(z - N[(N[(N[(b - a), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+149}:\\
\;\;\;\;\frac{x}{t + x} \cdot z\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-32}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+125}:\\
\;\;\;\;\left(z - b\right) + a\\
\mathbf{else}:\\
\;\;\;\;z - \frac{b - a}{x} \cdot y\\
\end{array}
\end{array}
if x < -2.9000000000000002e149Initial program 55.9%
Taylor expanded in z around inf
*-commutativeN/A
Applied rewrites75.7%
Taylor expanded in a around 0
Applied rewrites70.8%
Taylor expanded in y around 0
Applied rewrites70.7%
if -2.9000000000000002e149 < x < -3.80000000000000008e-32Initial program 77.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6450.8
Applied rewrites50.8%
Taylor expanded in b around inf
Applied rewrites8.9%
Taylor expanded in b around 0
Applied rewrites62.3%
if -3.80000000000000008e-32 < x < 2.30000000000000013e125Initial program 63.3%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6467.9
Applied rewrites67.9%
Applied rewrites68.0%
if 2.30000000000000013e125 < x Initial program 56.3%
Taylor expanded in x around -inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites60.1%
Taylor expanded in y around inf
Applied rewrites76.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ x (+ t x)) z)))
(if (<= x -2.9e+149)
t_1
(if (<= x -3.8e-32) (+ z a) (if (<= x 2e+125) (+ (- z b) a) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x / (t + x)) * z;
double tmp;
if (x <= -2.9e+149) {
tmp = t_1;
} else if (x <= -3.8e-32) {
tmp = z + a;
} else if (x <= 2e+125) {
tmp = (z - b) + 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 = (x / (t + x)) * z
if (x <= (-2.9d+149)) then
tmp = t_1
else if (x <= (-3.8d-32)) then
tmp = z + a
else if (x <= 2d+125) then
tmp = (z - b) + 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 = (x / (t + x)) * z;
double tmp;
if (x <= -2.9e+149) {
tmp = t_1;
} else if (x <= -3.8e-32) {
tmp = z + a;
} else if (x <= 2e+125) {
tmp = (z - b) + a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x / (t + x)) * z tmp = 0 if x <= -2.9e+149: tmp = t_1 elif x <= -3.8e-32: tmp = z + a elif x <= 2e+125: tmp = (z - b) + a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x / Float64(t + x)) * z) tmp = 0.0 if (x <= -2.9e+149) tmp = t_1; elseif (x <= -3.8e-32) tmp = Float64(z + a); elseif (x <= 2e+125) tmp = Float64(Float64(z - b) + a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x / (t + x)) * z; tmp = 0.0; if (x <= -2.9e+149) tmp = t_1; elseif (x <= -3.8e-32) tmp = z + a; elseif (x <= 2e+125) tmp = (z - b) + a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x / N[(t + x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[x, -2.9e+149], t$95$1, If[LessEqual[x, -3.8e-32], N[(z + a), $MachinePrecision], If[LessEqual[x, 2e+125], N[(N[(z - b), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t + x} \cdot z\\
\mathbf{if}\;x \leq -2.9 \cdot 10^{+149}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-32}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+125}:\\
\;\;\;\;\left(z - b\right) + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.9000000000000002e149 or 1.9999999999999998e125 < x Initial program 56.2%
Taylor expanded in z around inf
*-commutativeN/A
Applied rewrites75.4%
Taylor expanded in a around 0
Applied rewrites72.0%
Taylor expanded in y around 0
Applied rewrites68.2%
if -2.9000000000000002e149 < x < -3.80000000000000008e-32Initial program 77.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6450.8
Applied rewrites50.8%
Taylor expanded in b around inf
Applied rewrites8.9%
Taylor expanded in b around 0
Applied rewrites62.3%
if -3.80000000000000008e-32 < x < 1.9999999999999998e125Initial program 63.3%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6467.9
Applied rewrites67.9%
Applied rewrites68.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3.8e+185) (not (<= t 4e+113))) (fma (/ z t) x a) (+ (- z b) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.8e+185) || !(t <= 4e+113)) {
tmp = fma((z / t), x, a);
} else {
tmp = (z - b) + a;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3.8e+185) || !(t <= 4e+113)) tmp = fma(Float64(z / t), x, a); else tmp = Float64(Float64(z - b) + a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3.8e+185], N[Not[LessEqual[t, 4e+113]], $MachinePrecision]], N[(N[(z / t), $MachinePrecision] * x + a), $MachinePrecision], N[(N[(z - b), $MachinePrecision] + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{+185} \lor \neg \left(t \leq 4 \cdot 10^{+113}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, x, a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z - b\right) + a\\
\end{array}
\end{array}
if t < -3.7999999999999998e185 or 4e113 < t Initial program 66.2%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6446.2
Applied rewrites46.2%
Taylor expanded in x around 0
Applied rewrites58.6%
Taylor expanded in z around inf
Applied rewrites58.4%
if -3.7999999999999998e185 < t < 4e113Initial program 62.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6466.0
Applied rewrites66.0%
Applied rewrites66.0%
Final simplification64.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.05e+15) (not (<= y 3.4e-233))) (+ (- z b) a) (+ z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.05e+15) || !(y <= 3.4e-233)) {
tmp = (z - b) + a;
} 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 <= (-1.05d+15)) .or. (.not. (y <= 3.4d-233))) then
tmp = (z - b) + a
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 <= -1.05e+15) || !(y <= 3.4e-233)) {
tmp = (z - b) + a;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.05e+15) or not (y <= 3.4e-233): tmp = (z - b) + a else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.05e+15) || !(y <= 3.4e-233)) tmp = Float64(Float64(z - b) + a); else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.05e+15) || ~((y <= 3.4e-233))) tmp = (z - b) + a; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.05e+15], N[Not[LessEqual[y, 3.4e-233]], $MachinePrecision]], N[(N[(z - b), $MachinePrecision] + a), $MachinePrecision], N[(z + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+15} \lor \neg \left(y \leq 3.4 \cdot 10^{-233}\right):\\
\;\;\;\;\left(z - b\right) + a\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if y < -1.05e15 or 3.4000000000000002e-233 < y Initial program 53.8%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6468.7
Applied rewrites68.7%
Applied rewrites68.7%
if -1.05e15 < y < 3.4000000000000002e-233Initial program 79.8%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6438.8
Applied rewrites38.8%
Taylor expanded in b around inf
Applied rewrites4.2%
Taylor expanded in b around 0
Applied rewrites54.8%
Final simplification63.6%
(FPCore (x y z t a b) :precision binary64 (if (<= b -1.52e+91) (- a b) (+ z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.52e+91) {
tmp = a - b;
} else {
tmp = z + a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-1.52d+91)) then
tmp = a - b
else
tmp = z + a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.52e+91) {
tmp = a - b;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.52e+91: tmp = a - b else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.52e+91) tmp = Float64(a - b); else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -1.52e+91) tmp = a - b; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.52e+91], N[(a - b), $MachinePrecision], N[(z + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.52 \cdot 10^{+91}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if b < -1.52e91Initial program 50.3%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6445.5
Applied rewrites45.5%
Taylor expanded in z around 0
Applied rewrites43.1%
if -1.52e91 < b Initial program 65.9%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6460.1
Applied rewrites60.1%
Taylor expanded in b around inf
Applied rewrites9.2%
Taylor expanded in b around 0
Applied rewrites59.6%
(FPCore (x y z t a b) :precision binary64 (if (<= b -1e+198) (- b) (+ z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1e+198) {
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 <= (-1d+198)) 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 <= -1e+198) {
tmp = -b;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1e+198: tmp = -b else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1e+198) 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 <= -1e+198) tmp = -b; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1e+198], (-b), N[(z + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{+198}:\\
\;\;\;\;-b\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if b < -1.00000000000000002e198Initial program 43.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6447.2
Applied rewrites47.2%
Taylor expanded in b around inf
Applied rewrites42.7%
if -1.00000000000000002e198 < b Initial program 65.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6458.6
Applied rewrites58.6%
Taylor expanded in b around inf
Applied rewrites11.1%
Taylor expanded in b around 0
Applied rewrites57.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 63.3%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6457.7
Applied rewrites57.7%
Taylor expanded in b around inf
Applied rewrites13.6%
(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 2024329
(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)))