
(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 (+ (+ y t) x)) (t_2 (/ y t_1)) (t_3 (* t_1 z)))
(if (or (<= b -1.35e-126) (not (<= b 1.75e-103)))
(*
b
(- (fma -1.0 (/ (+ (* a (/ (+ y t) t_1)) (* z (/ (+ y x) t_1))) b) t_2)))
(* z (+ (/ x t_1) (- (fma a (/ (+ y t) t_3) t_2) (* b (/ y t_3))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + t) + x;
double t_2 = y / t_1;
double t_3 = t_1 * z;
double tmp;
if ((b <= -1.35e-126) || !(b <= 1.75e-103)) {
tmp = b * -fma(-1.0, (((a * ((y + t) / t_1)) + (z * ((y + x) / t_1))) / b), t_2);
} else {
tmp = z * ((x / t_1) + (fma(a, ((y + t) / t_3), t_2) - (b * (y / t_3))));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + t) + x) t_2 = Float64(y / t_1) t_3 = Float64(t_1 * z) tmp = 0.0 if ((b <= -1.35e-126) || !(b <= 1.75e-103)) tmp = Float64(b * Float64(-fma(-1.0, Float64(Float64(Float64(a * Float64(Float64(y + t) / t_1)) + Float64(z * Float64(Float64(y + x) / t_1))) / b), t_2))); else tmp = Float64(z * Float64(Float64(x / t_1) + Float64(fma(a, Float64(Float64(y + t) / t_3), t_2) - Float64(b * Float64(y / t_3))))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + t), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(y / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 * z), $MachinePrecision]}, If[Or[LessEqual[b, -1.35e-126], N[Not[LessEqual[b, 1.75e-103]], $MachinePrecision]], N[(b * (-N[(-1.0 * N[(N[(N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] + t$95$2), $MachinePrecision])), $MachinePrecision], N[(z * N[(N[(x / t$95$1), $MachinePrecision] + N[(N[(a * N[(N[(y + t), $MachinePrecision] / t$95$3), $MachinePrecision] + t$95$2), $MachinePrecision] - N[(b * N[(y / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + t\right) + x\\
t_2 := \frac{y}{t\_1}\\
t_3 := t\_1 \cdot z\\
\mathbf{if}\;b \leq -1.35 \cdot 10^{-126} \lor \neg \left(b \leq 1.75 \cdot 10^{-103}\right):\\
\;\;\;\;b \cdot \left(-\mathsf{fma}\left(-1, \frac{a \cdot \frac{y + t}{t\_1} + z \cdot \frac{y + x}{t\_1}}{b}, t\_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\frac{x}{t\_1} + \left(\mathsf{fma}\left(a, \frac{y + t}{t\_3}, t\_2\right) - b \cdot \frac{y}{t\_3}\right)\right)\\
\end{array}
\end{array}
if b < -1.34999999999999998e-126 or 1.75000000000000008e-103 < b Initial program 59.8%
Taylor expanded in b around -inf 68.1%
associate-*r*68.1%
neg-mul-168.1%
fma-define68.1%
Simplified95.8%
if -1.34999999999999998e-126 < b < 1.75000000000000008e-103Initial program 65.2%
Taylor expanded in z around inf 81.6%
associate--l+81.6%
+-commutative81.6%
associate-+r+81.6%
Simplified87.8%
Final simplification92.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y t) x))
(t_2 (/ (- (+ (* a (+ y t)) (* z (+ y x))) (* b y)) (+ y (+ t x)))))
(if (<= t_2 (- INFINITY))
(- (+ a z) b)
(if (<= t_2 2e+297)
t_2
(*
b
(-
(fma
-1.0
(/ (+ (* a (/ (+ y t) t_1)) (* z (/ (+ y x) t_1))) b)
(/ y t_1))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + t) + x;
double t_2 = (((a * (y + t)) + (z * (y + x))) - (b * y)) / (y + (t + x));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (a + z) - b;
} else if (t_2 <= 2e+297) {
tmp = t_2;
} else {
tmp = b * -fma(-1.0, (((a * ((y + t) / t_1)) + (z * ((y + x) / t_1))) / b), (y / t_1));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + t) + x) t_2 = Float64(Float64(Float64(Float64(a * Float64(y + t)) + Float64(z * Float64(y + x))) - Float64(b * y)) / Float64(y + Float64(t + x))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(a + z) - b); elseif (t_2 <= 2e+297) tmp = t_2; else tmp = Float64(b * Float64(-fma(-1.0, Float64(Float64(Float64(a * Float64(Float64(y + t) / t_1)) + Float64(z * Float64(Float64(y + x) / t_1))) / b), Float64(y / t_1)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + t), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[t$95$2, 2e+297], t$95$2, N[(b * (-N[(-1.0 * N[(N[(N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + t\right) + x\\
t_2 := \frac{\left(a \cdot \left(y + t\right) + z \cdot \left(y + x\right)\right) - b \cdot y}{y + \left(t + x\right)}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+297}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(-\mathsf{fma}\left(-1, \frac{a \cdot \frac{y + t}{t\_1} + z \cdot \frac{y + x}{t\_1}}{b}, \frac{y}{t\_1}\right)\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)) < -inf.0Initial program 6.2%
Taylor expanded in y around inf 75.7%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2e297Initial program 99.7%
if 2e297 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 4.7%
Taylor expanded in b around -inf 19.9%
associate-*r*19.9%
neg-mul-119.9%
fma-define19.9%
Simplified73.0%
Final simplification89.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y t) x)) (t_2 (/ y t_1)))
(if (or (<= b -2.6e-167) (not (<= b 1.32e-133)))
(*
b
(- (fma -1.0 (/ (+ (* a (/ (+ y t) t_1)) (* z (/ (+ y x) t_1))) b) t_2)))
(*
a
(+
(/ t t_1)
(- (fma z (/ (+ y x) (* a t_1)) t_2) (/ (/ (* b y) a) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + t) + x;
double t_2 = y / t_1;
double tmp;
if ((b <= -2.6e-167) || !(b <= 1.32e-133)) {
tmp = b * -fma(-1.0, (((a * ((y + t) / t_1)) + (z * ((y + x) / t_1))) / b), t_2);
} else {
tmp = a * ((t / t_1) + (fma(z, ((y + x) / (a * t_1)), t_2) - (((b * y) / a) / t_1)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + t) + x) t_2 = Float64(y / t_1) tmp = 0.0 if ((b <= -2.6e-167) || !(b <= 1.32e-133)) tmp = Float64(b * Float64(-fma(-1.0, Float64(Float64(Float64(a * Float64(Float64(y + t) / t_1)) + Float64(z * Float64(Float64(y + x) / t_1))) / b), t_2))); else tmp = Float64(a * Float64(Float64(t / t_1) + Float64(fma(z, Float64(Float64(y + x) / Float64(a * t_1)), t_2) - Float64(Float64(Float64(b * y) / a) / t_1)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + t), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(y / t$95$1), $MachinePrecision]}, If[Or[LessEqual[b, -2.6e-167], N[Not[LessEqual[b, 1.32e-133]], $MachinePrecision]], N[(b * (-N[(-1.0 * N[(N[(N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] + t$95$2), $MachinePrecision])), $MachinePrecision], N[(a * N[(N[(t / t$95$1), $MachinePrecision] + N[(N[(z * N[(N[(y + x), $MachinePrecision] / N[(a * t$95$1), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] - N[(N[(N[(b * y), $MachinePrecision] / a), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + t\right) + x\\
t_2 := \frac{y}{t\_1}\\
\mathbf{if}\;b \leq -2.6 \cdot 10^{-167} \lor \neg \left(b \leq 1.32 \cdot 10^{-133}\right):\\
\;\;\;\;b \cdot \left(-\mathsf{fma}\left(-1, \frac{a \cdot \frac{y + t}{t\_1} + z \cdot \frac{y + x}{t\_1}}{b}, t\_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\frac{t}{t\_1} + \left(\mathsf{fma}\left(z, \frac{y + x}{a \cdot t\_1}, t\_2\right) - \frac{\frac{b \cdot y}{a}}{t\_1}\right)\right)\\
\end{array}
\end{array}
if b < -2.5999999999999999e-167 or 1.32000000000000008e-133 < b Initial program 61.4%
Taylor expanded in b around -inf 67.8%
associate-*r*67.8%
neg-mul-167.8%
fma-define67.8%
Simplified93.7%
if -2.5999999999999999e-167 < b < 1.32000000000000008e-133Initial program 62.7%
Taylor expanded in a around inf 67.4%
associate--l+67.4%
+-commutative67.4%
associate-+r+67.4%
Simplified79.1%
Final simplification89.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- (+ (* a (+ y t)) (* z (+ y x))) (* b y)) (+ y (+ t x))))) (if (or (<= t_1 (- INFINITY)) (not (<= t_1 4e+221))) (- (+ a z) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((a * (y + t)) + (z * (y + x))) - (b * y)) / (y + (t + x));
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 4e+221)) {
tmp = (a + z) - b;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((a * (y + t)) + (z * (y + x))) - (b * y)) / (y + (t + x));
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 4e+221)) {
tmp = (a + z) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (((a * (y + t)) + (z * (y + x))) - (b * y)) / (y + (t + x)) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 4e+221): tmp = (a + z) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(a * Float64(y + t)) + Float64(z * Float64(y + x))) - Float64(b * y)) / Float64(y + Float64(t + x))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 4e+221)) tmp = Float64(Float64(a + z) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (((a * (y + t)) + (z * (y + x))) - (b * y)) / (y + (t + x)); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 4e+221))) tmp = (a + z) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 4e+221]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(a \cdot \left(y + t\right) + z \cdot \left(y + x\right)\right) - b \cdot y}{y + \left(t + x\right)}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 4 \cdot 10^{+221}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\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)) < -inf.0 or 4.0000000000000002e221 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 10.6%
Taylor expanded in y around inf 75.3%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.0000000000000002e221Initial program 99.7%
Final simplification89.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y t) x)) (t_2 (* a (+ (/ (+ y t) t_1) (/ z a)))))
(if (<= a -0.155)
t_2
(if (<= a -7.2e-211)
(* z (/ (+ y x) t_1))
(if (<= a 3.4e-97) (/ (- (* z (+ y x)) (* b y)) (+ y (+ t x))) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + t) + x;
double t_2 = a * (((y + t) / t_1) + (z / a));
double tmp;
if (a <= -0.155) {
tmp = t_2;
} else if (a <= -7.2e-211) {
tmp = z * ((y + x) / t_1);
} else if (a <= 3.4e-97) {
tmp = ((z * (y + x)) - (b * y)) / (y + (t + x));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y + t) + x
t_2 = a * (((y + t) / t_1) + (z / a))
if (a <= (-0.155d0)) then
tmp = t_2
else if (a <= (-7.2d-211)) then
tmp = z * ((y + x) / t_1)
else if (a <= 3.4d-97) then
tmp = ((z * (y + x)) - (b * y)) / (y + (t + x))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + t) + x;
double t_2 = a * (((y + t) / t_1) + (z / a));
double tmp;
if (a <= -0.155) {
tmp = t_2;
} else if (a <= -7.2e-211) {
tmp = z * ((y + x) / t_1);
} else if (a <= 3.4e-97) {
tmp = ((z * (y + x)) - (b * y)) / (y + (t + x));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y + t) + x t_2 = a * (((y + t) / t_1) + (z / a)) tmp = 0 if a <= -0.155: tmp = t_2 elif a <= -7.2e-211: tmp = z * ((y + x) / t_1) elif a <= 3.4e-97: tmp = ((z * (y + x)) - (b * y)) / (y + (t + x)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + t) + x) t_2 = Float64(a * Float64(Float64(Float64(y + t) / t_1) + Float64(z / a))) tmp = 0.0 if (a <= -0.155) tmp = t_2; elseif (a <= -7.2e-211) tmp = Float64(z * Float64(Float64(y + x) / t_1)); elseif (a <= 3.4e-97) tmp = Float64(Float64(Float64(z * Float64(y + x)) - Float64(b * y)) / Float64(y + Float64(t + x))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y + t) + x; t_2 = a * (((y + t) / t_1) + (z / a)); tmp = 0.0; if (a <= -0.155) tmp = t_2; elseif (a <= -7.2e-211) tmp = z * ((y + x) / t_1); elseif (a <= 3.4e-97) tmp = ((z * (y + x)) - (b * y)) / (y + (t + x)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + t), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.155], t$95$2, If[LessEqual[a, -7.2e-211], N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.4e-97], N[(N[(N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + t\right) + x\\
t_2 := a \cdot \left(\frac{y + t}{t\_1} + \frac{z}{a}\right)\\
\mathbf{if}\;a \leq -0.155:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -7.2 \cdot 10^{-211}:\\
\;\;\;\;z \cdot \frac{y + x}{t\_1}\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{-97}:\\
\;\;\;\;\frac{z \cdot \left(y + x\right) - b \cdot y}{y + \left(t + x\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -0.154999999999999999 or 3.3999999999999999e-97 < a Initial program 53.8%
Taylor expanded in a around -inf 69.4%
mul-1-neg69.4%
distribute-rgt-neg-in69.4%
mul-1-neg69.4%
unsub-neg69.4%
Simplified69.5%
Taylor expanded in x around inf 76.2%
if -0.154999999999999999 < a < -7.1999999999999998e-211Initial program 64.5%
Taylor expanded in z around inf 39.8%
associate-/l*63.7%
+-commutative63.7%
+-commutative63.7%
associate-+r+63.7%
Simplified63.7%
if -7.1999999999999998e-211 < a < 3.3999999999999999e-97Initial program 77.3%
Taylor expanded in a around 0 71.3%
+-commutative71.3%
*-commutative71.3%
Simplified71.3%
Final simplification72.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y t) x)) (t_2 (* a (/ (+ y t) t_1))))
(if (<= a -2.8e+152)
t_2
(if (<= a -9.5e-9)
(- (+ a z) b)
(if (<= a 8.8e+38) (* z (/ (+ y x) t_1)) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + t) + x;
double t_2 = a * ((y + t) / t_1);
double tmp;
if (a <= -2.8e+152) {
tmp = t_2;
} else if (a <= -9.5e-9) {
tmp = (a + z) - b;
} else if (a <= 8.8e+38) {
tmp = z * ((y + x) / t_1);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y + t) + x
t_2 = a * ((y + t) / t_1)
if (a <= (-2.8d+152)) then
tmp = t_2
else if (a <= (-9.5d-9)) then
tmp = (a + z) - b
else if (a <= 8.8d+38) then
tmp = z * ((y + x) / t_1)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + t) + x;
double t_2 = a * ((y + t) / t_1);
double tmp;
if (a <= -2.8e+152) {
tmp = t_2;
} else if (a <= -9.5e-9) {
tmp = (a + z) - b;
} else if (a <= 8.8e+38) {
tmp = z * ((y + x) / t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y + t) + x t_2 = a * ((y + t) / t_1) tmp = 0 if a <= -2.8e+152: tmp = t_2 elif a <= -9.5e-9: tmp = (a + z) - b elif a <= 8.8e+38: tmp = z * ((y + x) / t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + t) + x) t_2 = Float64(a * Float64(Float64(y + t) / t_1)) tmp = 0.0 if (a <= -2.8e+152) tmp = t_2; elseif (a <= -9.5e-9) tmp = Float64(Float64(a + z) - b); elseif (a <= 8.8e+38) tmp = Float64(z * Float64(Float64(y + x) / t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y + t) + x; t_2 = a * ((y + t) / t_1); tmp = 0.0; if (a <= -2.8e+152) tmp = t_2; elseif (a <= -9.5e-9) tmp = (a + z) - b; elseif (a <= 8.8e+38) tmp = z * ((y + x) / t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + t), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.8e+152], t$95$2, If[LessEqual[a, -9.5e-9], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[a, 8.8e+38], N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + t\right) + x\\
t_2 := a \cdot \frac{y + t}{t\_1}\\
\mathbf{if}\;a \leq -2.8 \cdot 10^{+152}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -9.5 \cdot 10^{-9}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{elif}\;a \leq 8.8 \cdot 10^{+38}:\\
\;\;\;\;z \cdot \frac{y + x}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -2.8000000000000002e152 or 8.80000000000000026e38 < a Initial program 47.4%
Taylor expanded in a around inf 37.1%
associate-/l*73.3%
+-commutative73.3%
+-commutative73.3%
associate-+r+73.3%
Simplified73.3%
if -2.8000000000000002e152 < a < -9.5000000000000007e-9Initial program 62.7%
Taylor expanded in y around inf 70.4%
if -9.5000000000000007e-9 < a < 8.80000000000000026e38Initial program 70.7%
Taylor expanded in z around inf 40.6%
associate-/l*60.0%
+-commutative60.0%
+-commutative60.0%
associate-+r+60.0%
Simplified60.0%
Final simplification65.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5.5e-94) (not (<= y 4e-63))) (- (+ a z) b) (+ (/ (* a t) (+ t x)) (/ (* x z) (+ t x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5.5e-94) || !(y <= 4e-63)) {
tmp = (a + z) - b;
} else {
tmp = ((a * t) / (t + x)) + ((x * z) / (t + x));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-5.5d-94)) .or. (.not. (y <= 4d-63))) then
tmp = (a + z) - b
else
tmp = ((a * t) / (t + x)) + ((x * z) / (t + x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5.5e-94) || !(y <= 4e-63)) {
tmp = (a + z) - b;
} else {
tmp = ((a * t) / (t + x)) + ((x * z) / (t + x));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -5.5e-94) or not (y <= 4e-63): tmp = (a + z) - b else: tmp = ((a * t) / (t + x)) + ((x * z) / (t + x)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -5.5e-94) || !(y <= 4e-63)) tmp = Float64(Float64(a + z) - b); else tmp = Float64(Float64(Float64(a * t) / Float64(t + x)) + Float64(Float64(x * z) / Float64(t + x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -5.5e-94) || ~((y <= 4e-63))) tmp = (a + z) - b; else tmp = ((a * t) / (t + x)) + ((x * z) / (t + x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -5.5e-94], N[Not[LessEqual[y, 4e-63]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(a * t), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{-94} \lor \neg \left(y \leq 4 \cdot 10^{-63}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{a \cdot t}{t + x} + \frac{x \cdot z}{t + x}\\
\end{array}
\end{array}
if y < -5.49999999999999989e-94 or 4.00000000000000027e-63 < y Initial program 52.1%
Taylor expanded in y around inf 69.2%
if -5.49999999999999989e-94 < y < 4.00000000000000027e-63Initial program 78.0%
Taylor expanded in b around -inf 70.0%
associate-*r*70.0%
neg-mul-170.0%
fma-define70.0%
Simplified79.1%
Taylor expanded in y around 0 63.0%
Final simplification66.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5.5e-94) (not (<= y 2.35e-63))) (- (+ a z) b) (/ (+ (* a t) (* x z)) (+ t x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5.5e-94) || !(y <= 2.35e-63)) {
tmp = (a + z) - b;
} else {
tmp = ((a * t) + (x * z)) / (t + x);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-5.5d-94)) .or. (.not. (y <= 2.35d-63))) then
tmp = (a + z) - b
else
tmp = ((a * t) + (x * z)) / (t + x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5.5e-94) || !(y <= 2.35e-63)) {
tmp = (a + z) - b;
} else {
tmp = ((a * t) + (x * z)) / (t + x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -5.5e-94) or not (y <= 2.35e-63): tmp = (a + z) - b else: tmp = ((a * t) + (x * z)) / (t + x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -5.5e-94) || !(y <= 2.35e-63)) tmp = Float64(Float64(a + z) - b); else tmp = Float64(Float64(Float64(a * t) + Float64(x * z)) / Float64(t + x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -5.5e-94) || ~((y <= 2.35e-63))) tmp = (a + z) - b; else tmp = ((a * t) + (x * z)) / (t + x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -5.5e-94], N[Not[LessEqual[y, 2.35e-63]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(a * t), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{-94} \lor \neg \left(y \leq 2.35 \cdot 10^{-63}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{a \cdot t + x \cdot z}{t + x}\\
\end{array}
\end{array}
if y < -5.49999999999999989e-94 or 2.35e-63 < y Initial program 52.1%
Taylor expanded in y around inf 69.2%
if -5.49999999999999989e-94 < y < 2.35e-63Initial program 78.0%
Taylor expanded in y around 0 62.9%
Final simplification66.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -2.6e+118) (not (<= x 5.5e+216))) (+ z (/ (* a (+ y t)) x)) (- (+ a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -2.6e+118) || !(x <= 5.5e+216)) {
tmp = z + ((a * (y + t)) / x);
} 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 <= (-2.6d+118)) .or. (.not. (x <= 5.5d+216))) then
tmp = z + ((a * (y + t)) / x)
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 <= -2.6e+118) || !(x <= 5.5e+216)) {
tmp = z + ((a * (y + t)) / x);
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -2.6e+118) or not (x <= 5.5e+216): tmp = z + ((a * (y + t)) / x) else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -2.6e+118) || !(x <= 5.5e+216)) tmp = Float64(z + Float64(Float64(a * Float64(y + t)) / x)); 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 <= -2.6e+118) || ~((x <= 5.5e+216))) tmp = z + ((a * (y + t)) / x); else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -2.6e+118], N[Not[LessEqual[x, 5.5e+216]], $MachinePrecision]], N[(z + N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{+118} \lor \neg \left(x \leq 5.5 \cdot 10^{+216}\right):\\
\;\;\;\;z + \frac{a \cdot \left(y + t\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if x < -2.60000000000000016e118 or 5.5e216 < x Initial program 52.9%
Taylor expanded in a around -inf 54.7%
mul-1-neg54.7%
distribute-rgt-neg-in54.7%
mul-1-neg54.7%
unsub-neg54.7%
Simplified54.7%
Taylor expanded in x around inf 69.7%
Taylor expanded in x around inf 68.0%
if -2.60000000000000016e118 < x < 5.5e216Initial program 64.5%
Taylor expanded in y around inf 62.3%
Final simplification63.7%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.4e+67) a (if (<= a 3.6e+37) (- z b) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.4e+67) {
tmp = a;
} else if (a <= 3.6e+37) {
tmp = z - b;
} else {
tmp = 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 (a <= (-1.4d+67)) then
tmp = a
else if (a <= 3.6d+37) then
tmp = z - b
else
tmp = 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 (a <= -1.4e+67) {
tmp = a;
} else if (a <= 3.6e+37) {
tmp = z - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.4e+67: tmp = a elif a <= 3.6e+37: tmp = z - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.4e+67) tmp = a; elseif (a <= 3.6e+37) tmp = Float64(z - b); else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.4e+67) tmp = a; elseif (a <= 3.6e+37) tmp = z - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.4e+67], a, If[LessEqual[a, 3.6e+37], N[(z - b), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.4 \cdot 10^{+67}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 3.6 \cdot 10^{+37}:\\
\;\;\;\;z - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -1.3999999999999999e67 or 3.59999999999999998e37 < a Initial program 50.9%
Taylor expanded in t around inf 57.0%
if -1.3999999999999999e67 < a < 3.59999999999999998e37Initial program 69.0%
Taylor expanded in a around 0 53.9%
+-commutative53.9%
*-commutative53.9%
Simplified53.9%
Taylor expanded in y around inf 50.5%
(FPCore (x y z t a b) :precision binary64 (if (<= a -9600.0) a (if (<= a 2.8e+37) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -9600.0) {
tmp = a;
} else if (a <= 2.8e+37) {
tmp = z;
} else {
tmp = 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 (a <= (-9600.0d0)) then
tmp = a
else if (a <= 2.8d+37) then
tmp = z
else
tmp = 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 (a <= -9600.0) {
tmp = a;
} else if (a <= 2.8e+37) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -9600.0: tmp = a elif a <= 2.8e+37: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -9600.0) tmp = a; elseif (a <= 2.8e+37) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -9600.0) tmp = a; elseif (a <= 2.8e+37) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -9600.0], a, If[LessEqual[a, 2.8e+37], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9600:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{+37}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -9600 or 2.7999999999999998e37 < a Initial program 51.6%
Taylor expanded in t around inf 53.4%
if -9600 < a < 2.7999999999999998e37Initial program 70.4%
Taylor expanded in x around inf 47.2%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.45e+120) z (- (+ a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.45e+120) {
tmp = z;
} 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 <= (-1.45d+120)) then
tmp = z
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 <= -1.45e+120) {
tmp = z;
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.45e+120: tmp = z else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.45e+120) tmp = z; 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 <= -1.45e+120) tmp = z; else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.45e+120], z, N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{+120}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if x < -1.4500000000000001e120Initial program 50.9%
Taylor expanded in x around inf 48.4%
if -1.4500000000000001e120 < x Initial program 63.9%
Taylor expanded in y around inf 61.0%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 61.7%
Taylor expanded in t around inf 32.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))
(t_3 (/ t_2 t_1))
(t_4 (- (+ z a) b)))
(if (< t_3 -3.5813117084150564e+153)
t_4
(if (< t_3 1.2285964308315609e+82) (/ 1.0 (/ t_1 t_2)) t_4))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (x + t) + y
t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b)
t_3 = t_2 / t_1
t_4 = (z + a) - b
if (t_3 < (-3.5813117084150564d+153)) then
tmp = t_4
else if (t_3 < 1.2285964308315609d+82) then
tmp = 1.0d0 / (t_1 / t_2)
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + t) + y t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b) t_3 = t_2 / t_1 t_4 = (z + a) - b tmp = 0 if t_3 < -3.5813117084150564e+153: tmp = t_4 elif t_3 < 1.2285964308315609e+82: tmp = 1.0 / (t_1 / t_2) else: tmp = t_4 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) t_3 = Float64(t_2 / t_1) t_4 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = Float64(1.0 / Float64(t_1 / t_2)); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + t) + y; t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b); t_3 = t_2 / t_1; t_4 = (z + a) - b; tmp = 0.0; if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = 1.0 / (t_1 / t_2); else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Less[t$95$3, -3.5813117084150564e+153], t$95$4, If[Less[t$95$3, 1.2285964308315609e+82], N[(1.0 / N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\\
t_3 := \frac{t\_2}{t\_1}\\
t_4 := \left(z + a\right) - b\\
\mathbf{if}\;t\_3 < -3.5813117084150564 \cdot 10^{+153}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 < 1.2285964308315609 \cdot 10^{+82}:\\
\;\;\;\;\frac{1}{\frac{t\_1}{t\_2}}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
herbie shell --seed 2024180
(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)))