
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
real(8) function code(x, y, z, t, a)
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
code = (x + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
real(8) function code(x, y, z, t, a)
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
code = (x + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (<= t -1.12e+142) (+ x (* (/ (- z a) t) y)) (+ x (* y (+ (/ (- t z) (- a t)) 1.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.12e+142) {
tmp = x + (((z - a) / t) * y);
} else {
tmp = x + (y * (((t - z) / (a - t)) + 1.0));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: tmp
if (t <= (-1.12d+142)) then
tmp = x + (((z - a) / t) * y)
else
tmp = x + (y * (((t - z) / (a - t)) + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.12e+142) {
tmp = x + (((z - a) / t) * y);
} else {
tmp = x + (y * (((t - z) / (a - t)) + 1.0));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.12e+142: tmp = x + (((z - a) / t) * y) else: tmp = x + (y * (((t - z) / (a - t)) + 1.0)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.12e+142) tmp = Float64(x + Float64(Float64(Float64(z - a) / t) * y)); else tmp = Float64(x + Float64(y * Float64(Float64(Float64(t - z) / Float64(a - t)) + 1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.12e+142) tmp = x + (((z - a) / t) * y); else tmp = x + (y * (((t - z) / (a - t)) + 1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.12e+142], N[(x + N[(N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.12 \cdot 10^{+142}:\\
\;\;\;\;x + \frac{z - a}{t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(\frac{t - z}{a - t} + 1\right)\\
\end{array}
\end{array}
if t < -1.11999999999999996e142Initial program 56.5%
sub-neg56.5%
associate-+l+62.7%
neg-mul-162.7%
associate-*l/70.3%
associate-*r*70.3%
distribute-rgt1-in70.3%
mul-1-neg70.3%
distribute-frac-neg70.3%
sub-neg70.3%
distribute-neg-in70.3%
remove-double-neg70.3%
+-commutative70.3%
sub-neg70.3%
Simplified70.3%
Taylor expanded in t around -inf 93.8%
if -1.11999999999999996e142 < t Initial program 79.4%
sub-neg79.4%
associate-+l+82.6%
neg-mul-182.6%
associate-*l/92.6%
associate-*r*92.6%
distribute-rgt1-in92.6%
mul-1-neg92.6%
distribute-frac-neg92.6%
sub-neg92.6%
distribute-neg-in92.6%
remove-double-neg92.6%
+-commutative92.6%
sub-neg92.6%
Simplified92.6%
Final simplification92.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- z a) t) y))) (t_2 (- x (/ y (/ a z)))))
(if (<= a -1.02e+139)
(+ x y)
(if (<= a -9.5e-40)
t_2
(if (<= a 1.55e-13)
t_1
(if (<= a 1.15e+54) t_2 (if (<= a 1.45e+140) t_1 (+ x y))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((z - a) / t) * y);
double t_2 = x - (y / (a / z));
double tmp;
if (a <= -1.02e+139) {
tmp = x + y;
} else if (a <= -9.5e-40) {
tmp = t_2;
} else if (a <= 1.55e-13) {
tmp = t_1;
} else if (a <= 1.15e+54) {
tmp = t_2;
} else if (a <= 1.45e+140) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (((z - a) / t) * y)
t_2 = x - (y / (a / z))
if (a <= (-1.02d+139)) then
tmp = x + y
else if (a <= (-9.5d-40)) then
tmp = t_2
else if (a <= 1.55d-13) then
tmp = t_1
else if (a <= 1.15d+54) then
tmp = t_2
else if (a <= 1.45d+140) then
tmp = t_1
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((z - a) / t) * y);
double t_2 = x - (y / (a / z));
double tmp;
if (a <= -1.02e+139) {
tmp = x + y;
} else if (a <= -9.5e-40) {
tmp = t_2;
} else if (a <= 1.55e-13) {
tmp = t_1;
} else if (a <= 1.15e+54) {
tmp = t_2;
} else if (a <= 1.45e+140) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((z - a) / t) * y) t_2 = x - (y / (a / z)) tmp = 0 if a <= -1.02e+139: tmp = x + y elif a <= -9.5e-40: tmp = t_2 elif a <= 1.55e-13: tmp = t_1 elif a <= 1.15e+54: tmp = t_2 elif a <= 1.45e+140: tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(z - a) / t) * y)) t_2 = Float64(x - Float64(y / Float64(a / z))) tmp = 0.0 if (a <= -1.02e+139) tmp = Float64(x + y); elseif (a <= -9.5e-40) tmp = t_2; elseif (a <= 1.55e-13) tmp = t_1; elseif (a <= 1.15e+54) tmp = t_2; elseif (a <= 1.45e+140) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((z - a) / t) * y); t_2 = x - (y / (a / z)); tmp = 0.0; if (a <= -1.02e+139) tmp = x + y; elseif (a <= -9.5e-40) tmp = t_2; elseif (a <= 1.55e-13) tmp = t_1; elseif (a <= 1.15e+54) tmp = t_2; elseif (a <= 1.45e+140) tmp = t_1; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.02e+139], N[(x + y), $MachinePrecision], If[LessEqual[a, -9.5e-40], t$95$2, If[LessEqual[a, 1.55e-13], t$95$1, If[LessEqual[a, 1.15e+54], t$95$2, If[LessEqual[a, 1.45e+140], t$95$1, N[(x + y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z - a}{t} \cdot y\\
t_2 := x - \frac{y}{\frac{a}{z}}\\
\mathbf{if}\;a \leq -1.02 \cdot 10^{+139}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -9.5 \cdot 10^{-40}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{+54}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{+140}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -1.02e139 or 1.4499999999999999e140 < a Initial program 76.2%
Taylor expanded in a around inf 83.6%
+-commutative83.6%
Simplified83.6%
if -1.02e139 < a < -9.5000000000000006e-40 or 1.55e-13 < a < 1.14999999999999997e54Initial program 85.1%
sub-neg85.1%
associate-+l+87.5%
neg-mul-187.5%
associate-*l/97.7%
associate-*r*97.7%
distribute-rgt1-in97.7%
mul-1-neg97.7%
distribute-frac-neg97.7%
sub-neg97.7%
distribute-neg-in97.7%
remove-double-neg97.7%
+-commutative97.7%
sub-neg97.7%
Simplified97.7%
Taylor expanded in z around inf 86.4%
associate-*r/86.4%
mul-1-neg86.4%
*-commutative86.4%
distribute-lft-neg-out86.4%
mul-1-neg86.4%
associate-/l*89.2%
mul-1-neg89.2%
Simplified89.2%
Taylor expanded in a around inf 78.0%
associate-/l*79.6%
associate-*r/79.6%
neg-mul-179.6%
Simplified79.6%
if -9.5000000000000006e-40 < a < 1.55e-13 or 1.14999999999999997e54 < a < 1.4499999999999999e140Initial program 73.5%
sub-neg73.5%
associate-+l+79.0%
neg-mul-179.0%
associate-*l/84.1%
associate-*r*84.1%
distribute-rgt1-in84.1%
mul-1-neg84.1%
distribute-frac-neg84.1%
sub-neg84.1%
distribute-neg-in84.1%
remove-double-neg84.1%
+-commutative84.1%
sub-neg84.1%
Simplified84.1%
Taylor expanded in t around -inf 86.4%
Final simplification84.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (/ y (/ a z)))))
(if (<= a -1.65e+139)
(+ x y)
(if (<= a -2.1e-39)
t_1
(if (<= a 1.2e-13)
(+ x (/ y (/ t (- z a))))
(if (<= a 2.1e+55)
t_1
(if (<= a 1.45e+140) (+ x (* (/ (- z a) t) y)) (+ x y))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y / (a / z));
double tmp;
if (a <= -1.65e+139) {
tmp = x + y;
} else if (a <= -2.1e-39) {
tmp = t_1;
} else if (a <= 1.2e-13) {
tmp = x + (y / (t / (z - a)));
} else if (a <= 2.1e+55) {
tmp = t_1;
} else if (a <= 1.45e+140) {
tmp = x + (((z - a) / t) * y);
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: tmp
t_1 = x - (y / (a / z))
if (a <= (-1.65d+139)) then
tmp = x + y
else if (a <= (-2.1d-39)) then
tmp = t_1
else if (a <= 1.2d-13) then
tmp = x + (y / (t / (z - a)))
else if (a <= 2.1d+55) then
tmp = t_1
else if (a <= 1.45d+140) then
tmp = x + (((z - a) / t) * y)
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y / (a / z));
double tmp;
if (a <= -1.65e+139) {
tmp = x + y;
} else if (a <= -2.1e-39) {
tmp = t_1;
} else if (a <= 1.2e-13) {
tmp = x + (y / (t / (z - a)));
} else if (a <= 2.1e+55) {
tmp = t_1;
} else if (a <= 1.45e+140) {
tmp = x + (((z - a) / t) * y);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y / (a / z)) tmp = 0 if a <= -1.65e+139: tmp = x + y elif a <= -2.1e-39: tmp = t_1 elif a <= 1.2e-13: tmp = x + (y / (t / (z - a))) elif a <= 2.1e+55: tmp = t_1 elif a <= 1.45e+140: tmp = x + (((z - a) / t) * y) else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y / Float64(a / z))) tmp = 0.0 if (a <= -1.65e+139) tmp = Float64(x + y); elseif (a <= -2.1e-39) tmp = t_1; elseif (a <= 1.2e-13) tmp = Float64(x + Float64(y / Float64(t / Float64(z - a)))); elseif (a <= 2.1e+55) tmp = t_1; elseif (a <= 1.45e+140) tmp = Float64(x + Float64(Float64(Float64(z - a) / t) * y)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y / (a / z)); tmp = 0.0; if (a <= -1.65e+139) tmp = x + y; elseif (a <= -2.1e-39) tmp = t_1; elseif (a <= 1.2e-13) tmp = x + (y / (t / (z - a))); elseif (a <= 2.1e+55) tmp = t_1; elseif (a <= 1.45e+140) tmp = x + (((z - a) / t) * y); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.65e+139], N[(x + y), $MachinePrecision], If[LessEqual[a, -2.1e-39], t$95$1, If[LessEqual[a, 1.2e-13], N[(x + N[(y / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.1e+55], t$95$1, If[LessEqual[a, 1.45e+140], N[(x + N[(N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{y}{\frac{a}{z}}\\
\mathbf{if}\;a \leq -1.65 \cdot 10^{+139}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -2.1 \cdot 10^{-39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{-13}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\
\mathbf{elif}\;a \leq 2.1 \cdot 10^{+55}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{+140}:\\
\;\;\;\;x + \frac{z - a}{t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -1.6500000000000001e139 or 1.4499999999999999e140 < a Initial program 76.2%
Taylor expanded in a around inf 83.6%
+-commutative83.6%
Simplified83.6%
if -1.6500000000000001e139 < a < -2.09999999999999993e-39 or 1.1999999999999999e-13 < a < 2.1000000000000001e55Initial program 85.1%
sub-neg85.1%
associate-+l+87.5%
neg-mul-187.5%
associate-*l/97.7%
associate-*r*97.7%
distribute-rgt1-in97.7%
mul-1-neg97.7%
distribute-frac-neg97.7%
sub-neg97.7%
distribute-neg-in97.7%
remove-double-neg97.7%
+-commutative97.7%
sub-neg97.7%
Simplified97.7%
Taylor expanded in z around inf 86.4%
associate-*r/86.4%
mul-1-neg86.4%
*-commutative86.4%
distribute-lft-neg-out86.4%
mul-1-neg86.4%
associate-/l*89.2%
mul-1-neg89.2%
Simplified89.2%
Taylor expanded in a around inf 78.0%
associate-/l*79.6%
associate-*r/79.6%
neg-mul-179.6%
Simplified79.6%
if -2.09999999999999993e-39 < a < 1.1999999999999999e-13Initial program 76.1%
sub-neg76.1%
associate-+l+82.2%
neg-mul-182.2%
associate-*l/84.8%
associate-*r*84.8%
distribute-rgt1-in84.8%
mul-1-neg84.8%
distribute-frac-neg84.8%
sub-neg84.8%
distribute-neg-in84.8%
remove-double-neg84.8%
+-commutative84.8%
sub-neg84.8%
Simplified84.8%
div-inv83.9%
*-commutative83.9%
Applied egg-rr83.9%
Taylor expanded in t around -inf 86.0%
associate-/l*87.5%
Simplified87.5%
if 2.1000000000000001e55 < a < 1.4499999999999999e140Initial program 48.4%
sub-neg48.4%
associate-+l+48.6%
neg-mul-148.6%
associate-*l/77.8%
associate-*r*77.8%
distribute-rgt1-in77.8%
mul-1-neg77.8%
distribute-frac-neg77.8%
sub-neg77.8%
distribute-neg-in77.8%
remove-double-neg77.8%
+-commutative77.8%
sub-neg77.8%
Simplified77.8%
Taylor expanded in t around -inf 78.2%
Final simplification84.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (/ y (/ a z)))))
(if (<= a -3.7e+139)
(+ x y)
(if (<= a -6.2e-40)
t_1
(if (<= a 9.5e-14)
(+ x (/ y (/ t (- z a))))
(if (<= a 2.3e+54)
t_1
(if (<= a 1.45e+140) (+ x (/ (- z a) (/ t y))) (+ x y))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y / (a / z));
double tmp;
if (a <= -3.7e+139) {
tmp = x + y;
} else if (a <= -6.2e-40) {
tmp = t_1;
} else if (a <= 9.5e-14) {
tmp = x + (y / (t / (z - a)));
} else if (a <= 2.3e+54) {
tmp = t_1;
} else if (a <= 1.45e+140) {
tmp = x + ((z - a) / (t / y));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: tmp
t_1 = x - (y / (a / z))
if (a <= (-3.7d+139)) then
tmp = x + y
else if (a <= (-6.2d-40)) then
tmp = t_1
else if (a <= 9.5d-14) then
tmp = x + (y / (t / (z - a)))
else if (a <= 2.3d+54) then
tmp = t_1
else if (a <= 1.45d+140) then
tmp = x + ((z - a) / (t / y))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y / (a / z));
double tmp;
if (a <= -3.7e+139) {
tmp = x + y;
} else if (a <= -6.2e-40) {
tmp = t_1;
} else if (a <= 9.5e-14) {
tmp = x + (y / (t / (z - a)));
} else if (a <= 2.3e+54) {
tmp = t_1;
} else if (a <= 1.45e+140) {
tmp = x + ((z - a) / (t / y));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y / (a / z)) tmp = 0 if a <= -3.7e+139: tmp = x + y elif a <= -6.2e-40: tmp = t_1 elif a <= 9.5e-14: tmp = x + (y / (t / (z - a))) elif a <= 2.3e+54: tmp = t_1 elif a <= 1.45e+140: tmp = x + ((z - a) / (t / y)) else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y / Float64(a / z))) tmp = 0.0 if (a <= -3.7e+139) tmp = Float64(x + y); elseif (a <= -6.2e-40) tmp = t_1; elseif (a <= 9.5e-14) tmp = Float64(x + Float64(y / Float64(t / Float64(z - a)))); elseif (a <= 2.3e+54) tmp = t_1; elseif (a <= 1.45e+140) tmp = Float64(x + Float64(Float64(z - a) / Float64(t / y))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y / (a / z)); tmp = 0.0; if (a <= -3.7e+139) tmp = x + y; elseif (a <= -6.2e-40) tmp = t_1; elseif (a <= 9.5e-14) tmp = x + (y / (t / (z - a))); elseif (a <= 2.3e+54) tmp = t_1; elseif (a <= 1.45e+140) tmp = x + ((z - a) / (t / y)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.7e+139], N[(x + y), $MachinePrecision], If[LessEqual[a, -6.2e-40], t$95$1, If[LessEqual[a, 9.5e-14], N[(x + N[(y / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.3e+54], t$95$1, If[LessEqual[a, 1.45e+140], N[(x + N[(N[(z - a), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{y}{\frac{a}{z}}\\
\mathbf{if}\;a \leq -3.7 \cdot 10^{+139}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -6.2 \cdot 10^{-40}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-14}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{+54}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{+140}:\\
\;\;\;\;x + \frac{z - a}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -3.69999999999999992e139 or 1.4499999999999999e140 < a Initial program 76.2%
Taylor expanded in a around inf 83.6%
+-commutative83.6%
Simplified83.6%
if -3.69999999999999992e139 < a < -6.20000000000000021e-40 or 9.4999999999999999e-14 < a < 2.29999999999999994e54Initial program 85.1%
sub-neg85.1%
associate-+l+87.5%
neg-mul-187.5%
associate-*l/97.7%
associate-*r*97.7%
distribute-rgt1-in97.7%
mul-1-neg97.7%
distribute-frac-neg97.7%
sub-neg97.7%
distribute-neg-in97.7%
remove-double-neg97.7%
+-commutative97.7%
sub-neg97.7%
Simplified97.7%
Taylor expanded in z around inf 86.4%
associate-*r/86.4%
mul-1-neg86.4%
*-commutative86.4%
distribute-lft-neg-out86.4%
mul-1-neg86.4%
associate-/l*89.2%
mul-1-neg89.2%
Simplified89.2%
Taylor expanded in a around inf 78.0%
associate-/l*79.6%
associate-*r/79.6%
neg-mul-179.6%
Simplified79.6%
if -6.20000000000000021e-40 < a < 9.4999999999999999e-14Initial program 76.1%
sub-neg76.1%
associate-+l+82.2%
neg-mul-182.2%
associate-*l/84.8%
associate-*r*84.8%
distribute-rgt1-in84.8%
mul-1-neg84.8%
distribute-frac-neg84.8%
sub-neg84.8%
distribute-neg-in84.8%
remove-double-neg84.8%
+-commutative84.8%
sub-neg84.8%
Simplified84.8%
div-inv83.9%
*-commutative83.9%
Applied egg-rr83.9%
Taylor expanded in t around -inf 86.0%
associate-/l*87.5%
Simplified87.5%
if 2.29999999999999994e54 < a < 1.4499999999999999e140Initial program 48.4%
sub-neg48.4%
associate-+l+48.6%
neg-mul-148.6%
associate-*l/77.8%
associate-*r*77.8%
distribute-rgt1-in77.8%
mul-1-neg77.8%
distribute-frac-neg77.8%
sub-neg77.8%
distribute-neg-in77.8%
remove-double-neg77.8%
+-commutative77.8%
sub-neg77.8%
Simplified77.8%
Taylor expanded in t around -inf 56.5%
*-commutative56.5%
associate-/l*78.2%
Simplified78.2%
Final simplification84.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ x y) (/ y (/ a z)))))
(if (<= a -0.0075)
t_1
(if (<= a 1.25e-13)
(+ x (/ y (/ t (- z a))))
(if (or (<= a 3.7e+88) (not (<= a 3.1e+126)))
t_1
(+ x (* (/ (- z a) t) y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (y / (a / z));
double tmp;
if (a <= -0.0075) {
tmp = t_1;
} else if (a <= 1.25e-13) {
tmp = x + (y / (t / (z - a)));
} else if ((a <= 3.7e+88) || !(a <= 3.1e+126)) {
tmp = t_1;
} else {
tmp = x + (((z - a) / t) * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: tmp
t_1 = (x + y) - (y / (a / z))
if (a <= (-0.0075d0)) then
tmp = t_1
else if (a <= 1.25d-13) then
tmp = x + (y / (t / (z - a)))
else if ((a <= 3.7d+88) .or. (.not. (a <= 3.1d+126))) then
tmp = t_1
else
tmp = x + (((z - a) / t) * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (y / (a / z));
double tmp;
if (a <= -0.0075) {
tmp = t_1;
} else if (a <= 1.25e-13) {
tmp = x + (y / (t / (z - a)));
} else if ((a <= 3.7e+88) || !(a <= 3.1e+126)) {
tmp = t_1;
} else {
tmp = x + (((z - a) / t) * y);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - (y / (a / z)) tmp = 0 if a <= -0.0075: tmp = t_1 elif a <= 1.25e-13: tmp = x + (y / (t / (z - a))) elif (a <= 3.7e+88) or not (a <= 3.1e+126): tmp = t_1 else: tmp = x + (((z - a) / t) * y) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(y / Float64(a / z))) tmp = 0.0 if (a <= -0.0075) tmp = t_1; elseif (a <= 1.25e-13) tmp = Float64(x + Float64(y / Float64(t / Float64(z - a)))); elseif ((a <= 3.7e+88) || !(a <= 3.1e+126)) tmp = t_1; else tmp = Float64(x + Float64(Float64(Float64(z - a) / t) * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - (y / (a / z)); tmp = 0.0; if (a <= -0.0075) tmp = t_1; elseif (a <= 1.25e-13) tmp = x + (y / (t / (z - a))); elseif ((a <= 3.7e+88) || ~((a <= 3.1e+126))) tmp = t_1; else tmp = x + (((z - a) / t) * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.0075], t$95$1, If[LessEqual[a, 1.25e-13], N[(x + N[(y / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 3.7e+88], N[Not[LessEqual[a, 3.1e+126]], $MachinePrecision]], t$95$1, N[(x + N[(N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{y}{\frac{a}{z}}\\
\mathbf{if}\;a \leq -0.0075:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{-13}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\
\mathbf{elif}\;a \leq 3.7 \cdot 10^{+88} \lor \neg \left(a \leq 3.1 \cdot 10^{+126}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - a}{t} \cdot y\\
\end{array}
\end{array}
if a < -0.0074999999999999997 or 1.24999999999999997e-13 < a < 3.69999999999999994e88 or 3.1e126 < a Initial program 80.6%
Taylor expanded in t around 0 81.9%
associate-/l*89.9%
Simplified89.9%
if -0.0074999999999999997 < a < 1.24999999999999997e-13Initial program 75.8%
sub-neg75.8%
associate-+l+81.8%
neg-mul-181.8%
associate-*l/85.7%
associate-*r*85.7%
distribute-rgt1-in85.7%
mul-1-neg85.7%
distribute-frac-neg85.7%
sub-neg85.7%
distribute-neg-in85.7%
remove-double-neg85.7%
+-commutative85.7%
sub-neg85.7%
Simplified85.7%
div-inv84.9%
*-commutative84.9%
Applied egg-rr84.9%
Taylor expanded in t around -inf 84.7%
associate-/l*86.1%
Simplified86.1%
if 3.69999999999999994e88 < a < 3.1e126Initial program 30.0%
sub-neg30.0%
associate-+l+30.4%
neg-mul-130.4%
associate-*l/58.9%
associate-*r*58.9%
distribute-rgt1-in58.9%
mul-1-neg58.9%
distribute-frac-neg58.9%
sub-neg58.9%
distribute-neg-in58.9%
remove-double-neg58.9%
+-commutative58.9%
sub-neg58.9%
Simplified58.9%
Taylor expanded in t around -inf 100.0%
Final simplification88.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ x y) (/ y (/ a z)))))
(if (<= a -1.45e-5)
t_1
(if (<= a 1.35e-13)
(+ x (/ y (/ t (- z a))))
(if (<= a 4e+88)
(- (+ x y) (/ z (/ a y)))
(if (<= a 3.1e+126) (+ x (* (/ (- z a) t) y)) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (y / (a / z));
double tmp;
if (a <= -1.45e-5) {
tmp = t_1;
} else if (a <= 1.35e-13) {
tmp = x + (y / (t / (z - a)));
} else if (a <= 4e+88) {
tmp = (x + y) - (z / (a / y));
} else if (a <= 3.1e+126) {
tmp = x + (((z - a) / t) * y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: tmp
t_1 = (x + y) - (y / (a / z))
if (a <= (-1.45d-5)) then
tmp = t_1
else if (a <= 1.35d-13) then
tmp = x + (y / (t / (z - a)))
else if (a <= 4d+88) then
tmp = (x + y) - (z / (a / y))
else if (a <= 3.1d+126) then
tmp = x + (((z - a) / t) * 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 t_1 = (x + y) - (y / (a / z));
double tmp;
if (a <= -1.45e-5) {
tmp = t_1;
} else if (a <= 1.35e-13) {
tmp = x + (y / (t / (z - a)));
} else if (a <= 4e+88) {
tmp = (x + y) - (z / (a / y));
} else if (a <= 3.1e+126) {
tmp = x + (((z - a) / t) * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - (y / (a / z)) tmp = 0 if a <= -1.45e-5: tmp = t_1 elif a <= 1.35e-13: tmp = x + (y / (t / (z - a))) elif a <= 4e+88: tmp = (x + y) - (z / (a / y)) elif a <= 3.1e+126: tmp = x + (((z - a) / t) * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(y / Float64(a / z))) tmp = 0.0 if (a <= -1.45e-5) tmp = t_1; elseif (a <= 1.35e-13) tmp = Float64(x + Float64(y / Float64(t / Float64(z - a)))); elseif (a <= 4e+88) tmp = Float64(Float64(x + y) - Float64(z / Float64(a / y))); elseif (a <= 3.1e+126) tmp = Float64(x + Float64(Float64(Float64(z - a) / t) * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - (y / (a / z)); tmp = 0.0; if (a <= -1.45e-5) tmp = t_1; elseif (a <= 1.35e-13) tmp = x + (y / (t / (z - a))); elseif (a <= 4e+88) tmp = (x + y) - (z / (a / y)); elseif (a <= 3.1e+126) tmp = x + (((z - a) / t) * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.45e-5], t$95$1, If[LessEqual[a, 1.35e-13], N[(x + N[(y / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4e+88], N[(N[(x + y), $MachinePrecision] - N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.1e+126], N[(x + N[(N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{y}{\frac{a}{z}}\\
\mathbf{if}\;a \leq -1.45 \cdot 10^{-5}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{-13}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\
\mathbf{elif}\;a \leq 4 \cdot 10^{+88}:\\
\;\;\;\;\left(x + y\right) - \frac{z}{\frac{a}{y}}\\
\mathbf{elif}\;a \leq 3.1 \cdot 10^{+126}:\\
\;\;\;\;x + \frac{z - a}{t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -1.45e-5 or 3.1e126 < a Initial program 79.3%
Taylor expanded in t around 0 81.0%
associate-/l*90.8%
Simplified90.8%
if -1.45e-5 < a < 1.35000000000000005e-13Initial program 75.8%
sub-neg75.8%
associate-+l+81.8%
neg-mul-181.8%
associate-*l/85.7%
associate-*r*85.7%
distribute-rgt1-in85.7%
mul-1-neg85.7%
distribute-frac-neg85.7%
sub-neg85.7%
distribute-neg-in85.7%
remove-double-neg85.7%
+-commutative85.7%
sub-neg85.7%
Simplified85.7%
div-inv84.9%
*-commutative84.9%
Applied egg-rr84.9%
Taylor expanded in t around -inf 84.7%
associate-/l*86.1%
Simplified86.1%
if 1.35000000000000005e-13 < a < 3.99999999999999984e88Initial program 86.5%
Taylor expanded in t around 0 85.8%
*-commutative85.8%
associate-/l*85.8%
Simplified85.8%
if 3.99999999999999984e88 < a < 3.1e126Initial program 30.0%
sub-neg30.0%
associate-+l+30.4%
neg-mul-130.4%
associate-*l/58.9%
associate-*r*58.9%
distribute-rgt1-in58.9%
mul-1-neg58.9%
distribute-frac-neg58.9%
sub-neg58.9%
distribute-neg-in58.9%
remove-double-neg58.9%
+-commutative58.9%
sub-neg58.9%
Simplified58.9%
Taylor expanded in t around -inf 100.0%
Final simplification88.2%
(FPCore (x y z t a)
:precision binary64
(if (<= a -7e+136)
(+ x y)
(if (<= a -7e-40)
(- x (/ y (/ a z)))
(if (<= a 1.45e+140) (+ x (* y (/ z t))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7e+136) {
tmp = x + y;
} else if (a <= -7e-40) {
tmp = x - (y / (a / z));
} else if (a <= 1.45e+140) {
tmp = x + (y * (z / t));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: tmp
if (a <= (-7d+136)) then
tmp = x + y
else if (a <= (-7d-40)) then
tmp = x - (y / (a / z))
else if (a <= 1.45d+140) then
tmp = x + (y * (z / t))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7e+136) {
tmp = x + y;
} else if (a <= -7e-40) {
tmp = x - (y / (a / z));
} else if (a <= 1.45e+140) {
tmp = x + (y * (z / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -7e+136: tmp = x + y elif a <= -7e-40: tmp = x - (y / (a / z)) elif a <= 1.45e+140: tmp = x + (y * (z / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7e+136) tmp = Float64(x + y); elseif (a <= -7e-40) tmp = Float64(x - Float64(y / Float64(a / z))); elseif (a <= 1.45e+140) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -7e+136) tmp = x + y; elseif (a <= -7e-40) tmp = x - (y / (a / z)); elseif (a <= 1.45e+140) tmp = x + (y * (z / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -7e+136], N[(x + y), $MachinePrecision], If[LessEqual[a, -7e-40], N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.45e+140], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7 \cdot 10^{+136}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -7 \cdot 10^{-40}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{+140}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -7.00000000000000002e136 or 1.4499999999999999e140 < a Initial program 76.2%
Taylor expanded in a around inf 83.6%
+-commutative83.6%
Simplified83.6%
if -7.00000000000000002e136 < a < -7.0000000000000003e-40Initial program 83.5%
sub-neg83.5%
associate-+l+86.9%
neg-mul-186.9%
associate-*l/96.8%
associate-*r*96.8%
distribute-rgt1-in96.8%
mul-1-neg96.8%
distribute-frac-neg96.8%
sub-neg96.8%
distribute-neg-in96.8%
remove-double-neg96.8%
+-commutative96.8%
sub-neg96.8%
Simplified96.8%
Taylor expanded in z around inf 89.9%
associate-*r/89.9%
mul-1-neg89.9%
*-commutative89.9%
distribute-lft-neg-out89.9%
mul-1-neg89.9%
associate-/l*91.6%
mul-1-neg91.6%
Simplified91.6%
Taylor expanded in a around inf 80.5%
associate-/l*82.9%
associate-*r/82.9%
neg-mul-182.9%
Simplified82.9%
if -7.0000000000000003e-40 < a < 1.4499999999999999e140Initial program 75.2%
sub-neg75.2%
associate-+l+80.1%
neg-mul-180.1%
associate-*l/85.9%
associate-*r*85.9%
distribute-rgt1-in85.9%
mul-1-neg85.9%
distribute-frac-neg85.9%
sub-neg85.9%
distribute-neg-in85.9%
remove-double-neg85.9%
+-commutative85.9%
sub-neg85.9%
Simplified85.9%
Taylor expanded in a around 0 79.4%
Final simplification81.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.4e+137) (not (<= a 1.68e+128))) (- (+ x y) (/ y (/ a z))) (- x (/ z (/ (- a t) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.4e+137) || !(a <= 1.68e+128)) {
tmp = (x + y) - (y / (a / z));
} else {
tmp = x - (z / ((a - t) / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: tmp
if ((a <= (-2.4d+137)) .or. (.not. (a <= 1.68d+128))) then
tmp = (x + y) - (y / (a / z))
else
tmp = x - (z / ((a - t) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.4e+137) || !(a <= 1.68e+128)) {
tmp = (x + y) - (y / (a / z));
} else {
tmp = x - (z / ((a - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.4e+137) or not (a <= 1.68e+128): tmp = (x + y) - (y / (a / z)) else: tmp = x - (z / ((a - t) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.4e+137) || !(a <= 1.68e+128)) tmp = Float64(Float64(x + y) - Float64(y / Float64(a / z))); else tmp = Float64(x - Float64(z / Float64(Float64(a - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.4e+137) || ~((a <= 1.68e+128))) tmp = (x + y) - (y / (a / z)); else tmp = x - (z / ((a - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.4e+137], N[Not[LessEqual[a, 1.68e+128]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.4 \cdot 10^{+137} \lor \neg \left(a \leq 1.68 \cdot 10^{+128}\right):\\
\;\;\;\;\left(x + y\right) - \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z}{\frac{a - t}{y}}\\
\end{array}
\end{array}
if a < -2.39999999999999983e137 or 1.67999999999999993e128 < a Initial program 76.6%
Taylor expanded in t around 0 80.1%
associate-/l*92.2%
Simplified92.2%
if -2.39999999999999983e137 < a < 1.67999999999999993e128Initial program 76.8%
sub-neg76.8%
associate-+l+81.4%
neg-mul-181.4%
associate-*l/88.0%
associate-*r*88.0%
distribute-rgt1-in88.1%
mul-1-neg88.1%
distribute-frac-neg88.1%
sub-neg88.1%
distribute-neg-in88.1%
remove-double-neg88.1%
+-commutative88.1%
sub-neg88.1%
Simplified88.1%
Taylor expanded in z around inf 85.4%
associate-*r/85.4%
mul-1-neg85.4%
*-commutative85.4%
distribute-lft-neg-out85.4%
mul-1-neg85.4%
associate-/l*87.5%
mul-1-neg87.5%
Simplified87.5%
Final simplification88.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -7.6e+96) (not (<= a 5.4e+142))) (+ x y) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7.6e+96) || !(a <= 5.4e+142)) {
tmp = x + y;
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: tmp
if ((a <= (-7.6d+96)) .or. (.not. (a <= 5.4d+142))) then
tmp = x + y
else
tmp = x + (y * (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7.6e+96) || !(a <= 5.4e+142)) {
tmp = x + y;
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -7.6e+96) or not (a <= 5.4e+142): tmp = x + y else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -7.6e+96) || !(a <= 5.4e+142)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -7.6e+96) || ~((a <= 5.4e+142))) tmp = x + y; else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -7.6e+96], N[Not[LessEqual[a, 5.4e+142]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.6 \cdot 10^{+96} \lor \neg \left(a \leq 5.4 \cdot 10^{+142}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if a < -7.6000000000000003e96 or 5.39999999999999965e142 < a Initial program 76.6%
Taylor expanded in a around inf 82.9%
+-commutative82.9%
Simplified82.9%
if -7.6000000000000003e96 < a < 5.39999999999999965e142Initial program 76.8%
sub-neg76.8%
associate-+l+81.6%
neg-mul-181.6%
associate-*l/88.1%
associate-*r*88.1%
distribute-rgt1-in88.1%
mul-1-neg88.1%
distribute-frac-neg88.1%
sub-neg88.1%
distribute-neg-in88.1%
remove-double-neg88.1%
+-commutative88.1%
sub-neg88.1%
Simplified88.1%
Taylor expanded in a around 0 75.8%
Final simplification77.8%
(FPCore (x y z t a) :precision binary64 (if (<= t 2.1e+174) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2.1e+174) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: tmp
if (t <= 2.1d+174) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2.1e+174) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 2.1e+174: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 2.1e+174) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 2.1e+174) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 2.1e+174], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.1 \cdot 10^{+174}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < 2.10000000000000017e174Initial program 82.5%
Taylor expanded in a around inf 62.7%
+-commutative62.7%
Simplified62.7%
if 2.10000000000000017e174 < t Initial program 32.0%
Taylor expanded in x around inf 68.1%
Final simplification63.3%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
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
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 76.7%
Taylor expanded in x around inf 53.7%
Final simplification53.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)))
(t_2 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (< t_2 -1.3664970889390727e-7)
t_1
(if (< t_2 1.4754293444577233e-239)
(/ (- (* y (- a z)) (* x t)) (- a t))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y + x) - (((z - t) * (1.0d0 / (a - t))) * y)
t_2 = (x + y) - (((z - t) * y) / (a - t))
if (t_2 < (-1.3664970889390727d-7)) then
tmp = t_1
else if (t_2 < 1.4754293444577233d-239) then
tmp = ((y * (a - z)) - (x * t)) / (a - 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 t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y) t_2 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_2 < -1.3664970889390727e-7: tmp = t_1 elif t_2 < 1.4754293444577233e-239: tmp = ((y * (a - z)) - (x * t)) / (a - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y + x) - Float64(Float64(Float64(z - t) * Float64(1.0 / Float64(a - t))) * y)) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = Float64(Float64(Float64(y * Float64(a - z)) - Float64(x * t)) / Float64(a - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y); t_2 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = ((y * (a - z)) - (x * t)) / (a - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -1.3664970889390727e-7], t$95$1, If[Less[t$95$2, 1.4754293444577233e-239], N[(N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t_2 < -1.3664970889390727 \cdot 10^{-7}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 < 1.4754293444577233 \cdot 10^{-239}:\\
\;\;\;\;\frac{y \cdot \left(a - z\right) - x \cdot t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023301
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-7) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))