
(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 y) z) (* (+ y t) a)) (* y b)) (+ y (+ x t))))
(t_2 (- (+ z a) b)))
(if (<= t_1 (- INFINITY)) t_2 (if (<= t_1 4e+248) t_1 t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t));
double t_2 = (z + a) - b;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= 4e+248) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t));
double t_2 = (z + a) - b;
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= 4e+248) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t)) t_2 = (z + a) - b tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= 4e+248: tmp = t_1 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(y + t) * a)) - Float64(y * b)) / Float64(y + Float64(x + t))) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= 4e+248) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t)); t_2 = (z + a) - b; tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= 4e+248) tmp = t_1; else tmp = t_2; 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[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, 4e+248], t$95$1, t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(x + y\right) \cdot z + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+248}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 4.00000000000000018e248 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 8.3%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6468.9%
Simplified68.9%
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.00000000000000018e248Initial program 99.6%
Final simplification86.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -1.7e-39)
t_1
(if (<= y -3.3e-140)
(* b (- (/ z b) (/ y (+ (+ x y) t))))
(if (<= y 7.8e-91)
(/ (+ (* (+ x y) z) (* (+ y t) a)) (+ y (+ x t)))
t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -1.7e-39) {
tmp = t_1;
} else if (y <= -3.3e-140) {
tmp = b * ((z / b) - (y / ((x + y) + t)));
} else if (y <= 7.8e-91) {
tmp = (((x + y) * z) + ((y + t) * a)) / (y + (x + t));
} 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 = (z + a) - b
if (y <= (-1.7d-39)) then
tmp = t_1
else if (y <= (-3.3d-140)) then
tmp = b * ((z / b) - (y / ((x + y) + t)))
else if (y <= 7.8d-91) then
tmp = (((x + y) * z) + ((y + t) * a)) / (y + (x + t))
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 = (z + a) - b;
double tmp;
if (y <= -1.7e-39) {
tmp = t_1;
} else if (y <= -3.3e-140) {
tmp = b * ((z / b) - (y / ((x + y) + t)));
} else if (y <= 7.8e-91) {
tmp = (((x + y) * z) + ((y + t) * a)) / (y + (x + t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -1.7e-39: tmp = t_1 elif y <= -3.3e-140: tmp = b * ((z / b) - (y / ((x + y) + t))) elif y <= 7.8e-91: tmp = (((x + y) * z) + ((y + t) * a)) / (y + (x + t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -1.7e-39) tmp = t_1; elseif (y <= -3.3e-140) tmp = Float64(b * Float64(Float64(z / b) - Float64(y / Float64(Float64(x + y) + t)))); elseif (y <= 7.8e-91) tmp = Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(y + t) * a)) / Float64(y + Float64(x + t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -1.7e-39) tmp = t_1; elseif (y <= -3.3e-140) tmp = b * ((z / b) - (y / ((x + y) + t))); elseif (y <= 7.8e-91) tmp = (((x + y) * z) + ((y + t) * a)) / (y + (x + t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.7e-39], t$95$1, If[LessEqual[y, -3.3e-140], N[(b * N[(N[(z / b), $MachinePrecision] - N[(y / N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.8e-91], N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.7 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.3 \cdot 10^{-140}:\\
\;\;\;\;b \cdot \left(\frac{z}{b} - \frac{y}{\left(x + y\right) + t}\right)\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{-91}:\\
\;\;\;\;\frac{\left(x + y\right) \cdot z + \left(y + t\right) \cdot a}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.7e-39 or 7.79999999999999987e-91 < y Initial program 45.1%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6468.4%
Simplified68.4%
if -1.7e-39 < y < -3.29999999999999987e-140Initial program 75.0%
Taylor expanded in z around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
Simplified87.1%
Taylor expanded in a around -inf
associate-*r*N/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f64N/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
Simplified81.1%
Taylor expanded in b around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
Simplified66.9%
Taylor expanded in x around inf
/-lowering-/.f6465.4%
Simplified65.4%
if -3.29999999999999987e-140 < y < 7.79999999999999987e-91Initial program 82.9%
Taylor expanded in b around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6468.5%
Simplified68.5%
Final simplification68.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (+ (/ a z) (/ (+ x y) (+ (+ x y) t))))))
(if (<= z -2.3e-79)
t_1
(if (<= z 1.65e+23)
(/ (- (+ (* t a) (* x z)) (* y b)) (+ y (+ x t)))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * ((a / z) + ((x + y) / ((x + y) + t)));
double tmp;
if (z <= -2.3e-79) {
tmp = t_1;
} else if (z <= 1.65e+23) {
tmp = (((t * a) + (x * z)) - (y * b)) / (y + (x + t));
} 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 = z * ((a / z) + ((x + y) / ((x + y) + t)))
if (z <= (-2.3d-79)) then
tmp = t_1
else if (z <= 1.65d+23) then
tmp = (((t * a) + (x * z)) - (y * b)) / (y + (x + t))
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 = z * ((a / z) + ((x + y) / ((x + y) + t)));
double tmp;
if (z <= -2.3e-79) {
tmp = t_1;
} else if (z <= 1.65e+23) {
tmp = (((t * a) + (x * z)) - (y * b)) / (y + (x + t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * ((a / z) + ((x + y) / ((x + y) + t))) tmp = 0 if z <= -2.3e-79: tmp = t_1 elif z <= 1.65e+23: tmp = (((t * a) + (x * z)) - (y * b)) / (y + (x + t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(Float64(a / z) + Float64(Float64(x + y) / Float64(Float64(x + y) + t)))) tmp = 0.0 if (z <= -2.3e-79) tmp = t_1; elseif (z <= 1.65e+23) tmp = Float64(Float64(Float64(Float64(t * a) + Float64(x * z)) - Float64(y * b)) / Float64(y + Float64(x + t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * ((a / z) + ((x + y) / ((x + y) + t))); tmp = 0.0; if (z <= -2.3e-79) tmp = t_1; elseif (z <= 1.65e+23) tmp = (((t * a) + (x * z)) - (y * b)) / (y + (x + t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(N[(a / z), $MachinePrecision] + N[(N[(x + y), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.3e-79], t$95$1, If[LessEqual[z, 1.65e+23], N[(N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(\frac{a}{z} + \frac{x + y}{\left(x + y\right) + t}\right)\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{-79}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+23}:\\
\;\;\;\;\frac{\left(t \cdot a + x \cdot z\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.30000000000000012e-79 or 1.65000000000000015e23 < z Initial program 48.9%
Taylor expanded in z around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
Simplified61.7%
Taylor expanded in t around inf
/-lowering-/.f6475.4%
Simplified75.4%
if -2.30000000000000012e-79 < z < 1.65000000000000015e23Initial program 78.4%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6466.0%
Simplified66.0%
Final simplification71.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -8.2e-37)
t_1
(if (<= y 3.55e-93)
(/ (- (+ (* t a) (* x z)) (* y b)) (+ y (+ x t)))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -8.2e-37) {
tmp = t_1;
} else if (y <= 3.55e-93) {
tmp = (((t * a) + (x * z)) - (y * b)) / (y + (x + t));
} 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 = (z + a) - b
if (y <= (-8.2d-37)) then
tmp = t_1
else if (y <= 3.55d-93) then
tmp = (((t * a) + (x * z)) - (y * b)) / (y + (x + t))
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 = (z + a) - b;
double tmp;
if (y <= -8.2e-37) {
tmp = t_1;
} else if (y <= 3.55e-93) {
tmp = (((t * a) + (x * z)) - (y * b)) / (y + (x + t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -8.2e-37: tmp = t_1 elif y <= 3.55e-93: tmp = (((t * a) + (x * z)) - (y * b)) / (y + (x + t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -8.2e-37) tmp = t_1; elseif (y <= 3.55e-93) tmp = Float64(Float64(Float64(Float64(t * a) + Float64(x * z)) - Float64(y * b)) / Float64(y + Float64(x + t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -8.2e-37) tmp = t_1; elseif (y <= 3.55e-93) tmp = (((t * a) + (x * z)) - (y * b)) / (y + (x + t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -8.2e-37], t$95$1, If[LessEqual[y, 3.55e-93], N[(N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -8.2 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.55 \cdot 10^{-93}:\\
\;\;\;\;\frac{\left(t \cdot a + x \cdot z\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -8.1999999999999996e-37 or 3.55e-93 < y Initial program 44.7%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6468.9%
Simplified68.9%
if -8.1999999999999996e-37 < y < 3.55e-93Initial program 80.9%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6471.1%
Simplified71.1%
Final simplification69.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -2.45e-40)
t_1
(if (<= y -2.8e-140)
(* b (- (/ z b) (/ y (+ (+ x y) t))))
(if (<= y 4.7e-93) (/ (+ (* t a) (* x z)) (+ x t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -2.45e-40) {
tmp = t_1;
} else if (y <= -2.8e-140) {
tmp = b * ((z / b) - (y / ((x + y) + t)));
} else if (y <= 4.7e-93) {
tmp = ((t * a) + (x * z)) / (x + t);
} 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 = (z + a) - b
if (y <= (-2.45d-40)) then
tmp = t_1
else if (y <= (-2.8d-140)) then
tmp = b * ((z / b) - (y / ((x + y) + t)))
else if (y <= 4.7d-93) then
tmp = ((t * a) + (x * z)) / (x + t)
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 = (z + a) - b;
double tmp;
if (y <= -2.45e-40) {
tmp = t_1;
} else if (y <= -2.8e-140) {
tmp = b * ((z / b) - (y / ((x + y) + t)));
} else if (y <= 4.7e-93) {
tmp = ((t * a) + (x * z)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -2.45e-40: tmp = t_1 elif y <= -2.8e-140: tmp = b * ((z / b) - (y / ((x + y) + t))) elif y <= 4.7e-93: tmp = ((t * a) + (x * z)) / (x + t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -2.45e-40) tmp = t_1; elseif (y <= -2.8e-140) tmp = Float64(b * Float64(Float64(z / b) - Float64(y / Float64(Float64(x + y) + t)))); elseif (y <= 4.7e-93) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -2.45e-40) tmp = t_1; elseif (y <= -2.8e-140) tmp = b * ((z / b) - (y / ((x + y) + t))); elseif (y <= 4.7e-93) tmp = ((t * a) + (x * z)) / (x + t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -2.45e-40], t$95$1, If[LessEqual[y, -2.8e-140], N[(b * N[(N[(z / b), $MachinePrecision] - N[(y / N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.7e-93], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -2.45 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{-140}:\\
\;\;\;\;b \cdot \left(\frac{z}{b} - \frac{y}{\left(x + y\right) + t}\right)\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{-93}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.4499999999999999e-40 or 4.6999999999999999e-93 < y Initial program 45.1%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6468.4%
Simplified68.4%
if -2.4499999999999999e-40 < y < -2.8000000000000002e-140Initial program 75.0%
Taylor expanded in z around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
Simplified87.1%
Taylor expanded in a around -inf
associate-*r*N/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f64N/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
Simplified81.1%
Taylor expanded in b around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
Simplified66.9%
Taylor expanded in x around inf
/-lowering-/.f6465.4%
Simplified65.4%
if -2.8000000000000002e-140 < y < 4.6999999999999999e-93Initial program 82.9%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6462.0%
Simplified62.0%
Final simplification66.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x y) t)) (t_2 (* z (/ (+ x y) t_1))))
(if (<= z -7.2e+87)
t_2
(if (<= z 1.35e+104) (* b (- (/ a b) (/ y t_1))) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + y) + t;
double t_2 = z * ((x + y) / t_1);
double tmp;
if (z <= -7.2e+87) {
tmp = t_2;
} else if (z <= 1.35e+104) {
tmp = b * ((a / b) - (y / 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 = (x + y) + t
t_2 = z * ((x + y) / t_1)
if (z <= (-7.2d+87)) then
tmp = t_2
else if (z <= 1.35d+104) then
tmp = b * ((a / b) - (y / 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 = (x + y) + t;
double t_2 = z * ((x + y) / t_1);
double tmp;
if (z <= -7.2e+87) {
tmp = t_2;
} else if (z <= 1.35e+104) {
tmp = b * ((a / b) - (y / t_1));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + y) + t t_2 = z * ((x + y) / t_1) tmp = 0 if z <= -7.2e+87: tmp = t_2 elif z <= 1.35e+104: tmp = b * ((a / b) - (y / t_1)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + y) + t) t_2 = Float64(z * Float64(Float64(x + y) / t_1)) tmp = 0.0 if (z <= -7.2e+87) tmp = t_2; elseif (z <= 1.35e+104) tmp = Float64(b * Float64(Float64(a / b) - Float64(y / t_1))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + y) + t; t_2 = z * ((x + y) / t_1); tmp = 0.0; if (z <= -7.2e+87) tmp = t_2; elseif (z <= 1.35e+104) tmp = b * ((a / b) - (y / t_1)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.2e+87], t$95$2, If[LessEqual[z, 1.35e+104], N[(b * N[(N[(a / b), $MachinePrecision] - N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + t\\
t_2 := z \cdot \frac{x + y}{t\_1}\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{+87}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+104}:\\
\;\;\;\;b \cdot \left(\frac{a}{b} - \frac{y}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -7.19999999999999988e87 or 1.34999999999999992e104 < z Initial program 41.7%
Taylor expanded in z around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
Simplified60.9%
Taylor expanded in a around -inf
associate-*r*N/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f64N/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
Simplified70.5%
Taylor expanded in z around inf
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-lowering-neg.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6475.4%
Simplified75.4%
if -7.19999999999999988e87 < z < 1.34999999999999992e104Initial program 72.9%
Taylor expanded in z around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
Simplified67.4%
Taylor expanded in a around -inf
associate-*r*N/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f64N/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
Simplified67.7%
Taylor expanded in b around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
Simplified75.0%
Taylor expanded in t around inf
/-lowering-/.f6458.0%
Simplified58.0%
Final simplification64.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -2.45e-80)
t_1
(if (<= y 1.22e-91) (/ (+ (* t a) (* x z)) (+ x t)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -2.45e-80) {
tmp = t_1;
} else if (y <= 1.22e-91) {
tmp = ((t * a) + (x * z)) / (x + t);
} 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 = (z + a) - b
if (y <= (-2.45d-80)) then
tmp = t_1
else if (y <= 1.22d-91) then
tmp = ((t * a) + (x * z)) / (x + t)
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 = (z + a) - b;
double tmp;
if (y <= -2.45e-80) {
tmp = t_1;
} else if (y <= 1.22e-91) {
tmp = ((t * a) + (x * z)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -2.45e-80: tmp = t_1 elif y <= 1.22e-91: tmp = ((t * a) + (x * z)) / (x + t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -2.45e-80) tmp = t_1; elseif (y <= 1.22e-91) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -2.45e-80) tmp = t_1; elseif (y <= 1.22e-91) tmp = ((t * a) + (x * z)) / (x + t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -2.45e-80], t$95$1, If[LessEqual[y, 1.22e-91], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -2.45 \cdot 10^{-80}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.22 \cdot 10^{-91}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.44999999999999995e-80 or 1.21999999999999998e-91 < y Initial program 46.9%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6467.2%
Simplified67.2%
if -2.44999999999999995e-80 < y < 1.21999999999999998e-91Initial program 82.2%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6455.9%
Simplified55.9%
Final simplification62.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ z (* t (- (/ a x) (/ z x)))))) (if (<= x -6.5e+146) t_1 (if (<= x 1.25e+78) (- (+ z a) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + (t * ((a / x) - (z / x)));
double tmp;
if (x <= -6.5e+146) {
tmp = t_1;
} else if (x <= 1.25e+78) {
tmp = (z + a) - b;
} 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 = z + (t * ((a / x) - (z / x)))
if (x <= (-6.5d+146)) then
tmp = t_1
else if (x <= 1.25d+78) then
tmp = (z + a) - b
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 = z + (t * ((a / x) - (z / x)));
double tmp;
if (x <= -6.5e+146) {
tmp = t_1;
} else if (x <= 1.25e+78) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z + (t * ((a / x) - (z / x))) tmp = 0 if x <= -6.5e+146: tmp = t_1 elif x <= 1.25e+78: tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z + Float64(t * Float64(Float64(a / x) - Float64(z / x)))) tmp = 0.0 if (x <= -6.5e+146) tmp = t_1; elseif (x <= 1.25e+78) tmp = Float64(Float64(z + a) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z + (t * ((a / x) - (z / x))); tmp = 0.0; if (x <= -6.5e+146) tmp = t_1; elseif (x <= 1.25e+78) tmp = (z + a) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z + N[(t * N[(N[(a / x), $MachinePrecision] - N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.5e+146], t$95$1, If[LessEqual[x, 1.25e+78], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z + t \cdot \left(\frac{a}{x} - \frac{z}{x}\right)\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+146}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+78}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.4999999999999997e146 or 1.24999999999999996e78 < x Initial program 45.9%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6434.6%
Simplified34.6%
Taylor expanded in t around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6464.7%
Simplified64.7%
if -6.4999999999999997e146 < x < 1.24999999999999996e78Initial program 68.6%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6458.4%
Simplified58.4%
Final simplification60.5%
(FPCore (x y z t a b) :precision binary64 (if (<= x 1.15e+78) (- (+ z a) b) (* x (/ z (+ x t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 1.15e+78) {
tmp = (z + a) - b;
} else {
tmp = x * (z / (x + t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= 1.15d+78) then
tmp = (z + a) - b
else
tmp = x * (z / (x + t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 1.15e+78) {
tmp = (z + a) - b;
} else {
tmp = x * (z / (x + t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 1.15e+78: tmp = (z + a) - b else: tmp = x * (z / (x + t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 1.15e+78) tmp = Float64(Float64(z + a) - b); else tmp = Float64(x * Float64(z / Float64(x + t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 1.15e+78) tmp = (z + a) - b; else tmp = x * (z / (x + t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 1.15e+78], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(x * N[(z / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.15 \cdot 10^{+78}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{x + t}\\
\end{array}
\end{array}
if x < 1.1500000000000001e78Initial program 63.6%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6454.8%
Simplified54.8%
if 1.1500000000000001e78 < x Initial program 50.3%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6441.9%
Simplified41.9%
Taylor expanded in a around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6457.7%
Simplified57.7%
Final simplification55.3%
(FPCore (x y z t a b) :precision binary64 (if (<= z -7.4e+98) z (if (<= z 6200000000000.0) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -7.4e+98) {
tmp = z;
} else if (z <= 6200000000000.0) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-7.4d+98)) then
tmp = z
else if (z <= 6200000000000.0d0) then
tmp = a
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -7.4e+98) {
tmp = z;
} else if (z <= 6200000000000.0) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -7.4e+98: tmp = z elif z <= 6200000000000.0: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -7.4e+98) tmp = z; elseif (z <= 6200000000000.0) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -7.4e+98) tmp = z; elseif (z <= 6200000000000.0) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -7.4e+98], z, If[LessEqual[z, 6200000000000.0], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.4 \cdot 10^{+98}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 6200000000000:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -7.3999999999999997e98 or 6.2e12 < z Initial program 44.6%
Taylor expanded in x around inf
Simplified53.8%
if -7.3999999999999997e98 < z < 6.2e12Initial program 74.4%
Taylor expanded in t around inf
Simplified36.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x 2.8e+78) (- (+ z a) b) z))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 2.8e+78) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= 2.8d+78) then
tmp = (z + a) - b
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 2.8e+78) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 2.8e+78: tmp = (z + a) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 2.8e+78) tmp = Float64(Float64(z + a) - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 2.8e+78) tmp = (z + a) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 2.8e+78], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.8 \cdot 10^{+78}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < 2.8000000000000001e78Initial program 63.6%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6454.8%
Simplified54.8%
if 2.8000000000000001e78 < x Initial program 50.3%
Taylor expanded in x around inf
Simplified54.2%
Final simplification54.7%
(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.1%
Taylor expanded in t around inf
Simplified27.3%
(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 2024144
(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)))