
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (+ x y)))
(t_2 (+ t (+ x y)))
(t_3 (/ y t_2))
(t_4 (/ (- (+ (* (+ y t) a) t_1) (* y b)) (+ y (+ x t)))))
(if (<= t_4 -4e+273)
(- (+ z a) b)
(if (<= t_4 5e+290)
(+ (* a (+ t_3 (/ t t_2))) (/ (- t_1 (* y b)) t_2))
(fma z (+ t_3 (/ x t_2)) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (x + y);
double t_2 = t + (x + y);
double t_3 = y / t_2;
double t_4 = ((((y + t) * a) + t_1) - (y * b)) / (y + (x + t));
double tmp;
if (t_4 <= -4e+273) {
tmp = (z + a) - b;
} else if (t_4 <= 5e+290) {
tmp = (a * (t_3 + (t / t_2))) + ((t_1 - (y * b)) / t_2);
} else {
tmp = fma(z, (t_3 + (x / t_2)), a);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(x + y)) t_2 = Float64(t + Float64(x + y)) t_3 = Float64(y / t_2) t_4 = Float64(Float64(Float64(Float64(Float64(y + t) * a) + t_1) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if (t_4 <= -4e+273) tmp = Float64(Float64(z + a) - b); elseif (t_4 <= 5e+290) tmp = Float64(Float64(a * Float64(t_3 + Float64(t / t_2))) + Float64(Float64(t_1 - Float64(y * b)) / t_2)); else tmp = fma(z, Float64(t_3 + Float64(x / t_2)), a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -4e+273], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[t$95$4, 5e+290], N[(N[(a * N[(t$95$3 + N[(t / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], N[(z * N[(t$95$3 + N[(x / t$95$2), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x + y\right)\\
t_2 := t + \left(x + y\right)\\
t_3 := \frac{y}{t_2}\\
t_4 := \frac{\left(\left(y + t\right) \cdot a + t_1\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t_4 \leq -4 \cdot 10^{+273}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;t_4 \leq 5 \cdot 10^{+290}:\\
\;\;\;\;a \cdot \left(t_3 + \frac{t}{t_2}\right) + \frac{t_1 - y \cdot b}{t_2}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t_3 + \frac{x}{t_2}, a\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)) < -3.99999999999999978e273Initial program 11.2%
Taylor expanded in y around inf 65.3%
if -3.99999999999999978e273 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.9999999999999998e290Initial program 99.0%
Taylor expanded in a around 0 99.8%
associate--l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
div-sub99.7%
+-commutative99.7%
*-commutative99.7%
+-commutative99.7%
Simplified99.7%
if 4.9999999999999998e290 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 4.5%
Taylor expanded in z around 0 33.4%
associate--l+33.4%
div-sub33.4%
fma-def33.4%
+-commutative33.4%
+-commutative33.4%
div-sub33.4%
+-commutative33.4%
+-commutative33.4%
associate-+r+33.4%
*-commutative33.4%
+-commutative33.4%
associate-+r+33.4%
Simplified33.8%
Taylor expanded in t around inf 73.8%
Final simplification87.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (+ x y)))
(t_2 (+ t (+ x y)))
(t_3 (/ (- (+ (* (+ y t) a) t_1) (* y b)) (+ y (+ x t)))))
(if (or (<= t_3 -4e+273) (not (<= t_3 5e+290)))
(- (+ z a) b)
(+ (* a (+ (/ y t_2) (/ t t_2))) (/ (- t_1 (* y b)) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (x + y);
double t_2 = t + (x + y);
double t_3 = ((((y + t) * a) + t_1) - (y * b)) / (y + (x + t));
double tmp;
if ((t_3 <= -4e+273) || !(t_3 <= 5e+290)) {
tmp = (z + a) - b;
} else {
tmp = (a * ((y / t_2) + (t / t_2))) + ((t_1 - (y * b)) / 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) :: t_3
real(8) :: tmp
t_1 = z * (x + y)
t_2 = t + (x + y)
t_3 = ((((y + t) * a) + t_1) - (y * b)) / (y + (x + t))
if ((t_3 <= (-4d+273)) .or. (.not. (t_3 <= 5d+290))) then
tmp = (z + a) - b
else
tmp = (a * ((y / t_2) + (t / t_2))) + ((t_1 - (y * b)) / 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 = z * (x + y);
double t_2 = t + (x + y);
double t_3 = ((((y + t) * a) + t_1) - (y * b)) / (y + (x + t));
double tmp;
if ((t_3 <= -4e+273) || !(t_3 <= 5e+290)) {
tmp = (z + a) - b;
} else {
tmp = (a * ((y / t_2) + (t / t_2))) + ((t_1 - (y * b)) / t_2);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (x + y) t_2 = t + (x + y) t_3 = ((((y + t) * a) + t_1) - (y * b)) / (y + (x + t)) tmp = 0 if (t_3 <= -4e+273) or not (t_3 <= 5e+290): tmp = (z + a) - b else: tmp = (a * ((y / t_2) + (t / t_2))) + ((t_1 - (y * b)) / t_2) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(x + y)) t_2 = Float64(t + Float64(x + y)) t_3 = Float64(Float64(Float64(Float64(Float64(y + t) * a) + t_1) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_3 <= -4e+273) || !(t_3 <= 5e+290)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(Float64(a * Float64(Float64(y / t_2) + Float64(t / t_2))) + Float64(Float64(t_1 - Float64(y * b)) / t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (x + y); t_2 = t + (x + y); t_3 = ((((y + t) * a) + t_1) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_3 <= -4e+273) || ~((t_3 <= 5e+290))) tmp = (z + a) - b; else tmp = (a * ((y / t_2) + (t / t_2))) + ((t_1 - (y * b)) / t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$3, -4e+273], N[Not[LessEqual[t$95$3, 5e+290]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(a * N[(N[(y / t$95$2), $MachinePrecision] + N[(t / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x + y\right)\\
t_2 := t + \left(x + y\right)\\
t_3 := \frac{\left(\left(y + t\right) \cdot a + t_1\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t_3 \leq -4 \cdot 10^{+273} \lor \neg \left(t_3 \leq 5 \cdot 10^{+290}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\frac{y}{t_2} + \frac{t}{t_2}\right) + \frac{t_1 - y \cdot b}{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)) < -3.99999999999999978e273 or 4.9999999999999998e290 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 7.9%
Taylor expanded in y around inf 68.9%
if -3.99999999999999978e273 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.9999999999999998e290Initial program 99.0%
Taylor expanded in a around 0 99.8%
associate--l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
div-sub99.7%
+-commutative99.7%
*-commutative99.7%
+-commutative99.7%
Simplified99.7%
Final simplification86.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- (+ (* (+ y t) a) (* z (+ x y))) (* y b)) (+ y (+ x t))))) (if (or (<= t_1 -4e+273) (not (<= t_1 5e+290))) (- (+ z a) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -4e+273) || !(t_1 <= 5e+290)) {
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 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t))
if ((t_1 <= (-4d+273)) .or. (.not. (t_1 <= 5d+290))) 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 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -4e+273) || !(t_1 <= 5e+290)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t)) tmp = 0 if (t_1 <= -4e+273) or not (t_1 <= 5e+290): tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(y + t) * a) + Float64(z * Float64(x + y))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_1 <= -4e+273) || !(t_1 <= 5e+290)) 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 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_1 <= -4e+273) || ~((t_1 <= 5e+290))) 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[(N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -4e+273], N[Not[LessEqual[t$95$1, 5e+290]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(y + t\right) \cdot a + z \cdot \left(x + y\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{+273} \lor \neg \left(t_1 \leq 5 \cdot 10^{+290}\right):\\
\;\;\;\;\left(z + a\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)) < -3.99999999999999978e273 or 4.9999999999999998e290 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 7.9%
Taylor expanded in y around inf 68.9%
if -3.99999999999999978e273 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.9999999999999998e290Initial program 99.0%
Final simplification86.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ (* t a) (* x z)) (+ x t)))
(t_2 (* (/ y (+ x (+ y t))) (+ a (- z b)))))
(if (<= y -22000.0)
t_2
(if (<= y -7.1e-128)
(- (+ a (/ (* y z) t)) (/ (* y b) t))
(if (<= y -4.4e-222)
(/ z (/ (+ t (+ x y)) (+ x y)))
(if (<= y 1.35e-301)
t_1
(if (<= y 5.5e-229)
(+ a (/ (* x z) (+ x t)))
(if (<= y 5.6e-171)
t_1
(if (<= y 1700000.0)
(/ (- (* z (+ x y)) (* y b)) (+ y (+ x t)))
t_2)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t * a) + (x * z)) / (x + t);
double t_2 = (y / (x + (y + t))) * (a + (z - b));
double tmp;
if (y <= -22000.0) {
tmp = t_2;
} else if (y <= -7.1e-128) {
tmp = (a + ((y * z) / t)) - ((y * b) / t);
} else if (y <= -4.4e-222) {
tmp = z / ((t + (x + y)) / (x + y));
} else if (y <= 1.35e-301) {
tmp = t_1;
} else if (y <= 5.5e-229) {
tmp = a + ((x * z) / (x + t));
} else if (y <= 5.6e-171) {
tmp = t_1;
} else if (y <= 1700000.0) {
tmp = ((z * (x + y)) - (y * b)) / (y + (x + t));
} 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 = ((t * a) + (x * z)) / (x + t)
t_2 = (y / (x + (y + t))) * (a + (z - b))
if (y <= (-22000.0d0)) then
tmp = t_2
else if (y <= (-7.1d-128)) then
tmp = (a + ((y * z) / t)) - ((y * b) / t)
else if (y <= (-4.4d-222)) then
tmp = z / ((t + (x + y)) / (x + y))
else if (y <= 1.35d-301) then
tmp = t_1
else if (y <= 5.5d-229) then
tmp = a + ((x * z) / (x + t))
else if (y <= 5.6d-171) then
tmp = t_1
else if (y <= 1700000.0d0) then
tmp = ((z * (x + y)) - (y * b)) / (y + (x + t))
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 = ((t * a) + (x * z)) / (x + t);
double t_2 = (y / (x + (y + t))) * (a + (z - b));
double tmp;
if (y <= -22000.0) {
tmp = t_2;
} else if (y <= -7.1e-128) {
tmp = (a + ((y * z) / t)) - ((y * b) / t);
} else if (y <= -4.4e-222) {
tmp = z / ((t + (x + y)) / (x + y));
} else if (y <= 1.35e-301) {
tmp = t_1;
} else if (y <= 5.5e-229) {
tmp = a + ((x * z) / (x + t));
} else if (y <= 5.6e-171) {
tmp = t_1;
} else if (y <= 1700000.0) {
tmp = ((z * (x + y)) - (y * b)) / (y + (x + t));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t * a) + (x * z)) / (x + t) t_2 = (y / (x + (y + t))) * (a + (z - b)) tmp = 0 if y <= -22000.0: tmp = t_2 elif y <= -7.1e-128: tmp = (a + ((y * z) / t)) - ((y * b) / t) elif y <= -4.4e-222: tmp = z / ((t + (x + y)) / (x + y)) elif y <= 1.35e-301: tmp = t_1 elif y <= 5.5e-229: tmp = a + ((x * z) / (x + t)) elif y <= 5.6e-171: tmp = t_1 elif y <= 1700000.0: tmp = ((z * (x + y)) - (y * b)) / (y + (x + t)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)) t_2 = Float64(Float64(y / Float64(x + Float64(y + t))) * Float64(a + Float64(z - b))) tmp = 0.0 if (y <= -22000.0) tmp = t_2; elseif (y <= -7.1e-128) tmp = Float64(Float64(a + Float64(Float64(y * z) / t)) - Float64(Float64(y * b) / t)); elseif (y <= -4.4e-222) tmp = Float64(z / Float64(Float64(t + Float64(x + y)) / Float64(x + y))); elseif (y <= 1.35e-301) tmp = t_1; elseif (y <= 5.5e-229) tmp = Float64(a + Float64(Float64(x * z) / Float64(x + t))); elseif (y <= 5.6e-171) tmp = t_1; elseif (y <= 1700000.0) tmp = Float64(Float64(Float64(z * Float64(x + y)) - Float64(y * b)) / Float64(y + Float64(x + t))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t * a) + (x * z)) / (x + t); t_2 = (y / (x + (y + t))) * (a + (z - b)); tmp = 0.0; if (y <= -22000.0) tmp = t_2; elseif (y <= -7.1e-128) tmp = (a + ((y * z) / t)) - ((y * b) / t); elseif (y <= -4.4e-222) tmp = z / ((t + (x + y)) / (x + y)); elseif (y <= 1.35e-301) tmp = t_1; elseif (y <= 5.5e-229) tmp = a + ((x * z) / (x + t)); elseif (y <= 5.6e-171) tmp = t_1; elseif (y <= 1700000.0) tmp = ((z * (x + y)) - (y * b)) / (y + (x + t)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -22000.0], t$95$2, If[LessEqual[y, -7.1e-128], N[(N[(a + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] - N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.4e-222], N[(z / N[(N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e-301], t$95$1, If[LessEqual[y, 5.5e-229], N[(a + N[(N[(x * z), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.6e-171], t$95$1, If[LessEqual[y, 1700000.0], N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot a + x \cdot z}{x + t}\\
t_2 := \frac{y}{x + \left(y + t\right)} \cdot \left(a + \left(z - b\right)\right)\\
\mathbf{if}\;y \leq -22000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -7.1 \cdot 10^{-128}:\\
\;\;\;\;\left(a + \frac{y \cdot z}{t}\right) - \frac{y \cdot b}{t}\\
\mathbf{elif}\;y \leq -4.4 \cdot 10^{-222}:\\
\;\;\;\;\frac{z}{\frac{t + \left(x + y\right)}{x + y}}\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-301}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-229}:\\
\;\;\;\;a + \frac{x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{-171}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1700000:\\
\;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -22000 or 1.7e6 < y Initial program 46.3%
Taylor expanded in y around inf 37.9%
expm1-log1p-u21.7%
expm1-udef11.5%
associate-/l*24.7%
+-commutative24.7%
+-commutative24.7%
associate--l+24.7%
Applied egg-rr24.7%
expm1-def33.5%
expm1-log1p75.3%
associate-/r/76.9%
associate-+r+76.9%
Simplified76.9%
if -22000 < y < -7.1000000000000002e-128Initial program 80.0%
Taylor expanded in t around inf 71.7%
associate-+r+71.7%
associate-/l*71.7%
+-commutative71.7%
associate-/l*71.6%
+-commutative71.6%
associate-/l*71.6%
Simplified71.6%
Taylor expanded in x around 0 76.0%
if -7.1000000000000002e-128 < y < -4.4e-222Initial program 65.1%
Taylor expanded in z around inf 50.8%
associate-/l*79.7%
+-commutative79.7%
+-commutative79.7%
Simplified79.7%
if -4.4e-222 < y < 1.35e-301 or 5.5000000000000001e-229 < y < 5.60000000000000046e-171Initial program 85.9%
Taylor expanded in y around 0 74.3%
if 1.35e-301 < y < 5.5000000000000001e-229Initial program 37.8%
Taylor expanded in z around 0 54.1%
associate--l+54.1%
div-sub54.1%
fma-def54.1%
+-commutative54.1%
+-commutative54.1%
div-sub54.1%
+-commutative54.1%
+-commutative54.1%
associate-+r+54.1%
*-commutative54.1%
+-commutative54.1%
associate-+r+54.1%
Simplified54.1%
Taylor expanded in t around inf 92.5%
Taylor expanded in y around 0 68.4%
*-commutative68.4%
+-commutative68.4%
Simplified68.4%
if 5.60000000000000046e-171 < y < 1.7e6Initial program 83.7%
Taylor expanded in a around 0 70.1%
+-commutative70.1%
*-commutative70.1%
Simplified70.1%
Final simplification75.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ (* t a) (* x z)) (+ x t)))
(t_2 (* (/ y (+ x (+ y t))) (+ a (- z b)))))
(if (<= y -2e+22)
t_2
(if (<= y -6.5e-126)
(+ a (/ y (/ (+ y t) z)))
(if (<= y -4.15e-224)
(/ z (/ (+ t (+ x y)) (+ x y)))
(if (<= y 6.1e-307)
t_1
(if (<= y 3.1e-233)
(+ a (/ (* x z) (+ x t)))
(if (<= y 4.9e-36) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t * a) + (x * z)) / (x + t);
double t_2 = (y / (x + (y + t))) * (a + (z - b));
double tmp;
if (y <= -2e+22) {
tmp = t_2;
} else if (y <= -6.5e-126) {
tmp = a + (y / ((y + t) / z));
} else if (y <= -4.15e-224) {
tmp = z / ((t + (x + y)) / (x + y));
} else if (y <= 6.1e-307) {
tmp = t_1;
} else if (y <= 3.1e-233) {
tmp = a + ((x * z) / (x + t));
} else if (y <= 4.9e-36) {
tmp = 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 = ((t * a) + (x * z)) / (x + t)
t_2 = (y / (x + (y + t))) * (a + (z - b))
if (y <= (-2d+22)) then
tmp = t_2
else if (y <= (-6.5d-126)) then
tmp = a + (y / ((y + t) / z))
else if (y <= (-4.15d-224)) then
tmp = z / ((t + (x + y)) / (x + y))
else if (y <= 6.1d-307) then
tmp = t_1
else if (y <= 3.1d-233) then
tmp = a + ((x * z) / (x + t))
else if (y <= 4.9d-36) then
tmp = 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 = ((t * a) + (x * z)) / (x + t);
double t_2 = (y / (x + (y + t))) * (a + (z - b));
double tmp;
if (y <= -2e+22) {
tmp = t_2;
} else if (y <= -6.5e-126) {
tmp = a + (y / ((y + t) / z));
} else if (y <= -4.15e-224) {
tmp = z / ((t + (x + y)) / (x + y));
} else if (y <= 6.1e-307) {
tmp = t_1;
} else if (y <= 3.1e-233) {
tmp = a + ((x * z) / (x + t));
} else if (y <= 4.9e-36) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t * a) + (x * z)) / (x + t) t_2 = (y / (x + (y + t))) * (a + (z - b)) tmp = 0 if y <= -2e+22: tmp = t_2 elif y <= -6.5e-126: tmp = a + (y / ((y + t) / z)) elif y <= -4.15e-224: tmp = z / ((t + (x + y)) / (x + y)) elif y <= 6.1e-307: tmp = t_1 elif y <= 3.1e-233: tmp = a + ((x * z) / (x + t)) elif y <= 4.9e-36: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)) t_2 = Float64(Float64(y / Float64(x + Float64(y + t))) * Float64(a + Float64(z - b))) tmp = 0.0 if (y <= -2e+22) tmp = t_2; elseif (y <= -6.5e-126) tmp = Float64(a + Float64(y / Float64(Float64(y + t) / z))); elseif (y <= -4.15e-224) tmp = Float64(z / Float64(Float64(t + Float64(x + y)) / Float64(x + y))); elseif (y <= 6.1e-307) tmp = t_1; elseif (y <= 3.1e-233) tmp = Float64(a + Float64(Float64(x * z) / Float64(x + t))); elseif (y <= 4.9e-36) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t * a) + (x * z)) / (x + t); t_2 = (y / (x + (y + t))) * (a + (z - b)); tmp = 0.0; if (y <= -2e+22) tmp = t_2; elseif (y <= -6.5e-126) tmp = a + (y / ((y + t) / z)); elseif (y <= -4.15e-224) tmp = z / ((t + (x + y)) / (x + y)); elseif (y <= 6.1e-307) tmp = t_1; elseif (y <= 3.1e-233) tmp = a + ((x * z) / (x + t)); elseif (y <= 4.9e-36) 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[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2e+22], t$95$2, If[LessEqual[y, -6.5e-126], N[(a + N[(y / N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.15e-224], N[(z / N[(N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.1e-307], t$95$1, If[LessEqual[y, 3.1e-233], N[(a + N[(N[(x * z), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.9e-36], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot a + x \cdot z}{x + t}\\
t_2 := \frac{y}{x + \left(y + t\right)} \cdot \left(a + \left(z - b\right)\right)\\
\mathbf{if}\;y \leq -2 \cdot 10^{+22}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-126}:\\
\;\;\;\;a + \frac{y}{\frac{y + t}{z}}\\
\mathbf{elif}\;y \leq -4.15 \cdot 10^{-224}:\\
\;\;\;\;\frac{z}{\frac{t + \left(x + y\right)}{x + y}}\\
\mathbf{elif}\;y \leq 6.1 \cdot 10^{-307}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-233}:\\
\;\;\;\;a + \frac{x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 4.9 \cdot 10^{-36}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -2e22 or 4.8999999999999997e-36 < y Initial program 48.6%
Taylor expanded in y around inf 39.8%
expm1-log1p-u23.4%
expm1-udef13.6%
associate-/l*25.6%
+-commutative25.6%
+-commutative25.6%
associate--l+25.6%
Applied egg-rr25.6%
expm1-def34.0%
expm1-log1p74.9%
associate-/r/76.4%
associate-+r+76.4%
Simplified76.4%
if -2e22 < y < -6.50000000000000014e-126Initial program 76.1%
Taylor expanded in z around 0 79.4%
associate--l+79.4%
div-sub79.4%
fma-def79.4%
+-commutative79.4%
+-commutative79.4%
div-sub79.4%
+-commutative79.4%
+-commutative79.4%
associate-+r+79.4%
*-commutative79.4%
+-commutative79.4%
associate-+r+79.4%
Simplified79.4%
Taylor expanded in t around inf 63.0%
Taylor expanded in x around 0 66.4%
associate-/l*66.3%
Simplified66.3%
if -6.50000000000000014e-126 < y < -4.14999999999999999e-224Initial program 65.1%
Taylor expanded in z around inf 50.8%
associate-/l*79.7%
+-commutative79.7%
+-commutative79.7%
Simplified79.7%
if -4.14999999999999999e-224 < y < 6.09999999999999974e-307 or 3.10000000000000015e-233 < y < 4.8999999999999997e-36Initial program 85.5%
Taylor expanded in y around 0 61.2%
if 6.09999999999999974e-307 < y < 3.10000000000000015e-233Initial program 37.8%
Taylor expanded in z around 0 54.1%
associate--l+54.1%
div-sub54.1%
fma-def54.1%
+-commutative54.1%
+-commutative54.1%
div-sub54.1%
+-commutative54.1%
+-commutative54.1%
associate-+r+54.1%
*-commutative54.1%
+-commutative54.1%
associate-+r+54.1%
Simplified54.1%
Taylor expanded in t around inf 92.5%
Taylor expanded in y around 0 68.4%
*-commutative68.4%
+-commutative68.4%
Simplified68.4%
Final simplification71.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ (* t a) (* x z)) (+ x t)))
(t_2 (* (/ y (+ x (+ y t))) (+ a (- z b)))))
(if (<= y -6800.0)
t_2
(if (<= y -1.22e-126)
(- (+ a (/ (* y z) t)) (/ (* y b) t))
(if (<= y -9e-223)
(/ z (/ (+ t (+ x y)) (+ x y)))
(if (<= y 1.06e-301)
t_1
(if (<= y 1.75e-233)
(+ a (/ (* x z) (+ x t)))
(if (<= y 2.2e-36) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t * a) + (x * z)) / (x + t);
double t_2 = (y / (x + (y + t))) * (a + (z - b));
double tmp;
if (y <= -6800.0) {
tmp = t_2;
} else if (y <= -1.22e-126) {
tmp = (a + ((y * z) / t)) - ((y * b) / t);
} else if (y <= -9e-223) {
tmp = z / ((t + (x + y)) / (x + y));
} else if (y <= 1.06e-301) {
tmp = t_1;
} else if (y <= 1.75e-233) {
tmp = a + ((x * z) / (x + t));
} else if (y <= 2.2e-36) {
tmp = 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 = ((t * a) + (x * z)) / (x + t)
t_2 = (y / (x + (y + t))) * (a + (z - b))
if (y <= (-6800.0d0)) then
tmp = t_2
else if (y <= (-1.22d-126)) then
tmp = (a + ((y * z) / t)) - ((y * b) / t)
else if (y <= (-9d-223)) then
tmp = z / ((t + (x + y)) / (x + y))
else if (y <= 1.06d-301) then
tmp = t_1
else if (y <= 1.75d-233) then
tmp = a + ((x * z) / (x + t))
else if (y <= 2.2d-36) then
tmp = 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 = ((t * a) + (x * z)) / (x + t);
double t_2 = (y / (x + (y + t))) * (a + (z - b));
double tmp;
if (y <= -6800.0) {
tmp = t_2;
} else if (y <= -1.22e-126) {
tmp = (a + ((y * z) / t)) - ((y * b) / t);
} else if (y <= -9e-223) {
tmp = z / ((t + (x + y)) / (x + y));
} else if (y <= 1.06e-301) {
tmp = t_1;
} else if (y <= 1.75e-233) {
tmp = a + ((x * z) / (x + t));
} else if (y <= 2.2e-36) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t * a) + (x * z)) / (x + t) t_2 = (y / (x + (y + t))) * (a + (z - b)) tmp = 0 if y <= -6800.0: tmp = t_2 elif y <= -1.22e-126: tmp = (a + ((y * z) / t)) - ((y * b) / t) elif y <= -9e-223: tmp = z / ((t + (x + y)) / (x + y)) elif y <= 1.06e-301: tmp = t_1 elif y <= 1.75e-233: tmp = a + ((x * z) / (x + t)) elif y <= 2.2e-36: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)) t_2 = Float64(Float64(y / Float64(x + Float64(y + t))) * Float64(a + Float64(z - b))) tmp = 0.0 if (y <= -6800.0) tmp = t_2; elseif (y <= -1.22e-126) tmp = Float64(Float64(a + Float64(Float64(y * z) / t)) - Float64(Float64(y * b) / t)); elseif (y <= -9e-223) tmp = Float64(z / Float64(Float64(t + Float64(x + y)) / Float64(x + y))); elseif (y <= 1.06e-301) tmp = t_1; elseif (y <= 1.75e-233) tmp = Float64(a + Float64(Float64(x * z) / Float64(x + t))); elseif (y <= 2.2e-36) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t * a) + (x * z)) / (x + t); t_2 = (y / (x + (y + t))) * (a + (z - b)); tmp = 0.0; if (y <= -6800.0) tmp = t_2; elseif (y <= -1.22e-126) tmp = (a + ((y * z) / t)) - ((y * b) / t); elseif (y <= -9e-223) tmp = z / ((t + (x + y)) / (x + y)); elseif (y <= 1.06e-301) tmp = t_1; elseif (y <= 1.75e-233) tmp = a + ((x * z) / (x + t)); elseif (y <= 2.2e-36) 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[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6800.0], t$95$2, If[LessEqual[y, -1.22e-126], N[(N[(a + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] - N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -9e-223], N[(z / N[(N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.06e-301], t$95$1, If[LessEqual[y, 1.75e-233], N[(a + N[(N[(x * z), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e-36], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot a + x \cdot z}{x + t}\\
t_2 := \frac{y}{x + \left(y + t\right)} \cdot \left(a + \left(z - b\right)\right)\\
\mathbf{if}\;y \leq -6800:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.22 \cdot 10^{-126}:\\
\;\;\;\;\left(a + \frac{y \cdot z}{t}\right) - \frac{y \cdot b}{t}\\
\mathbf{elif}\;y \leq -9 \cdot 10^{-223}:\\
\;\;\;\;\frac{z}{\frac{t + \left(x + y\right)}{x + y}}\\
\mathbf{elif}\;y \leq 1.06 \cdot 10^{-301}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{-233}:\\
\;\;\;\;a + \frac{x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-36}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -6800 or 2.1999999999999999e-36 < y Initial program 48.7%
Taylor expanded in y around inf 39.4%
expm1-log1p-u22.8%
expm1-udef13.3%
associate-/l*25.5%
+-commutative25.5%
+-commutative25.5%
associate--l+25.5%
Applied egg-rr25.5%
expm1-def33.7%
expm1-log1p74.3%
associate-/r/75.7%
associate-+r+75.7%
Simplified75.7%
if -6800 < y < -1.21999999999999996e-126Initial program 80.0%
Taylor expanded in t around inf 71.7%
associate-+r+71.7%
associate-/l*71.7%
+-commutative71.7%
associate-/l*71.6%
+-commutative71.6%
associate-/l*71.6%
Simplified71.6%
Taylor expanded in x around 0 76.0%
if -1.21999999999999996e-126 < y < -8.99999999999999935e-223Initial program 65.1%
Taylor expanded in z around inf 50.8%
associate-/l*79.7%
+-commutative79.7%
+-commutative79.7%
Simplified79.7%
if -8.99999999999999935e-223 < y < 1.06e-301 or 1.74999999999999995e-233 < y < 2.1999999999999999e-36Initial program 85.5%
Taylor expanded in y around 0 61.2%
if 1.06e-301 < y < 1.74999999999999995e-233Initial program 37.8%
Taylor expanded in z around 0 54.1%
associate--l+54.1%
div-sub54.1%
fma-def54.1%
+-commutative54.1%
+-commutative54.1%
div-sub54.1%
+-commutative54.1%
+-commutative54.1%
associate-+r+54.1%
*-commutative54.1%
+-commutative54.1%
associate-+r+54.1%
Simplified54.1%
Taylor expanded in t around inf 92.5%
Taylor expanded in y around 0 68.4%
*-commutative68.4%
+-commutative68.4%
Simplified68.4%
Final simplification72.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)) (t_2 (/ z (/ (+ t (+ x y)) (+ x y)))))
(if (<= y -2.1e+35)
t_1
(if (<= y -5.7e-132)
(+ a (/ y (/ (+ y t) z)))
(if (<= y -1.85e-222)
t_2
(if (<= y 1.35e-302)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 2.65e-232)
(+ a (/ (* x z) (+ x t)))
(if (<= y 4000.0) t_2 t_1))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = z / ((t + (x + y)) / (x + y));
double tmp;
if (y <= -2.1e+35) {
tmp = t_1;
} else if (y <= -5.7e-132) {
tmp = a + (y / ((y + t) / z));
} else if (y <= -1.85e-222) {
tmp = t_2;
} else if (y <= 1.35e-302) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 2.65e-232) {
tmp = a + ((x * z) / (x + t));
} else if (y <= 4000.0) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = (z + a) - b
t_2 = z / ((t + (x + y)) / (x + y))
if (y <= (-2.1d+35)) then
tmp = t_1
else if (y <= (-5.7d-132)) then
tmp = a + (y / ((y + t) / z))
else if (y <= (-1.85d-222)) then
tmp = t_2
else if (y <= 1.35d-302) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 2.65d-232) then
tmp = a + ((x * z) / (x + t))
else if (y <= 4000.0d0) then
tmp = t_2
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 t_2 = z / ((t + (x + y)) / (x + y));
double tmp;
if (y <= -2.1e+35) {
tmp = t_1;
} else if (y <= -5.7e-132) {
tmp = a + (y / ((y + t) / z));
} else if (y <= -1.85e-222) {
tmp = t_2;
} else if (y <= 1.35e-302) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 2.65e-232) {
tmp = a + ((x * z) / (x + t));
} else if (y <= 4000.0) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = z / ((t + (x + y)) / (x + y)) tmp = 0 if y <= -2.1e+35: tmp = t_1 elif y <= -5.7e-132: tmp = a + (y / ((y + t) / z)) elif y <= -1.85e-222: tmp = t_2 elif y <= 1.35e-302: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 2.65e-232: tmp = a + ((x * z) / (x + t)) elif y <= 4000.0: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) t_2 = Float64(z / Float64(Float64(t + Float64(x + y)) / Float64(x + y))) tmp = 0.0 if (y <= -2.1e+35) tmp = t_1; elseif (y <= -5.7e-132) tmp = Float64(a + Float64(y / Float64(Float64(y + t) / z))); elseif (y <= -1.85e-222) tmp = t_2; elseif (y <= 1.35e-302) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 2.65e-232) tmp = Float64(a + Float64(Float64(x * z) / Float64(x + t))); elseif (y <= 4000.0) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; t_2 = z / ((t + (x + y)) / (x + y)); tmp = 0.0; if (y <= -2.1e+35) tmp = t_1; elseif (y <= -5.7e-132) tmp = a + (y / ((y + t) / z)); elseif (y <= -1.85e-222) tmp = t_2; elseif (y <= 1.35e-302) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 2.65e-232) tmp = a + ((x * z) / (x + t)); elseif (y <= 4000.0) tmp = t_2; 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]}, Block[{t$95$2 = N[(z / N[(N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.1e+35], t$95$1, If[LessEqual[y, -5.7e-132], N[(a + N[(y / N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.85e-222], t$95$2, If[LessEqual[y, 1.35e-302], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.65e-232], N[(a + N[(N[(x * z), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4000.0], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := \frac{z}{\frac{t + \left(x + y\right)}{x + y}}\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{+35}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -5.7 \cdot 10^{-132}:\\
\;\;\;\;a + \frac{y}{\frac{y + t}{z}}\\
\mathbf{elif}\;y \leq -1.85 \cdot 10^{-222}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-302}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 2.65 \cdot 10^{-232}:\\
\;\;\;\;a + \frac{x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 4000:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -2.0999999999999999e35 or 4e3 < y Initial program 45.5%
Taylor expanded in y around inf 71.2%
if -2.0999999999999999e35 < y < -5.7000000000000002e-132Initial program 71.8%
Taylor expanded in z around 0 77.3%
associate--l+77.3%
div-sub77.3%
fma-def77.3%
+-commutative77.3%
+-commutative77.3%
div-sub77.3%
+-commutative77.3%
+-commutative77.3%
associate-+r+77.3%
*-commutative77.3%
+-commutative77.3%
associate-+r+77.3%
Simplified77.3%
Taylor expanded in t around inf 63.8%
Taylor expanded in x around 0 66.6%
associate-/l*66.5%
Simplified66.5%
if -5.7000000000000002e-132 < y < -1.8499999999999999e-222 or 2.6500000000000001e-232 < y < 4e3Initial program 80.1%
Taylor expanded in z around inf 44.1%
associate-/l*59.2%
+-commutative59.2%
+-commutative59.2%
Simplified59.2%
if -1.8499999999999999e-222 < y < 1.35000000000000003e-302Initial program 87.3%
Taylor expanded in y around 0 74.4%
if 1.35000000000000003e-302 < y < 2.6500000000000001e-232Initial program 37.8%
Taylor expanded in z around 0 54.1%
associate--l+54.1%
div-sub54.1%
fma-def54.1%
+-commutative54.1%
+-commutative54.1%
div-sub54.1%
+-commutative54.1%
+-commutative54.1%
associate-+r+54.1%
*-commutative54.1%
+-commutative54.1%
associate-+r+54.1%
Simplified54.1%
Taylor expanded in t around inf 92.5%
Taylor expanded in y around 0 68.4%
*-commutative68.4%
+-commutative68.4%
Simplified68.4%
Final simplification67.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)) (t_2 (+ a (/ y (/ (+ y t) z)))))
(if (<= x -4.1e+126)
z
(if (<= x -2.1e-250)
t_2
(if (<= x 5e-171)
t_1
(if (<= x 6.5e-104) t_2 (if (<= x 6.8e+184) t_1 z)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = a + (y / ((y + t) / z));
double tmp;
if (x <= -4.1e+126) {
tmp = z;
} else if (x <= -2.1e-250) {
tmp = t_2;
} else if (x <= 5e-171) {
tmp = t_1;
} else if (x <= 6.5e-104) {
tmp = t_2;
} else if (x <= 6.8e+184) {
tmp = t_1;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z + a) - b
t_2 = a + (y / ((y + t) / z))
if (x <= (-4.1d+126)) then
tmp = z
else if (x <= (-2.1d-250)) then
tmp = t_2
else if (x <= 5d-171) then
tmp = t_1
else if (x <= 6.5d-104) then
tmp = t_2
else if (x <= 6.8d+184) then
tmp = t_1
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 t_1 = (z + a) - b;
double t_2 = a + (y / ((y + t) / z));
double tmp;
if (x <= -4.1e+126) {
tmp = z;
} else if (x <= -2.1e-250) {
tmp = t_2;
} else if (x <= 5e-171) {
tmp = t_1;
} else if (x <= 6.5e-104) {
tmp = t_2;
} else if (x <= 6.8e+184) {
tmp = t_1;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = a + (y / ((y + t) / z)) tmp = 0 if x <= -4.1e+126: tmp = z elif x <= -2.1e-250: tmp = t_2 elif x <= 5e-171: tmp = t_1 elif x <= 6.5e-104: tmp = t_2 elif x <= 6.8e+184: tmp = t_1 else: tmp = z return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) t_2 = Float64(a + Float64(y / Float64(Float64(y + t) / z))) tmp = 0.0 if (x <= -4.1e+126) tmp = z; elseif (x <= -2.1e-250) tmp = t_2; elseif (x <= 5e-171) tmp = t_1; elseif (x <= 6.5e-104) tmp = t_2; elseif (x <= 6.8e+184) tmp = t_1; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; t_2 = a + (y / ((y + t) / z)); tmp = 0.0; if (x <= -4.1e+126) tmp = z; elseif (x <= -2.1e-250) tmp = t_2; elseif (x <= 5e-171) tmp = t_1; elseif (x <= 6.5e-104) tmp = t_2; elseif (x <= 6.8e+184) tmp = t_1; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$2 = N[(a + N[(y / N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.1e+126], z, If[LessEqual[x, -2.1e-250], t$95$2, If[LessEqual[x, 5e-171], t$95$1, If[LessEqual[x, 6.5e-104], t$95$2, If[LessEqual[x, 6.8e+184], t$95$1, z]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := a + \frac{y}{\frac{y + t}{z}}\\
\mathbf{if}\;x \leq -4.1 \cdot 10^{+126}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{-250}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-171}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-104}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{+184}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -4.1000000000000001e126 or 6.8000000000000003e184 < x Initial program 49.9%
Taylor expanded in x around inf 67.3%
if -4.1000000000000001e126 < x < -2.1000000000000001e-250 or 4.99999999999999992e-171 < x < 6.49999999999999991e-104Initial program 66.4%
Taylor expanded in z around 0 71.1%
associate--l+71.1%
div-sub71.1%
fma-def71.1%
+-commutative71.1%
+-commutative71.1%
div-sub71.1%
+-commutative71.1%
+-commutative71.1%
associate-+r+71.1%
*-commutative71.1%
+-commutative71.1%
associate-+r+71.1%
Simplified71.1%
Taylor expanded in t around inf 77.1%
Taylor expanded in x around 0 60.2%
associate-/l*68.9%
Simplified68.9%
if -2.1000000000000001e-250 < x < 4.99999999999999992e-171 or 6.49999999999999991e-104 < x < 6.8000000000000003e184Initial program 63.1%
Taylor expanded in y around inf 62.3%
Final simplification65.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -1.22e+35)
t_1
(if (<= y -2e-126)
(+ a (/ y (/ (+ y t) z)))
(if (<= y 55000.0) (/ z (/ (+ t (+ x y)) (+ x y))) 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.22e+35) {
tmp = t_1;
} else if (y <= -2e-126) {
tmp = a + (y / ((y + t) / z));
} else if (y <= 55000.0) {
tmp = z / ((t + (x + y)) / (x + y));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (y <= (-1.22d+35)) then
tmp = t_1
else if (y <= (-2d-126)) then
tmp = a + (y / ((y + t) / z))
else if (y <= 55000.0d0) then
tmp = z / ((t + (x + y)) / (x + y))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -1.22e+35) {
tmp = t_1;
} else if (y <= -2e-126) {
tmp = a + (y / ((y + t) / z));
} else if (y <= 55000.0) {
tmp = z / ((t + (x + y)) / (x + y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -1.22e+35: tmp = t_1 elif y <= -2e-126: tmp = a + (y / ((y + t) / z)) elif y <= 55000.0: tmp = z / ((t + (x + y)) / (x + y)) 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.22e+35) tmp = t_1; elseif (y <= -2e-126) tmp = Float64(a + Float64(y / Float64(Float64(y + t) / z))); elseif (y <= 55000.0) tmp = Float64(z / Float64(Float64(t + Float64(x + y)) / Float64(x + y))); 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.22e+35) tmp = t_1; elseif (y <= -2e-126) tmp = a + (y / ((y + t) / z)); elseif (y <= 55000.0) tmp = z / ((t + (x + y)) / (x + y)); 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.22e+35], t$95$1, If[LessEqual[y, -2e-126], N[(a + N[(y / N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 55000.0], N[(z / N[(N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.22 \cdot 10^{+35}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2 \cdot 10^{-126}:\\
\;\;\;\;a + \frac{y}{\frac{y + t}{z}}\\
\mathbf{elif}\;y \leq 55000:\\
\;\;\;\;\frac{z}{\frac{t + \left(x + y\right)}{x + y}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.21999999999999999e35 or 55000 < y Initial program 45.5%
Taylor expanded in y around inf 71.2%
if -1.21999999999999999e35 < y < -1.9999999999999999e-126Initial program 71.8%
Taylor expanded in z around 0 77.3%
associate--l+77.3%
div-sub77.3%
fma-def77.3%
+-commutative77.3%
+-commutative77.3%
div-sub77.3%
+-commutative77.3%
+-commutative77.3%
associate-+r+77.3%
*-commutative77.3%
+-commutative77.3%
associate-+r+77.3%
Simplified77.3%
Taylor expanded in t around inf 63.8%
Taylor expanded in x around 0 66.6%
associate-/l*66.5%
Simplified66.5%
if -1.9999999999999999e-126 < y < 55000Initial program 76.4%
Taylor expanded in z around inf 41.0%
associate-/l*54.6%
+-commutative54.6%
+-commutative54.6%
Simplified54.6%
Final simplification64.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x -5.5e+134) z (if (<= x 1.05e+184) (- (+ z a) b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -5.5e+134) {
tmp = z;
} else if (x <= 1.05e+184) {
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 <= (-5.5d+134)) then
tmp = z
else if (x <= 1.05d+184) 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 <= -5.5e+134) {
tmp = z;
} else if (x <= 1.05e+184) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -5.5e+134: tmp = z elif x <= 1.05e+184: tmp = (z + a) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -5.5e+134) tmp = z; elseif (x <= 1.05e+184) 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 <= -5.5e+134) tmp = z; elseif (x <= 1.05e+184) tmp = (z + a) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -5.5e+134], z, If[LessEqual[x, 1.05e+184], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{+134}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+184}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -5.4999999999999999e134 or 1.05e184 < x Initial program 50.5%
Taylor expanded in x around inf 66.8%
if -5.4999999999999999e134 < x < 1.05e184Initial program 64.2%
Taylor expanded in y around inf 56.3%
Final simplification59.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.2e-47) (not (<= a 5.2e-141))) (+ z a) (- z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.2e-47) || !(a <= 5.2e-141)) {
tmp = z + a;
} else {
tmp = 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 ((a <= (-1.2d-47)) .or. (.not. (a <= 5.2d-141))) then
tmp = z + a
else
tmp = 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 ((a <= -1.2e-47) || !(a <= 5.2e-141)) {
tmp = z + a;
} else {
tmp = z - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.2e-47) or not (a <= 5.2e-141): tmp = z + a else: tmp = z - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.2e-47) || !(a <= 5.2e-141)) tmp = Float64(z + a); else tmp = Float64(z - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.2e-47) || ~((a <= 5.2e-141))) tmp = z + a; else tmp = z - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.2e-47], N[Not[LessEqual[a, 5.2e-141]], $MachinePrecision]], N[(z + a), $MachinePrecision], N[(z - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.2 \cdot 10^{-47} \lor \neg \left(a \leq 5.2 \cdot 10^{-141}\right):\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;z - b\\
\end{array}
\end{array}
if a < -1.2e-47 or 5.20000000000000022e-141 < a Initial program 56.2%
Taylor expanded in y around inf 51.6%
Taylor expanded in b around 0 55.2%
if -1.2e-47 < a < 5.20000000000000022e-141Initial program 66.9%
Taylor expanded in y around inf 52.0%
Taylor expanded in a around 0 51.9%
Final simplification53.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t -4.5e+75) a (if (<= t 2.2e+31) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -4.5e+75) {
tmp = a;
} else if (t <= 2.2e+31) {
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 <= (-4.5d+75)) then
tmp = a
else if (t <= 2.2d+31) 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 <= -4.5e+75) {
tmp = a;
} else if (t <= 2.2e+31) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -4.5e+75: tmp = a elif t <= 2.2e+31: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -4.5e+75) tmp = a; elseif (t <= 2.2e+31) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -4.5e+75) tmp = a; elseif (t <= 2.2e+31) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -4.5e+75], a, If[LessEqual[t, 2.2e+31], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{+75}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{+31}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -4.5000000000000004e75 or 2.2000000000000001e31 < t Initial program 48.7%
Taylor expanded in t around inf 46.3%
if -4.5000000000000004e75 < t < 2.2000000000000001e31Initial program 67.8%
Taylor expanded in x around inf 52.7%
Final simplification50.3%
(FPCore (x y z t a b) :precision binary64 (+ z a))
double code(double x, double y, double z, double t, double a, double b) {
return z + 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 = z + a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return z + a;
}
def code(x, y, z, t, a, b): return z + a
function code(x, y, z, t, a, b) return Float64(z + a) end
function tmp = code(x, y, z, t, a, b) tmp = z + a; end
code[x_, y_, z_, t_, a_, b_] := N[(z + a), $MachinePrecision]
\begin{array}{l}
\\
z + a
\end{array}
Initial program 60.6%
Taylor expanded in y around inf 51.8%
Taylor expanded in b around 0 49.1%
Final simplification49.1%
(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 60.6%
Taylor expanded in t around inf 25.8%
Final simplification25.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))
(t_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 2023305
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:herbie-target
(if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3.5813117084150564e+153) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 1.2285964308315609e+82) (/ 1.0 (/ (+ (+ 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)))