
(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 11 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 (/ (- (+ (* a (+ y t)) (* z (+ x y))) (* y b)) (+ y (+ x t))))
(t_2 (- (+ z a) b)))
(if (<= t_1 (- INFINITY)) t_2 (if (<= t_1 5e+289) t_1 t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((a * (y + t)) + (z * (x + y))) - (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 <= 5e+289) {
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 = (((a * (y + t)) + (z * (x + y))) - (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 <= 5e+289) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t)) t_2 = (z + a) - b tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= 5e+289: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(a * Float64(y + t)) + Float64(z * Float64(x + y))) - 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 <= 5e+289) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t)); t_2 = (z + a) - b; tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= 5e+289) 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[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $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, 5e+289], t$95$1, t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(a \cdot \left(y + t\right) + z \cdot \left(x + y\right)\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 5 \cdot 10^{+289}:\\
\;\;\;\;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 5.00000000000000031e289 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 4.9%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6471.1%
Simplified71.1%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.00000000000000031e289Initial program 99.1%
Final simplification86.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- a (- b z)) (/ y (+ x (+ y t))))))
(if (<= y -9.5e+23)
t_1
(if (<= y 3.8e-152)
(* z (+ (/ x (+ x t)) (/ (* t a) (* z (+ x t)))))
(if (<= y 2.15e+32) (/ (- (* z (+ x y)) (* y b)) (+ y (+ x t))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - (b - z)) * (y / (x + (y + t)));
double tmp;
if (y <= -9.5e+23) {
tmp = t_1;
} else if (y <= 3.8e-152) {
tmp = z * ((x / (x + t)) + ((t * a) / (z * (x + t))));
} else if (y <= 2.15e+32) {
tmp = ((z * (x + y)) - (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 = (a - (b - z)) * (y / (x + (y + t)))
if (y <= (-9.5d+23)) then
tmp = t_1
else if (y <= 3.8d-152) then
tmp = z * ((x / (x + t)) + ((t * a) / (z * (x + t))))
else if (y <= 2.15d+32) then
tmp = ((z * (x + y)) - (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 = (a - (b - z)) * (y / (x + (y + t)));
double tmp;
if (y <= -9.5e+23) {
tmp = t_1;
} else if (y <= 3.8e-152) {
tmp = z * ((x / (x + t)) + ((t * a) / (z * (x + t))));
} else if (y <= 2.15e+32) {
tmp = ((z * (x + y)) - (y * b)) / (y + (x + t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - (b - z)) * (y / (x + (y + t))) tmp = 0 if y <= -9.5e+23: tmp = t_1 elif y <= 3.8e-152: tmp = z * ((x / (x + t)) + ((t * a) / (z * (x + t)))) elif y <= 2.15e+32: tmp = ((z * (x + y)) - (y * b)) / (y + (x + t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - Float64(b - z)) * Float64(y / Float64(x + Float64(y + t)))) tmp = 0.0 if (y <= -9.5e+23) tmp = t_1; elseif (y <= 3.8e-152) tmp = Float64(z * Float64(Float64(x / Float64(x + t)) + Float64(Float64(t * a) / Float64(z * Float64(x + t))))); elseif (y <= 2.15e+32) tmp = Float64(Float64(Float64(z * Float64(x + y)) - 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 = (a - (b - z)) * (y / (x + (y + t))); tmp = 0.0; if (y <= -9.5e+23) tmp = t_1; elseif (y <= 3.8e-152) tmp = z * ((x / (x + t)) + ((t * a) / (z * (x + t)))); elseif (y <= 2.15e+32) tmp = ((z * (x + y)) - (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[(a - N[(b - z), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9.5e+23], t$95$1, If[LessEqual[y, 3.8e-152], N[(z * N[(N[(x / N[(x + t), $MachinePrecision]), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] / N[(z * N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.15e+32], N[(N[(N[(z * N[(x + y), $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(a - \left(b - z\right)\right) \cdot \frac{y}{x + \left(y + t\right)}\\
\mathbf{if}\;y \leq -9.5 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-152}:\\
\;\;\;\;z \cdot \left(\frac{x}{x + t} + \frac{t \cdot a}{z \cdot \left(x + t\right)}\right)\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{+32}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.50000000000000038e23 or 2.1499999999999999e32 < y Initial program 30.4%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6425.6%
Simplified25.6%
*-commutativeN/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f6477.8%
Applied egg-rr77.8%
if -9.50000000000000038e23 < y < 3.80000000000000012e-152Initial program 81.3%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6467.4%
Simplified67.4%
Taylor expanded in z around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6468.8%
Simplified68.8%
if 3.80000000000000012e-152 < y < 2.1499999999999999e32Initial program 76.4%
Taylor expanded in z around inf
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6460.2%
Simplified60.2%
Final simplification71.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- a (- b z)) (/ y (+ x (+ y t))))))
(if (<= y -3e+22)
t_1
(if (<= y 9e-148)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 7.5e+34) (/ (- (* z (+ x y)) (* y b)) (+ y (+ x t))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - (b - z)) * (y / (x + (y + t)));
double tmp;
if (y <= -3e+22) {
tmp = t_1;
} else if (y <= 9e-148) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 7.5e+34) {
tmp = ((z * (x + y)) - (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 = (a - (b - z)) * (y / (x + (y + t)))
if (y <= (-3d+22)) then
tmp = t_1
else if (y <= 9d-148) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 7.5d+34) then
tmp = ((z * (x + y)) - (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 = (a - (b - z)) * (y / (x + (y + t)));
double tmp;
if (y <= -3e+22) {
tmp = t_1;
} else if (y <= 9e-148) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 7.5e+34) {
tmp = ((z * (x + y)) - (y * b)) / (y + (x + t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - (b - z)) * (y / (x + (y + t))) tmp = 0 if y <= -3e+22: tmp = t_1 elif y <= 9e-148: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 7.5e+34: tmp = ((z * (x + y)) - (y * b)) / (y + (x + t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - Float64(b - z)) * Float64(y / Float64(x + Float64(y + t)))) tmp = 0.0 if (y <= -3e+22) tmp = t_1; elseif (y <= 9e-148) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 7.5e+34) tmp = Float64(Float64(Float64(z * Float64(x + y)) - 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 = (a - (b - z)) * (y / (x + (y + t))); tmp = 0.0; if (y <= -3e+22) tmp = t_1; elseif (y <= 9e-148) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 7.5e+34) tmp = ((z * (x + y)) - (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[(a - N[(b - z), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3e+22], t$95$1, If[LessEqual[y, 9e-148], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+34], N[(N[(N[(z * N[(x + y), $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(a - \left(b - z\right)\right) \cdot \frac{y}{x + \left(y + t\right)}\\
\mathbf{if}\;y \leq -3 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-148}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+34}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3e22 or 7.49999999999999976e34 < y Initial program 30.4%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6425.6%
Simplified25.6%
*-commutativeN/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f6477.8%
Applied egg-rr77.8%
if -3e22 < y < 9.00000000000000029e-148Initial program 80.6%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6466.8%
Simplified66.8%
if 9.00000000000000029e-148 < y < 7.49999999999999976e34Initial program 78.5%
Taylor expanded in z around inf
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6461.9%
Simplified61.9%
Final simplification71.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (+ y t))) (t_2 (- a (- b z))))
(if (<= y -4.4e+49)
(* t_2 (/ y t_1))
(if (<= y 7.4e-19)
(/ (- (+ (* t a) (* x z)) (* y b)) (+ y (+ x t)))
(if (<= y 9.5e+59)
(* z (/ (+ x y) (+ t (+ x y))))
(* y (/ t_2 t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y + t);
double t_2 = a - (b - z);
double tmp;
if (y <= -4.4e+49) {
tmp = t_2 * (y / t_1);
} else if (y <= 7.4e-19) {
tmp = (((t * a) + (x * z)) - (y * b)) / (y + (x + t));
} else if (y <= 9.5e+59) {
tmp = z * ((x + y) / (t + (x + y)));
} else {
tmp = y * (t_2 / 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) :: t_2
real(8) :: tmp
t_1 = x + (y + t)
t_2 = a - (b - z)
if (y <= (-4.4d+49)) then
tmp = t_2 * (y / t_1)
else if (y <= 7.4d-19) then
tmp = (((t * a) + (x * z)) - (y * b)) / (y + (x + t))
else if (y <= 9.5d+59) then
tmp = z * ((x + y) / (t + (x + y)))
else
tmp = y * (t_2 / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y + t);
double t_2 = a - (b - z);
double tmp;
if (y <= -4.4e+49) {
tmp = t_2 * (y / t_1);
} else if (y <= 7.4e-19) {
tmp = (((t * a) + (x * z)) - (y * b)) / (y + (x + t));
} else if (y <= 9.5e+59) {
tmp = z * ((x + y) / (t + (x + y)));
} else {
tmp = y * (t_2 / t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y + t) t_2 = a - (b - z) tmp = 0 if y <= -4.4e+49: tmp = t_2 * (y / t_1) elif y <= 7.4e-19: tmp = (((t * a) + (x * z)) - (y * b)) / (y + (x + t)) elif y <= 9.5e+59: tmp = z * ((x + y) / (t + (x + y))) else: tmp = y * (t_2 / t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y + t)) t_2 = Float64(a - Float64(b - z)) tmp = 0.0 if (y <= -4.4e+49) tmp = Float64(t_2 * Float64(y / t_1)); elseif (y <= 7.4e-19) tmp = Float64(Float64(Float64(Float64(t * a) + Float64(x * z)) - Float64(y * b)) / Float64(y + Float64(x + t))); elseif (y <= 9.5e+59) tmp = Float64(z * Float64(Float64(x + y) / Float64(t + Float64(x + y)))); else tmp = Float64(y * Float64(t_2 / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y + t); t_2 = a - (b - z); tmp = 0.0; if (y <= -4.4e+49) tmp = t_2 * (y / t_1); elseif (y <= 7.4e-19) tmp = (((t * a) + (x * z)) - (y * b)) / (y + (x + t)); elseif (y <= 9.5e+59) tmp = z * ((x + y) / (t + (x + y))); else tmp = y * (t_2 / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a - N[(b - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.4e+49], N[(t$95$2 * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.4e-19], 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], If[LessEqual[y, 9.5e+59], N[(z * N[(N[(x + y), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(t$95$2 / t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y + t\right)\\
t_2 := a - \left(b - z\right)\\
\mathbf{if}\;y \leq -4.4 \cdot 10^{+49}:\\
\;\;\;\;t\_2 \cdot \frac{y}{t\_1}\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{-19}:\\
\;\;\;\;\frac{\left(t \cdot a + x \cdot z\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+59}:\\
\;\;\;\;z \cdot \frac{x + y}{t + \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t\_2}{t\_1}\\
\end{array}
\end{array}
if y < -4.4000000000000001e49Initial program 29.7%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6428.6%
Simplified28.6%
*-commutativeN/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f6485.8%
Applied egg-rr85.8%
if -4.4000000000000001e49 < y < 7.40000000000000011e-19Initial program 82.0%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6473.5%
Simplified73.5%
if 7.40000000000000011e-19 < y < 9.50000000000000023e59Initial program 51.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
Simplified83.0%
Taylor expanded in z around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f6465.8%
Simplified65.8%
if 9.50000000000000023e59 < y Initial program 24.1%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6420.0%
Simplified20.0%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f6477.4%
Applied egg-rr77.4%
Final simplification76.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- a (- b z)) (/ y (+ x (+ y t))))))
(if (<= y -3e+22)
t_1
(if (<= y 1.56e-145) (/ (+ (* 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 = (a - (b - z)) * (y / (x + (y + t)));
double tmp;
if (y <= -3e+22) {
tmp = t_1;
} else if (y <= 1.56e-145) {
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 = (a - (b - z)) * (y / (x + (y + t)))
if (y <= (-3d+22)) then
tmp = t_1
else if (y <= 1.56d-145) 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 = (a - (b - z)) * (y / (x + (y + t)));
double tmp;
if (y <= -3e+22) {
tmp = t_1;
} else if (y <= 1.56e-145) {
tmp = ((t * a) + (x * z)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - (b - z)) * (y / (x + (y + t))) tmp = 0 if y <= -3e+22: tmp = t_1 elif y <= 1.56e-145: 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(a - Float64(b - z)) * Float64(y / Float64(x + Float64(y + t)))) tmp = 0.0 if (y <= -3e+22) tmp = t_1; elseif (y <= 1.56e-145) 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 = (a - (b - z)) * (y / (x + (y + t))); tmp = 0.0; if (y <= -3e+22) tmp = t_1; elseif (y <= 1.56e-145) 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[(a - N[(b - z), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3e+22], t$95$1, If[LessEqual[y, 1.56e-145], 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(a - \left(b - z\right)\right) \cdot \frac{y}{x + \left(y + t\right)}\\
\mathbf{if}\;y \leq -3 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.56 \cdot 10^{-145}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3e22 or 1.56000000000000001e-145 < y Initial program 41.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6431.5%
Simplified31.5%
*-commutativeN/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f6471.3%
Applied egg-rr71.3%
if -3e22 < y < 1.56000000000000001e-145Initial program 80.8%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6467.1%
Simplified67.1%
Final simplification69.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -6.5e+62)
t_1
(if (<= y 1.3e-12) (/ (+ (* 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 <= -6.5e+62) {
tmp = t_1;
} else if (y <= 1.3e-12) {
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 <= (-6.5d+62)) then
tmp = t_1
else if (y <= 1.3d-12) 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 <= -6.5e+62) {
tmp = t_1;
} else if (y <= 1.3e-12) {
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 <= -6.5e+62: tmp = t_1 elif y <= 1.3e-12: 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 <= -6.5e+62) tmp = t_1; elseif (y <= 1.3e-12) 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 <= -6.5e+62) tmp = t_1; elseif (y <= 1.3e-12) 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, -6.5e+62], t$95$1, If[LessEqual[y, 1.3e-12], 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 -6.5 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-12}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.5000000000000003e62 or 1.29999999999999991e-12 < y Initial program 29.4%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6472.8%
Simplified72.8%
if -6.5000000000000003e62 < y < 1.29999999999999991e-12Initial program 81.2%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6459.7%
Simplified59.7%
Final simplification65.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* a (/ t (+ x t))))) (if (<= t -6e+191) t_1 (if (<= t 5.3e+29) (- (+ z a) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t / (x + t));
double tmp;
if (t <= -6e+191) {
tmp = t_1;
} else if (t <= 5.3e+29) {
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 = a * (t / (x + t))
if (t <= (-6d+191)) then
tmp = t_1
else if (t <= 5.3d+29) 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 = a * (t / (x + t));
double tmp;
if (t <= -6e+191) {
tmp = t_1;
} else if (t <= 5.3e+29) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t / (x + t)) tmp = 0 if t <= -6e+191: tmp = t_1 elif t <= 5.3e+29: tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(t / Float64(x + t))) tmp = 0.0 if (t <= -6e+191) tmp = t_1; elseif (t <= 5.3e+29) 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 = a * (t / (x + t)); tmp = 0.0; if (t <= -6e+191) tmp = t_1; elseif (t <= 5.3e+29) 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[(a * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6e+191], t$95$1, If[LessEqual[t, 5.3e+29], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \frac{t}{x + t}\\
\mathbf{if}\;t \leq -6 \cdot 10^{+191}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5.3 \cdot 10^{+29}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.9999999999999995e191 or 5.3e29 < t Initial program 52.4%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6442.5%
Simplified42.5%
Taylor expanded in a around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6465.0%
Simplified65.0%
if -5.9999999999999995e191 < t < 5.3e29Initial program 59.6%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6459.8%
Simplified59.8%
Final simplification61.6%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2.6e+195) a (if (<= t 1.95e+118) (- (+ z a) b) (* a (- 1.0 (/ x t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.6e+195) {
tmp = a;
} else if (t <= 1.95e+118) {
tmp = (z + a) - b;
} else {
tmp = a * (1.0 - (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 (t <= (-2.6d+195)) then
tmp = a
else if (t <= 1.95d+118) then
tmp = (z + a) - b
else
tmp = a * (1.0d0 - (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 (t <= -2.6e+195) {
tmp = a;
} else if (t <= 1.95e+118) {
tmp = (z + a) - b;
} else {
tmp = a * (1.0 - (x / t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.6e+195: tmp = a elif t <= 1.95e+118: tmp = (z + a) - b else: tmp = a * (1.0 - (x / t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.6e+195) tmp = a; elseif (t <= 1.95e+118) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a * Float64(1.0 - Float64(x / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2.6e+195) tmp = a; elseif (t <= 1.95e+118) tmp = (z + a) - b; else tmp = a * (1.0 - (x / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.6e+195], a, If[LessEqual[t, 1.95e+118], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a * N[(1.0 - N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+195}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{+118}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 - \frac{x}{t}\right)\\
\end{array}
\end{array}
if t < -2.60000000000000002e195Initial program 44.7%
Taylor expanded in t around inf
Simplified63.6%
if -2.60000000000000002e195 < t < 1.95e118Initial program 60.6%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6457.7%
Simplified57.7%
if 1.95e118 < t Initial program 49.1%
Taylor expanded in t around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
Simplified74.1%
Taylor expanded in a around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6464.7%
Simplified64.7%
Final simplification59.4%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.8e+188) a (if (<= t 1.65e+151) (- (+ z a) b) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.8e+188) {
tmp = a;
} else if (t <= 1.65e+151) {
tmp = (z + a) - 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 (t <= (-3.8d+188)) then
tmp = a
else if (t <= 1.65d+151) then
tmp = (z + a) - 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 (t <= -3.8e+188) {
tmp = a;
} else if (t <= 1.65e+151) {
tmp = (z + a) - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.8e+188: tmp = a elif t <= 1.65e+151: tmp = (z + a) - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.8e+188) tmp = a; elseif (t <= 1.65e+151) tmp = Float64(Float64(z + a) - b); else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -3.8e+188) tmp = a; elseif (t <= 1.65e+151) tmp = (z + a) - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.8e+188], a, If[LessEqual[t, 1.65e+151], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{+188}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{+151}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -3.7999999999999998e188 or 1.65000000000000012e151 < t Initial program 48.3%
Taylor expanded in t around inf
Simplified66.9%
if -3.7999999999999998e188 < t < 1.65000000000000012e151Initial program 59.9%
Taylor expanded in y around inf
--lowering--.f64N/A
+-lowering-+.f6457.1%
Simplified57.1%
Final simplification59.4%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.5e+167) a (if (<= t 9e+80) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.5e+167) {
tmp = a;
} else if (t <= 9e+80) {
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 (t <= (-1.5d+167)) then
tmp = a
else if (t <= 9d+80) 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 (t <= -1.5e+167) {
tmp = a;
} else if (t <= 9e+80) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.5e+167: tmp = a elif t <= 9e+80: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.5e+167) tmp = a; elseif (t <= 9e+80) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.5e+167) tmp = a; elseif (t <= 9e+80) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.5e+167], a, If[LessEqual[t, 9e+80], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{+167}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+80}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -1.50000000000000006e167 or 9.00000000000000013e80 < t Initial program 50.5%
Taylor expanded in t around inf
Simplified62.6%
if -1.50000000000000006e167 < t < 9.00000000000000013e80Initial program 60.0%
Taylor expanded in x around inf
Simplified43.9%
(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 57.1%
Taylor expanded in t around inf
Simplified31.5%
(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 2024138
(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)))