
(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 15 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
(let* ((t_1 (+ (+ x y) (/ (* y (- t z)) (- a t)))))
(if (or (<= t_1 -5e-204) (not (<= t_1 1e-303)))
(+ x (+ y (/ (- t z) (/ (- a t) y))))
(+ (- x (/ y (/ t a))) (/ y (/ t z))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if ((t_1 <= -5e-204) || !(t_1 <= 1e-303)) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else {
tmp = (x - (y / (t / a))) + (y / (t / z));
}
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 * (t - z)) / (a - t))
if ((t_1 <= (-5d-204)) .or. (.not. (t_1 <= 1d-303))) then
tmp = x + (y + ((t - z) / ((a - t) / y)))
else
tmp = (x - (y / (t / a))) + (y / (t / z))
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 * (t - z)) / (a - t));
double tmp;
if ((t_1 <= -5e-204) || !(t_1 <= 1e-303)) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else {
tmp = (x - (y / (t / a))) + (y / (t / z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) + ((y * (t - z)) / (a - t)) tmp = 0 if (t_1 <= -5e-204) or not (t_1 <= 1e-303): tmp = x + (y + ((t - z) / ((a - t) / y))) else: tmp = (x - (y / (t / a))) + (y / (t / z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) + Float64(Float64(y * Float64(t - z)) / Float64(a - t))) tmp = 0.0 if ((t_1 <= -5e-204) || !(t_1 <= 1e-303)) tmp = Float64(x + Float64(y + Float64(Float64(t - z) / Float64(Float64(a - t) / y)))); else tmp = Float64(Float64(x - Float64(y / Float64(t / a))) + Float64(y / Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) + ((y * (t - z)) / (a - t)); tmp = 0.0; if ((t_1 <= -5e-204) || ~((t_1 <= 1e-303))) tmp = x + (y + ((t - z) / ((a - t) / y))); else tmp = (x - (y / (t / a))) + (y / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e-204], N[Not[LessEqual[t$95$1, 1e-303]], $MachinePrecision]], N[(x + N[(y + N[(N[(t - z), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(y / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t}\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{-204} \lor \neg \left(t_1 \leq 10^{-303}\right):\\
\;\;\;\;x + \left(y + \frac{t - z}{\frac{a - t}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{\frac{t}{a}}\right) + \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -5.0000000000000002e-204 or 9.99999999999999931e-304 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 83.6%
associate--l+83.9%
associate-/l*93.1%
Simplified93.1%
if -5.0000000000000002e-204 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 9.99999999999999931e-304Initial program 7.2%
associate--l+38.8%
associate-/l*22.4%
Simplified22.4%
Taylor expanded in t around inf 99.8%
sub-neg99.8%
+-commutative99.8%
mul-1-neg99.8%
unsub-neg99.8%
associate-/l*99.8%
mul-1-neg99.8%
remove-double-neg99.8%
associate-/l*99.9%
Simplified99.9%
Final simplification94.0%
(FPCore (x y z t a)
:precision binary64
(if (or (<= a -3.5e-12)
(not
(or (<= a 4.1e-143)
(and (not (<= a 2.9e-120))
(or (<= a 4e+55)
(and (not (<= a 1.95e+126)) (<= a 8e+154)))))))
(+ y (- x (/ y (/ a z))))
(- x (* (- a z) (/ y t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.5e-12) || !((a <= 4.1e-143) || (!(a <= 2.9e-120) && ((a <= 4e+55) || (!(a <= 1.95e+126) && (a <= 8e+154)))))) {
tmp = y + (x - (y / (a / z)));
} else {
tmp = x - ((a - z) * (y / 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 <= (-3.5d-12)) .or. (.not. (a <= 4.1d-143) .or. (.not. (a <= 2.9d-120)) .and. (a <= 4d+55) .or. (.not. (a <= 1.95d+126)) .and. (a <= 8d+154))) then
tmp = y + (x - (y / (a / z)))
else
tmp = x - ((a - z) * (y / 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 <= -3.5e-12) || !((a <= 4.1e-143) || (!(a <= 2.9e-120) && ((a <= 4e+55) || (!(a <= 1.95e+126) && (a <= 8e+154)))))) {
tmp = y + (x - (y / (a / z)));
} else {
tmp = x - ((a - z) * (y / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.5e-12) or not ((a <= 4.1e-143) or (not (a <= 2.9e-120) and ((a <= 4e+55) or (not (a <= 1.95e+126) and (a <= 8e+154))))): tmp = y + (x - (y / (a / z))) else: tmp = x - ((a - z) * (y / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.5e-12) || !((a <= 4.1e-143) || (!(a <= 2.9e-120) && ((a <= 4e+55) || (!(a <= 1.95e+126) && (a <= 8e+154)))))) tmp = Float64(y + Float64(x - Float64(y / Float64(a / z)))); else tmp = Float64(x - Float64(Float64(a - z) * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3.5e-12) || ~(((a <= 4.1e-143) || (~((a <= 2.9e-120)) && ((a <= 4e+55) || (~((a <= 1.95e+126)) && (a <= 8e+154))))))) tmp = y + (x - (y / (a / z))); else tmp = x - ((a - z) * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.5e-12], N[Not[Or[LessEqual[a, 4.1e-143], And[N[Not[LessEqual[a, 2.9e-120]], $MachinePrecision], Or[LessEqual[a, 4e+55], And[N[Not[LessEqual[a, 1.95e+126]], $MachinePrecision], LessEqual[a, 8e+154]]]]]], $MachinePrecision]], N[(y + N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(a - z), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.5 \cdot 10^{-12} \lor \neg \left(a \leq 4.1 \cdot 10^{-143} \lor \neg \left(a \leq 2.9 \cdot 10^{-120}\right) \land \left(a \leq 4 \cdot 10^{+55} \lor \neg \left(a \leq 1.95 \cdot 10^{+126}\right) \land a \leq 8 \cdot 10^{+154}\right)\right):\\
\;\;\;\;y + \left(x - \frac{y}{\frac{a}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;x - \left(a - z\right) \cdot \frac{y}{t}\\
\end{array}
\end{array}
if a < -3.5e-12 or 4.1e-143 < a < 2.9e-120 or 4.00000000000000004e55 < a < 1.94999999999999997e126 or 8.0000000000000003e154 < a Initial program 77.1%
associate--l+79.0%
sub-neg79.0%
+-commutative79.0%
associate-/l*89.6%
distribute-neg-frac89.6%
associate-/r/90.8%
fma-def90.8%
sub-neg90.8%
+-commutative90.8%
distribute-neg-in90.8%
unsub-neg90.8%
remove-double-neg90.8%
Simplified90.8%
Taylor expanded in t around 0 80.2%
mul-1-neg80.2%
sub-neg80.2%
associate-/l*87.4%
Simplified87.4%
if -3.5e-12 < a < 4.1e-143 or 2.9e-120 < a < 4.00000000000000004e55 or 1.94999999999999997e126 < a < 8.0000000000000003e154Initial program 70.1%
associate--l+77.0%
associate-/l*78.3%
Simplified78.3%
Taylor expanded in t around -inf 85.5%
+-commutative85.5%
sub-neg85.5%
mul-1-neg85.5%
+-commutative85.5%
*-commutative85.5%
+-commutative85.5%
*-commutative85.5%
mul-1-neg85.5%
unsub-neg85.5%
mul-1-neg85.5%
sub-neg85.5%
distribute-lft-out--85.5%
Simplified85.5%
Taylor expanded in a around 0 84.7%
mul-1-neg84.7%
sub-neg84.7%
div-sub85.5%
distribute-lft-out--85.5%
*-commutative85.5%
associate-*r/87.9%
Simplified87.9%
Final simplification87.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* (- a z) (/ y t)))) (t_2 (+ y (- x (/ y (/ a z))))))
(if (<= a -2.6e-12)
t_2
(if (<= a 4.1e-143)
t_1
(if (<= a 2.4e-120)
t_2
(if (<= a 1.85e+55)
t_1
(if (<= a 2.2e+126)
t_2
(if (<= a 8e+154) t_1 (- (+ x y) (* y (/ z a)))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((a - z) * (y / t));
double t_2 = y + (x - (y / (a / z)));
double tmp;
if (a <= -2.6e-12) {
tmp = t_2;
} else if (a <= 4.1e-143) {
tmp = t_1;
} else if (a <= 2.4e-120) {
tmp = t_2;
} else if (a <= 1.85e+55) {
tmp = t_1;
} else if (a <= 2.2e+126) {
tmp = t_2;
} else if (a <= 8e+154) {
tmp = t_1;
} else {
tmp = (x + y) - (y * (z / a));
}
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 - ((a - z) * (y / t))
t_2 = y + (x - (y / (a / z)))
if (a <= (-2.6d-12)) then
tmp = t_2
else if (a <= 4.1d-143) then
tmp = t_1
else if (a <= 2.4d-120) then
tmp = t_2
else if (a <= 1.85d+55) then
tmp = t_1
else if (a <= 2.2d+126) then
tmp = t_2
else if (a <= 8d+154) then
tmp = t_1
else
tmp = (x + y) - (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((a - z) * (y / t));
double t_2 = y + (x - (y / (a / z)));
double tmp;
if (a <= -2.6e-12) {
tmp = t_2;
} else if (a <= 4.1e-143) {
tmp = t_1;
} else if (a <= 2.4e-120) {
tmp = t_2;
} else if (a <= 1.85e+55) {
tmp = t_1;
} else if (a <= 2.2e+126) {
tmp = t_2;
} else if (a <= 8e+154) {
tmp = t_1;
} else {
tmp = (x + y) - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - ((a - z) * (y / t)) t_2 = y + (x - (y / (a / z))) tmp = 0 if a <= -2.6e-12: tmp = t_2 elif a <= 4.1e-143: tmp = t_1 elif a <= 2.4e-120: tmp = t_2 elif a <= 1.85e+55: tmp = t_1 elif a <= 2.2e+126: tmp = t_2 elif a <= 8e+154: tmp = t_1 else: tmp = (x + y) - (y * (z / a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(a - z) * Float64(y / t))) t_2 = Float64(y + Float64(x - Float64(y / Float64(a / z)))) tmp = 0.0 if (a <= -2.6e-12) tmp = t_2; elseif (a <= 4.1e-143) tmp = t_1; elseif (a <= 2.4e-120) tmp = t_2; elseif (a <= 1.85e+55) tmp = t_1; elseif (a <= 2.2e+126) tmp = t_2; elseif (a <= 8e+154) tmp = t_1; else tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - ((a - z) * (y / t)); t_2 = y + (x - (y / (a / z))); tmp = 0.0; if (a <= -2.6e-12) tmp = t_2; elseif (a <= 4.1e-143) tmp = t_1; elseif (a <= 2.4e-120) tmp = t_2; elseif (a <= 1.85e+55) tmp = t_1; elseif (a <= 2.2e+126) tmp = t_2; elseif (a <= 8e+154) tmp = t_1; else tmp = (x + y) - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(a - z), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.6e-12], t$95$2, If[LessEqual[a, 4.1e-143], t$95$1, If[LessEqual[a, 2.4e-120], t$95$2, If[LessEqual[a, 1.85e+55], t$95$1, If[LessEqual[a, 2.2e+126], t$95$2, If[LessEqual[a, 8e+154], t$95$1, N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \left(a - z\right) \cdot \frac{y}{t}\\
t_2 := y + \left(x - \frac{y}{\frac{a}{z}}\right)\\
\mathbf{if}\;a \leq -2.6 \cdot 10^{-12}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 4.1 \cdot 10^{-143}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{-120}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 1.85 \cdot 10^{+55}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.2 \cdot 10^{+126}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 8 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if a < -2.59999999999999983e-12 or 4.1e-143 < a < 2.3999999999999999e-120 or 1.8500000000000001e55 < a < 2.19999999999999999e126Initial program 81.4%
associate--l+82.8%
sub-neg82.8%
+-commutative82.8%
associate-/l*89.0%
distribute-neg-frac89.0%
associate-/r/89.6%
fma-def89.6%
sub-neg89.6%
+-commutative89.6%
distribute-neg-in89.6%
unsub-neg89.6%
remove-double-neg89.6%
Simplified89.6%
Taylor expanded in t around 0 83.5%
mul-1-neg83.5%
sub-neg83.5%
associate-/l*86.6%
Simplified86.6%
if -2.59999999999999983e-12 < a < 4.1e-143 or 2.3999999999999999e-120 < a < 1.8500000000000001e55 or 2.19999999999999999e126 < a < 8.0000000000000003e154Initial program 70.1%
associate--l+77.0%
associate-/l*78.3%
Simplified78.3%
Taylor expanded in t around -inf 85.5%
+-commutative85.5%
sub-neg85.5%
mul-1-neg85.5%
+-commutative85.5%
*-commutative85.5%
+-commutative85.5%
*-commutative85.5%
mul-1-neg85.5%
unsub-neg85.5%
mul-1-neg85.5%
sub-neg85.5%
distribute-lft-out--85.5%
Simplified85.5%
Taylor expanded in a around 0 84.7%
mul-1-neg84.7%
sub-neg84.7%
div-sub85.5%
distribute-lft-out--85.5%
*-commutative85.5%
associate-*r/87.9%
Simplified87.9%
if 8.0000000000000003e154 < a Initial program 63.3%
associate-*l/91.3%
Simplified91.3%
Taylor expanded in t around 0 89.8%
Final simplification87.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* (- a z) (/ y t)))) (t_2 (+ y (- x (/ y (/ a z))))))
(if (<= a -6.8e-15)
t_2
(if (<= a 3.3e-143)
t_1
(if (<= a 2.4e-120)
(- (+ x y) (/ (* y z) a))
(if (<= a 1.85e+55)
t_1
(if (<= a 9.2e+125)
t_2
(if (<= a 8e+154) t_1 (- (+ x y) (* y (/ z a)))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((a - z) * (y / t));
double t_2 = y + (x - (y / (a / z)));
double tmp;
if (a <= -6.8e-15) {
tmp = t_2;
} else if (a <= 3.3e-143) {
tmp = t_1;
} else if (a <= 2.4e-120) {
tmp = (x + y) - ((y * z) / a);
} else if (a <= 1.85e+55) {
tmp = t_1;
} else if (a <= 9.2e+125) {
tmp = t_2;
} else if (a <= 8e+154) {
tmp = t_1;
} else {
tmp = (x + y) - (y * (z / a));
}
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 - ((a - z) * (y / t))
t_2 = y + (x - (y / (a / z)))
if (a <= (-6.8d-15)) then
tmp = t_2
else if (a <= 3.3d-143) then
tmp = t_1
else if (a <= 2.4d-120) then
tmp = (x + y) - ((y * z) / a)
else if (a <= 1.85d+55) then
tmp = t_1
else if (a <= 9.2d+125) then
tmp = t_2
else if (a <= 8d+154) then
tmp = t_1
else
tmp = (x + y) - (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((a - z) * (y / t));
double t_2 = y + (x - (y / (a / z)));
double tmp;
if (a <= -6.8e-15) {
tmp = t_2;
} else if (a <= 3.3e-143) {
tmp = t_1;
} else if (a <= 2.4e-120) {
tmp = (x + y) - ((y * z) / a);
} else if (a <= 1.85e+55) {
tmp = t_1;
} else if (a <= 9.2e+125) {
tmp = t_2;
} else if (a <= 8e+154) {
tmp = t_1;
} else {
tmp = (x + y) - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - ((a - z) * (y / t)) t_2 = y + (x - (y / (a / z))) tmp = 0 if a <= -6.8e-15: tmp = t_2 elif a <= 3.3e-143: tmp = t_1 elif a <= 2.4e-120: tmp = (x + y) - ((y * z) / a) elif a <= 1.85e+55: tmp = t_1 elif a <= 9.2e+125: tmp = t_2 elif a <= 8e+154: tmp = t_1 else: tmp = (x + y) - (y * (z / a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(a - z) * Float64(y / t))) t_2 = Float64(y + Float64(x - Float64(y / Float64(a / z)))) tmp = 0.0 if (a <= -6.8e-15) tmp = t_2; elseif (a <= 3.3e-143) tmp = t_1; elseif (a <= 2.4e-120) tmp = Float64(Float64(x + y) - Float64(Float64(y * z) / a)); elseif (a <= 1.85e+55) tmp = t_1; elseif (a <= 9.2e+125) tmp = t_2; elseif (a <= 8e+154) tmp = t_1; else tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - ((a - z) * (y / t)); t_2 = y + (x - (y / (a / z))); tmp = 0.0; if (a <= -6.8e-15) tmp = t_2; elseif (a <= 3.3e-143) tmp = t_1; elseif (a <= 2.4e-120) tmp = (x + y) - ((y * z) / a); elseif (a <= 1.85e+55) tmp = t_1; elseif (a <= 9.2e+125) tmp = t_2; elseif (a <= 8e+154) tmp = t_1; else tmp = (x + y) - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(a - z), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6.8e-15], t$95$2, If[LessEqual[a, 3.3e-143], t$95$1, If[LessEqual[a, 2.4e-120], N[(N[(x + y), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.85e+55], t$95$1, If[LessEqual[a, 9.2e+125], t$95$2, If[LessEqual[a, 8e+154], t$95$1, N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \left(a - z\right) \cdot \frac{y}{t}\\
t_2 := y + \left(x - \frac{y}{\frac{a}{z}}\right)\\
\mathbf{if}\;a \leq -6.8 \cdot 10^{-15}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 3.3 \cdot 10^{-143}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{-120}:\\
\;\;\;\;\left(x + y\right) - \frac{y \cdot z}{a}\\
\mathbf{elif}\;a \leq 1.85 \cdot 10^{+55}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 9.2 \cdot 10^{+125}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 8 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if a < -6.8000000000000001e-15 or 1.8500000000000001e55 < a < 9.20000000000000051e125Initial program 79.9%
associate--l+81.1%
sub-neg81.1%
+-commutative81.1%
associate-/l*88.8%
distribute-neg-frac88.8%
associate-/r/90.0%
fma-def90.0%
sub-neg90.0%
+-commutative90.0%
distribute-neg-in90.0%
unsub-neg90.0%
remove-double-neg90.0%
Simplified90.0%
Taylor expanded in t around 0 82.2%
mul-1-neg82.2%
sub-neg82.2%
associate-/l*87.0%
Simplified87.0%
if -6.8000000000000001e-15 < a < 3.3000000000000001e-143 or 2.3999999999999999e-120 < a < 1.8500000000000001e55 or 9.20000000000000051e125 < a < 8.0000000000000003e154Initial program 70.1%
associate--l+77.0%
associate-/l*78.3%
Simplified78.3%
Taylor expanded in t around -inf 85.5%
+-commutative85.5%
sub-neg85.5%
mul-1-neg85.5%
+-commutative85.5%
*-commutative85.5%
+-commutative85.5%
*-commutative85.5%
mul-1-neg85.5%
unsub-neg85.5%
mul-1-neg85.5%
sub-neg85.5%
distribute-lft-out--85.5%
Simplified85.5%
Taylor expanded in a around 0 84.7%
mul-1-neg84.7%
sub-neg84.7%
div-sub85.5%
distribute-lft-out--85.5%
*-commutative85.5%
associate-*r/87.9%
Simplified87.9%
if 3.3000000000000001e-143 < a < 2.3999999999999999e-120Initial program 92.0%
associate--l+94.5%
associate-/l*90.3%
Simplified90.3%
Taylor expanded in t around 0 92.0%
if 8.0000000000000003e154 < a Initial program 63.3%
associate-*l/91.3%
Simplified91.3%
Taylor expanded in t around 0 89.8%
Final simplification88.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1e+59) (and (not (<= t -0.00016)) (<= t 3.1e+106))) (+ x (+ y (/ (- t z) (/ (- a t) y)))) (- x (* (- a z) (/ y t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1e+59) || (!(t <= -0.00016) && (t <= 3.1e+106))) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else {
tmp = x - ((a - z) * (y / 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 ((t <= (-1d+59)) .or. (.not. (t <= (-0.00016d0))) .and. (t <= 3.1d+106)) then
tmp = x + (y + ((t - z) / ((a - t) / y)))
else
tmp = x - ((a - z) * (y / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1e+59) || (!(t <= -0.00016) && (t <= 3.1e+106))) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else {
tmp = x - ((a - z) * (y / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1e+59) or (not (t <= -0.00016) and (t <= 3.1e+106)): tmp = x + (y + ((t - z) / ((a - t) / y))) else: tmp = x - ((a - z) * (y / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1e+59) || (!(t <= -0.00016) && (t <= 3.1e+106))) tmp = Float64(x + Float64(y + Float64(Float64(t - z) / Float64(Float64(a - t) / y)))); else tmp = Float64(x - Float64(Float64(a - z) * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1e+59) || (~((t <= -0.00016)) && (t <= 3.1e+106))) tmp = x + (y + ((t - z) / ((a - t) / y))); else tmp = x - ((a - z) * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1e+59], And[N[Not[LessEqual[t, -0.00016]], $MachinePrecision], LessEqual[t, 3.1e+106]]], N[(x + N[(y + N[(N[(t - z), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(a - z), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{+59} \lor \neg \left(t \leq -0.00016\right) \land t \leq 3.1 \cdot 10^{+106}:\\
\;\;\;\;x + \left(y + \frac{t - z}{\frac{a - t}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;x - \left(a - z\right) \cdot \frac{y}{t}\\
\end{array}
\end{array}
if t < -9.99999999999999972e58 or -1.60000000000000013e-4 < t < 3.0999999999999999e106Initial program 80.6%
associate--l+84.3%
associate-/l*89.4%
Simplified89.4%
if -9.99999999999999972e58 < t < -1.60000000000000013e-4 or 3.0999999999999999e106 < t Initial program 49.4%
associate--l+56.5%
associate-/l*64.6%
Simplified64.6%
Taylor expanded in t around -inf 83.8%
+-commutative83.8%
sub-neg83.8%
mul-1-neg83.8%
+-commutative83.8%
*-commutative83.8%
+-commutative83.8%
*-commutative83.8%
mul-1-neg83.8%
unsub-neg83.8%
mul-1-neg83.8%
sub-neg83.8%
distribute-lft-out--83.9%
Simplified83.9%
Taylor expanded in a around 0 83.8%
mul-1-neg83.8%
sub-neg83.8%
div-sub83.8%
distribute-lft-out--83.9%
*-commutative83.9%
associate-*r/92.8%
Simplified92.8%
Final simplification90.2%
(FPCore (x y z t a)
:precision binary64
(if (or (<= a -1.1e-14)
(and (not (<= a 2e-159)) (or (<= a 3.8e-117) (not (<= a 1.35e+55)))))
(+ y (- x (/ y (/ a z))))
(+ x (/ (* y z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.1e-14) || (!(a <= 2e-159) && ((a <= 3.8e-117) || !(a <= 1.35e+55)))) {
tmp = y + (x - (y / (a / z)));
} 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 <= (-1.1d-14)) .or. (.not. (a <= 2d-159)) .and. (a <= 3.8d-117) .or. (.not. (a <= 1.35d+55))) then
tmp = y + (x - (y / (a / z)))
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 <= -1.1e-14) || (!(a <= 2e-159) && ((a <= 3.8e-117) || !(a <= 1.35e+55)))) {
tmp = y + (x - (y / (a / z)));
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.1e-14) or (not (a <= 2e-159) and ((a <= 3.8e-117) or not (a <= 1.35e+55))): tmp = y + (x - (y / (a / z))) else: tmp = x + ((y * z) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.1e-14) || (!(a <= 2e-159) && ((a <= 3.8e-117) || !(a <= 1.35e+55)))) tmp = Float64(y + Float64(x - Float64(y / Float64(a / z)))); else tmp = Float64(x + Float64(Float64(y * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.1e-14) || (~((a <= 2e-159)) && ((a <= 3.8e-117) || ~((a <= 1.35e+55))))) tmp = y + (x - (y / (a / z))); else tmp = x + ((y * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.1e-14], And[N[Not[LessEqual[a, 2e-159]], $MachinePrecision], Or[LessEqual[a, 3.8e-117], N[Not[LessEqual[a, 1.35e+55]], $MachinePrecision]]]], N[(y + N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.1 \cdot 10^{-14} \lor \neg \left(a \leq 2 \cdot 10^{-159}\right) \land \left(a \leq 3.8 \cdot 10^{-117} \lor \neg \left(a \leq 1.35 \cdot 10^{+55}\right)\right):\\
\;\;\;\;y + \left(x - \frac{y}{\frac{a}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\end{array}
\end{array}
if a < -1.1e-14 or 1.99999999999999998e-159 < a < 3.79999999999999972e-117 or 1.34999999999999988e55 < a Initial program 73.7%
associate--l+75.3%
sub-neg75.3%
+-commutative75.3%
associate-/l*85.6%
distribute-neg-frac85.6%
associate-/r/86.7%
fma-def86.7%
sub-neg86.7%
+-commutative86.7%
distribute-neg-in86.7%
unsub-neg86.7%
remove-double-neg86.7%
Simplified86.7%
Taylor expanded in t around 0 75.2%
mul-1-neg75.2%
sub-neg75.2%
associate-/l*81.4%
Simplified81.4%
if -1.1e-14 < a < 1.99999999999999998e-159 or 3.79999999999999972e-117 < a < 1.34999999999999988e55Initial program 73.2%
associate--l+80.8%
associate-/l*81.5%
Simplified81.5%
Taylor expanded in t around -inf 87.9%
+-commutative87.9%
sub-neg87.9%
mul-1-neg87.9%
+-commutative87.9%
*-commutative87.9%
+-commutative87.9%
*-commutative87.9%
mul-1-neg87.9%
unsub-neg87.9%
mul-1-neg87.9%
sub-neg87.9%
distribute-lft-out--87.9%
Simplified87.9%
Taylor expanded in a around 0 85.1%
sub-neg85.1%
mul-1-neg85.1%
remove-double-neg85.1%
+-commutative85.1%
Simplified85.1%
Final simplification83.1%
(FPCore (x y z t a)
:precision binary64
(if (<= a -3.5e-12)
(+ y (- x (/ y (/ a z))))
(if (<= a 7e+48)
(- x (/ (* y z) (- a t)))
(if (<= a 1.95e+126)
(+ (+ x y) (/ y (+ (/ a t) -1.0)))
(if (<= a 1.2e+155)
(- x (* (- a z) (/ y t)))
(- (+ x y) (* y (/ z a))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.5e-12) {
tmp = y + (x - (y / (a / z)));
} else if (a <= 7e+48) {
tmp = x - ((y * z) / (a - t));
} else if (a <= 1.95e+126) {
tmp = (x + y) + (y / ((a / t) + -1.0));
} else if (a <= 1.2e+155) {
tmp = x - ((a - z) * (y / t));
} else {
tmp = (x + y) - (y * (z / a));
}
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 <= (-3.5d-12)) then
tmp = y + (x - (y / (a / z)))
else if (a <= 7d+48) then
tmp = x - ((y * z) / (a - t))
else if (a <= 1.95d+126) then
tmp = (x + y) + (y / ((a / t) + (-1.0d0)))
else if (a <= 1.2d+155) then
tmp = x - ((a - z) * (y / t))
else
tmp = (x + y) - (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.5e-12) {
tmp = y + (x - (y / (a / z)));
} else if (a <= 7e+48) {
tmp = x - ((y * z) / (a - t));
} else if (a <= 1.95e+126) {
tmp = (x + y) + (y / ((a / t) + -1.0));
} else if (a <= 1.2e+155) {
tmp = x - ((a - z) * (y / t));
} else {
tmp = (x + y) - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.5e-12: tmp = y + (x - (y / (a / z))) elif a <= 7e+48: tmp = x - ((y * z) / (a - t)) elif a <= 1.95e+126: tmp = (x + y) + (y / ((a / t) + -1.0)) elif a <= 1.2e+155: tmp = x - ((a - z) * (y / t)) else: tmp = (x + y) - (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.5e-12) tmp = Float64(y + Float64(x - Float64(y / Float64(a / z)))); elseif (a <= 7e+48) tmp = Float64(x - Float64(Float64(y * z) / Float64(a - t))); elseif (a <= 1.95e+126) tmp = Float64(Float64(x + y) + Float64(y / Float64(Float64(a / t) + -1.0))); elseif (a <= 1.2e+155) tmp = Float64(x - Float64(Float64(a - z) * Float64(y / t))); else tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.5e-12) tmp = y + (x - (y / (a / z))); elseif (a <= 7e+48) tmp = x - ((y * z) / (a - t)); elseif (a <= 1.95e+126) tmp = (x + y) + (y / ((a / t) + -1.0)); elseif (a <= 1.2e+155) tmp = x - ((a - z) * (y / t)); else tmp = (x + y) - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.5e-12], N[(y + N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7e+48], N[(x - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.95e+126], N[(N[(x + y), $MachinePrecision] + N[(y / N[(N[(a / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.2e+155], N[(x - N[(N[(a - z), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.5 \cdot 10^{-12}:\\
\;\;\;\;y + \left(x - \frac{y}{\frac{a}{z}}\right)\\
\mathbf{elif}\;a \leq 7 \cdot 10^{+48}:\\
\;\;\;\;x - \frac{y \cdot z}{a - t}\\
\mathbf{elif}\;a \leq 1.95 \cdot 10^{+126}:\\
\;\;\;\;\left(x + y\right) + \frac{y}{\frac{a}{t} + -1}\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{+155}:\\
\;\;\;\;x - \left(a - z\right) \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if a < -3.5e-12Initial program 80.6%
associate--l+82.2%
sub-neg82.2%
+-commutative82.2%
associate-/l*90.2%
distribute-neg-frac90.2%
associate-/r/91.7%
fma-def91.7%
sub-neg91.7%
+-commutative91.7%
distribute-neg-in91.7%
unsub-neg91.7%
remove-double-neg91.7%
Simplified91.7%
Taylor expanded in t around 0 83.5%
mul-1-neg83.5%
sub-neg83.5%
associate-/l*88.0%
Simplified88.0%
if -3.5e-12 < a < 6.9999999999999995e48Initial program 74.6%
associate--l+81.8%
sub-neg81.8%
+-commutative81.8%
associate-/l*81.6%
distribute-neg-frac81.6%
associate-/r/82.8%
fma-def82.8%
sub-neg82.8%
+-commutative82.8%
distribute-neg-in82.8%
unsub-neg82.8%
remove-double-neg82.8%
Simplified82.8%
Taylor expanded in z around inf 88.6%
associate-*r/88.6%
associate-*r*88.6%
neg-mul-188.6%
Simplified88.6%
if 6.9999999999999995e48 < a < 1.94999999999999997e126Initial program 72.6%
associate--l+72.7%
sub-neg72.7%
+-commutative72.7%
associate-/l*80.8%
distribute-neg-frac80.8%
associate-/r/80.8%
fma-def80.8%
sub-neg80.8%
+-commutative80.8%
distribute-neg-in80.8%
unsub-neg80.8%
remove-double-neg80.8%
Simplified80.8%
Taylor expanded in z around 0 72.1%
+-commutative72.1%
remove-double-neg72.1%
mul-1-neg72.1%
sub-neg72.1%
associate--l+72.1%
sub-neg72.1%
mul-1-neg72.1%
remove-double-neg72.1%
associate-/l*74.9%
div-sub74.9%
*-inverses74.9%
Simplified74.9%
if 1.94999999999999997e126 < a < 1.2000000000000001e155Initial program 42.7%
associate--l+42.7%
associate-/l*52.2%
Simplified52.2%
Taylor expanded in t around -inf 71.4%
+-commutative71.4%
sub-neg71.4%
mul-1-neg71.4%
+-commutative71.4%
*-commutative71.4%
+-commutative71.4%
*-commutative71.4%
mul-1-neg71.4%
unsub-neg71.4%
mul-1-neg71.4%
sub-neg71.4%
distribute-lft-out--71.4%
Simplified71.4%
Taylor expanded in a around 0 70.7%
mul-1-neg70.7%
sub-neg70.7%
div-sub71.4%
distribute-lft-out--71.4%
*-commutative71.4%
associate-*r/90.5%
Simplified90.5%
if 1.2000000000000001e155 < a Initial program 63.3%
associate-*l/91.3%
Simplified91.3%
Taylor expanded in t around 0 89.8%
Final simplification87.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) t))))
(if (<= a -4.5e-16)
(+ x y)
(if (<= a 2e-159)
t_1
(if (<= a 3.5e-117)
(- y (/ (* y z) a))
(if (<= a 2.8e+55) t_1 (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y * z) / t);
double tmp;
if (a <= -4.5e-16) {
tmp = x + y;
} else if (a <= 2e-159) {
tmp = t_1;
} else if (a <= 3.5e-117) {
tmp = y - ((y * z) / a);
} else if (a <= 2.8e+55) {
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) :: tmp
t_1 = x + ((y * z) / t)
if (a <= (-4.5d-16)) then
tmp = x + y
else if (a <= 2d-159) then
tmp = t_1
else if (a <= 3.5d-117) then
tmp = y - ((y * z) / a)
else if (a <= 2.8d+55) 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 + ((y * z) / t);
double tmp;
if (a <= -4.5e-16) {
tmp = x + y;
} else if (a <= 2e-159) {
tmp = t_1;
} else if (a <= 3.5e-117) {
tmp = y - ((y * z) / a);
} else if (a <= 2.8e+55) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y * z) / t) tmp = 0 if a <= -4.5e-16: tmp = x + y elif a <= 2e-159: tmp = t_1 elif a <= 3.5e-117: tmp = y - ((y * z) / a) elif a <= 2.8e+55: tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y * z) / t)) tmp = 0.0 if (a <= -4.5e-16) tmp = Float64(x + y); elseif (a <= 2e-159) tmp = t_1; elseif (a <= 3.5e-117) tmp = Float64(y - Float64(Float64(y * z) / a)); elseif (a <= 2.8e+55) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y * z) / t); tmp = 0.0; if (a <= -4.5e-16) tmp = x + y; elseif (a <= 2e-159) tmp = t_1; elseif (a <= 3.5e-117) tmp = y - ((y * z) / a); elseif (a <= 2.8e+55) 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[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.5e-16], N[(x + y), $MachinePrecision], If[LessEqual[a, 2e-159], t$95$1, If[LessEqual[a, 3.5e-117], N[(y - N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.8e+55], t$95$1, N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
\mathbf{if}\;a \leq -4.5 \cdot 10^{-16}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 2 \cdot 10^{-159}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{-117}:\\
\;\;\;\;y - \frac{y \cdot z}{a}\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{+55}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -4.5000000000000002e-16 or 2.8000000000000001e55 < a Initial program 72.8%
associate--l+74.4%
sub-neg74.4%
+-commutative74.4%
associate-/l*86.4%
distribute-neg-frac86.4%
associate-/r/88.8%
fma-def88.8%
sub-neg88.8%
+-commutative88.8%
distribute-neg-in88.8%
unsub-neg88.8%
remove-double-neg88.8%
Simplified88.8%
Taylor expanded in a around inf 75.8%
if -4.5000000000000002e-16 < a < 1.99999999999999998e-159 or 3.4999999999999998e-117 < a < 2.8000000000000001e55Initial program 73.2%
associate--l+80.8%
associate-/l*81.5%
Simplified81.5%
Taylor expanded in t around -inf 87.9%
+-commutative87.9%
sub-neg87.9%
mul-1-neg87.9%
+-commutative87.9%
*-commutative87.9%
+-commutative87.9%
*-commutative87.9%
mul-1-neg87.9%
unsub-neg87.9%
mul-1-neg87.9%
sub-neg87.9%
distribute-lft-out--87.9%
Simplified87.9%
Taylor expanded in a around 0 85.1%
sub-neg85.1%
mul-1-neg85.1%
remove-double-neg85.1%
+-commutative85.1%
Simplified85.1%
if 1.99999999999999998e-159 < a < 3.4999999999999998e-117Initial program 80.7%
associate--l+82.6%
associate-/l*79.1%
Simplified79.1%
Taylor expanded in x around 0 59.3%
Taylor expanded in a around inf 54.7%
Taylor expanded in t around 0 55.8%
Final simplification79.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) t))))
(if (<= a -3.4e-12)
(+ x y)
(if (<= a 2e-159)
t_1
(if (<= a 2.4e-120)
(- x (/ (* y z) a))
(if (<= a 4.5e+55) t_1 (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y * z) / t);
double tmp;
if (a <= -3.4e-12) {
tmp = x + y;
} else if (a <= 2e-159) {
tmp = t_1;
} else if (a <= 2.4e-120) {
tmp = x - ((y * z) / a);
} else if (a <= 4.5e+55) {
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) :: tmp
t_1 = x + ((y * z) / t)
if (a <= (-3.4d-12)) then
tmp = x + y
else if (a <= 2d-159) then
tmp = t_1
else if (a <= 2.4d-120) then
tmp = x - ((y * z) / a)
else if (a <= 4.5d+55) 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 + ((y * z) / t);
double tmp;
if (a <= -3.4e-12) {
tmp = x + y;
} else if (a <= 2e-159) {
tmp = t_1;
} else if (a <= 2.4e-120) {
tmp = x - ((y * z) / a);
} else if (a <= 4.5e+55) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y * z) / t) tmp = 0 if a <= -3.4e-12: tmp = x + y elif a <= 2e-159: tmp = t_1 elif a <= 2.4e-120: tmp = x - ((y * z) / a) elif a <= 4.5e+55: tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y * z) / t)) tmp = 0.0 if (a <= -3.4e-12) tmp = Float64(x + y); elseif (a <= 2e-159) tmp = t_1; elseif (a <= 2.4e-120) tmp = Float64(x - Float64(Float64(y * z) / a)); elseif (a <= 4.5e+55) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y * z) / t); tmp = 0.0; if (a <= -3.4e-12) tmp = x + y; elseif (a <= 2e-159) tmp = t_1; elseif (a <= 2.4e-120) tmp = x - ((y * z) / a); elseif (a <= 4.5e+55) 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[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.4e-12], N[(x + y), $MachinePrecision], If[LessEqual[a, 2e-159], t$95$1, If[LessEqual[a, 2.4e-120], N[(x - N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.5e+55], t$95$1, N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
\mathbf{if}\;a \leq -3.4 \cdot 10^{-12}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 2 \cdot 10^{-159}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{-120}:\\
\;\;\;\;x - \frac{y \cdot z}{a}\\
\mathbf{elif}\;a \leq 4.5 \cdot 10^{+55}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -3.4000000000000001e-12 or 4.49999999999999998e55 < a Initial program 72.8%
associate--l+74.4%
sub-neg74.4%
+-commutative74.4%
associate-/l*86.4%
distribute-neg-frac86.4%
associate-/r/88.8%
fma-def88.8%
sub-neg88.8%
+-commutative88.8%
distribute-neg-in88.8%
unsub-neg88.8%
remove-double-neg88.8%
Simplified88.8%
Taylor expanded in a around inf 75.8%
if -3.4000000000000001e-12 < a < 1.99999999999999998e-159 or 2.3999999999999999e-120 < a < 4.49999999999999998e55Initial program 72.6%
associate--l+80.2%
associate-/l*80.9%
Simplified80.9%
Taylor expanded in t around -inf 88.0%
+-commutative88.0%
sub-neg88.0%
mul-1-neg88.0%
+-commutative88.0%
*-commutative88.0%
+-commutative88.0%
*-commutative88.0%
mul-1-neg88.0%
unsub-neg88.0%
mul-1-neg88.0%
sub-neg88.0%
distribute-lft-out--88.0%
Simplified88.0%
Taylor expanded in a around 0 84.4%
sub-neg84.4%
mul-1-neg84.4%
remove-double-neg84.4%
+-commutative84.4%
Simplified84.4%
if 1.99999999999999998e-159 < a < 2.3999999999999999e-120Initial program 86.3%
associate--l+88.4%
sub-neg88.4%
+-commutative88.4%
associate-/l*84.6%
distribute-neg-frac84.6%
associate-/r/74.8%
fma-def74.8%
sub-neg74.8%
+-commutative74.8%
distribute-neg-in74.8%
unsub-neg74.8%
remove-double-neg74.8%
Simplified74.8%
Taylor expanded in z around inf 67.5%
associate-*r/67.5%
associate-*r*67.5%
neg-mul-167.5%
Simplified67.5%
Taylor expanded in a around inf 60.7%
associate-*r/60.7%
mul-1-neg60.7%
*-commutative60.7%
distribute-rgt-neg-in60.7%
Simplified60.7%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.02e-27) (not (<= a 1.25e+45))) (- (+ x y) (* y (/ z (- a t)))) (- x (/ (* y z) (- a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.02e-27) || !(a <= 1.25e+45)) {
tmp = (x + y) - (y * (z / (a - t)));
} else {
tmp = x - ((y * z) / (a - 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 <= (-1.02d-27)) .or. (.not. (a <= 1.25d+45))) then
tmp = (x + y) - (y * (z / (a - t)))
else
tmp = x - ((y * z) / (a - 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 <= -1.02e-27) || !(a <= 1.25e+45)) {
tmp = (x + y) - (y * (z / (a - t)));
} else {
tmp = x - ((y * z) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.02e-27) or not (a <= 1.25e+45): tmp = (x + y) - (y * (z / (a - t))) else: tmp = x - ((y * z) / (a - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.02e-27) || !(a <= 1.25e+45)) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / Float64(a - t)))); else tmp = Float64(x - Float64(Float64(y * z) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.02e-27) || ~((a <= 1.25e+45))) tmp = (x + y) - (y * (z / (a - t))); else tmp = x - ((y * z) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.02e-27], N[Not[LessEqual[a, 1.25e+45]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.02 \cdot 10^{-27} \lor \neg \left(a \leq 1.25 \cdot 10^{+45}\right):\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot z}{a - t}\\
\end{array}
\end{array}
if a < -1.02000000000000002e-27 or 1.25e45 < a Initial program 73.0%
associate-*l/86.1%
Simplified86.1%
Taylor expanded in z around inf 84.9%
if -1.02000000000000002e-27 < a < 1.25e45Initial program 73.8%
associate--l+81.3%
sub-neg81.3%
+-commutative81.3%
associate-/l*81.0%
distribute-neg-frac81.0%
associate-/r/82.2%
fma-def82.2%
sub-neg82.2%
+-commutative82.2%
distribute-neg-in82.2%
unsub-neg82.2%
remove-double-neg82.2%
Simplified82.2%
Taylor expanded in z around inf 89.1%
associate-*r/89.1%
associate-*r*89.1%
neg-mul-189.1%
Simplified89.1%
Final simplification87.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.3e-12) (+ y (- x (/ y (/ a z)))) (if (<= a 2.9e+55) (- x (/ (* y z) (- a t))) (- (+ x y) (* y (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.3e-12) {
tmp = y + (x - (y / (a / z)));
} else if (a <= 2.9e+55) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = (x + y) - (y * (z / a));
}
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 <= (-3.3d-12)) then
tmp = y + (x - (y / (a / z)))
else if (a <= 2.9d+55) then
tmp = x - ((y * z) / (a - t))
else
tmp = (x + y) - (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.3e-12) {
tmp = y + (x - (y / (a / z)));
} else if (a <= 2.9e+55) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = (x + y) - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.3e-12: tmp = y + (x - (y / (a / z))) elif a <= 2.9e+55: tmp = x - ((y * z) / (a - t)) else: tmp = (x + y) - (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.3e-12) tmp = Float64(y + Float64(x - Float64(y / Float64(a / z)))); elseif (a <= 2.9e+55) tmp = Float64(x - Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.3e-12) tmp = y + (x - (y / (a / z))); elseif (a <= 2.9e+55) tmp = x - ((y * z) / (a - t)); else tmp = (x + y) - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.3e-12], N[(y + N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.9e+55], N[(x - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.3 \cdot 10^{-12}:\\
\;\;\;\;y + \left(x - \frac{y}{\frac{a}{z}}\right)\\
\mathbf{elif}\;a \leq 2.9 \cdot 10^{+55}:\\
\;\;\;\;x - \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if a < -3.3000000000000001e-12Initial program 80.6%
associate--l+82.2%
sub-neg82.2%
+-commutative82.2%
associate-/l*90.2%
distribute-neg-frac90.2%
associate-/r/91.7%
fma-def91.7%
sub-neg91.7%
+-commutative91.7%
distribute-neg-in91.7%
unsub-neg91.7%
remove-double-neg91.7%
Simplified91.7%
Taylor expanded in t around 0 83.5%
mul-1-neg83.5%
sub-neg83.5%
associate-/l*88.0%
Simplified88.0%
if -3.3000000000000001e-12 < a < 2.8999999999999999e55Initial program 74.0%
associate--l+81.0%
sub-neg81.0%
+-commutative81.0%
associate-/l*81.2%
distribute-neg-frac81.2%
associate-/r/82.4%
fma-def82.4%
sub-neg82.4%
+-commutative82.4%
distribute-neg-in82.4%
unsub-neg82.4%
remove-double-neg82.4%
Simplified82.4%
Taylor expanded in z around inf 86.9%
associate-*r/86.9%
associate-*r*86.9%
neg-mul-186.9%
Simplified86.9%
if 2.8999999999999999e55 < a Initial program 63.8%
associate-*l/81.8%
Simplified81.8%
Taylor expanded in t around 0 77.5%
Final simplification85.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.1e-12) (+ x y) (if (<= a 2.4e+55) (+ x (/ (* y z) t)) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.1e-12) {
tmp = x + y;
} else if (a <= 2.4e+55) {
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 <= (-3.1d-12)) then
tmp = x + y
else if (a <= 2.4d+55) 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 <= -3.1e-12) {
tmp = x + y;
} else if (a <= 2.4e+55) {
tmp = x + ((y * z) / t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.1e-12: tmp = x + y elif a <= 2.4e+55: tmp = x + ((y * z) / t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.1e-12) tmp = Float64(x + y); elseif (a <= 2.4e+55) tmp = Float64(x + Float64(Float64(y * 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 <= -3.1e-12) tmp = x + y; elseif (a <= 2.4e+55) tmp = x + ((y * z) / t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.1e-12], N[(x + y), $MachinePrecision], If[LessEqual[a, 2.4e+55], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.1 \cdot 10^{-12}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{+55}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -3.1000000000000001e-12 or 2.3999999999999999e55 < a Initial program 72.8%
associate--l+74.4%
sub-neg74.4%
+-commutative74.4%
associate-/l*86.4%
distribute-neg-frac86.4%
associate-/r/88.8%
fma-def88.8%
sub-neg88.8%
+-commutative88.8%
distribute-neg-in88.8%
unsub-neg88.8%
remove-double-neg88.8%
Simplified88.8%
Taylor expanded in a around inf 75.8%
if -3.1000000000000001e-12 < a < 2.3999999999999999e55Initial program 74.0%
associate--l+81.0%
associate-/l*81.2%
Simplified81.2%
Taylor expanded in t around -inf 82.2%
+-commutative82.2%
sub-neg82.2%
mul-1-neg82.2%
+-commutative82.2%
*-commutative82.2%
+-commutative82.2%
*-commutative82.2%
mul-1-neg82.2%
unsub-neg82.2%
mul-1-neg82.2%
sub-neg82.2%
distribute-lft-out--82.2%
Simplified82.2%
Taylor expanded in a around 0 78.4%
sub-neg78.4%
mul-1-neg78.4%
remove-double-neg78.4%
+-commutative78.4%
Simplified78.4%
Final simplification77.1%
(FPCore (x y z t a) :precision binary64 (if (<= y -2.4e+19) y (if (<= y 3.4e+100) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.4e+19) {
tmp = y;
} else if (y <= 3.4e+100) {
tmp = x;
} else {
tmp = 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 (y <= (-2.4d+19)) then
tmp = y
else if (y <= 3.4d+100) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.4e+19) {
tmp = y;
} else if (y <= 3.4e+100) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.4e+19: tmp = y elif y <= 3.4e+100: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.4e+19) tmp = y; elseif (y <= 3.4e+100) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2.4e+19) tmp = y; elseif (y <= 3.4e+100) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.4e+19], y, If[LessEqual[y, 3.4e+100], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+19}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{+100}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -2.4e19 or 3.39999999999999994e100 < y Initial program 56.7%
associate--l+58.6%
associate-/l*76.9%
Simplified76.9%
Taylor expanded in x around 0 50.2%
Taylor expanded in a around inf 36.2%
Taylor expanded in a around inf 32.4%
if -2.4e19 < y < 3.39999999999999994e100Initial program 86.2%
associate--l+92.7%
sub-neg92.7%
+-commutative92.7%
associate-/l*88.8%
distribute-neg-frac88.8%
associate-/r/90.2%
fma-def90.2%
sub-neg90.2%
+-commutative90.2%
distribute-neg-in90.2%
unsub-neg90.2%
remove-double-neg90.2%
Simplified90.2%
Taylor expanded in x around inf 69.8%
Final simplification53.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 4.4e+64) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4.4e+64) {
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 <= 4.4d+64) 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 <= 4.4e+64) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 4.4e+64: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 4.4e+64) 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 <= 4.4e+64) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 4.4e+64], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.4 \cdot 10^{+64}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < 4.40000000000000004e64Initial program 79.3%
associate--l+81.9%
sub-neg81.9%
+-commutative81.9%
associate-/l*87.3%
distribute-neg-frac87.3%
associate-/r/87.2%
fma-def87.1%
sub-neg87.1%
+-commutative87.1%
distribute-neg-in87.1%
unsub-neg87.1%
remove-double-neg87.1%
Simplified87.1%
Taylor expanded in a around inf 61.5%
if 4.40000000000000004e64 < t Initial program 51.1%
associate--l+62.5%
sub-neg62.5%
+-commutative62.5%
associate-/l*69.9%
distribute-neg-frac69.9%
associate-/r/78.6%
fma-def78.6%
sub-neg78.6%
+-commutative78.6%
distribute-neg-in78.6%
unsub-neg78.6%
remove-double-neg78.6%
Simplified78.6%
Taylor expanded in x around inf 60.6%
Final simplification61.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 73.4%
associate--l+77.9%
sub-neg77.9%
+-commutative77.9%
associate-/l*83.7%
distribute-neg-frac83.7%
associate-/r/85.4%
fma-def85.4%
sub-neg85.4%
+-commutative85.4%
distribute-neg-in85.4%
unsub-neg85.4%
remove-double-neg85.4%
Simplified85.4%
Taylor expanded in x around inf 47.4%
Final simplification47.4%
(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 2023176
(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))))