
(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 14 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 (or (<= t -3.2e+82) (not (<= t 7.5e+148))) (+ (- x (/ y (/ t a))) (/ y (/ t z))) (+ x (fma (/ (- t z) (- a t)) y y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.2e+82) || !(t <= 7.5e+148)) {
tmp = (x - (y / (t / a))) + (y / (t / z));
} else {
tmp = x + fma(((t - z) / (a - t)), y, y);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.2e+82) || !(t <= 7.5e+148)) tmp = Float64(Float64(x - Float64(y / Float64(t / a))) + Float64(y / Float64(t / z))); else tmp = Float64(x + fma(Float64(Float64(t - z) / Float64(a - t)), y, y)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.2e+82], N[Not[LessEqual[t, 7.5e+148]], $MachinePrecision]], N[(N[(x - N[(y / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+82} \lor \neg \left(t \leq 7.5 \cdot 10^{+148}\right):\\
\;\;\;\;\left(x - \frac{y}{\frac{t}{a}}\right) + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(\frac{t - z}{a - t}, y, y\right)\\
\end{array}
\end{array}
if t < -3.19999999999999975e82 or 7.50000000000000008e148 < t Initial program 44.4%
associate--l+48.5%
associate-/l*75.6%
Simplified75.6%
Taylor expanded in t around inf 74.2%
sub-neg74.2%
+-commutative74.2%
mul-1-neg74.2%
unsub-neg74.2%
associate-/l*81.7%
mul-1-neg81.7%
remove-double-neg81.7%
associate-/l*96.5%
Simplified96.5%
if -3.19999999999999975e82 < t < 7.50000000000000008e148Initial program 86.4%
associate--l+87.5%
sub-neg87.5%
+-commutative87.5%
associate-/l*93.6%
distribute-neg-frac93.6%
associate-/r/94.4%
fma-def94.4%
sub-neg94.4%
+-commutative94.4%
distribute-neg-in94.4%
unsub-neg94.4%
remove-double-neg94.4%
Simplified94.4%
Final simplification95.0%
(FPCore (x y z t a)
:precision binary64
(if (<= a -4.3e+173)
(+ x y)
(if (<= a -8.4e+142)
(* y (- 1.0 (/ z a)))
(if (<= a -1.7e-17)
(+ x y)
(if (<= a -4.3e-47)
(* (/ y t) (- z a))
(if (<= a -6.2e-77)
(+ x y)
(if (<= a 2.8e+43) (+ x (/ y (/ t z))) (+ x y))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.3e+173) {
tmp = x + y;
} else if (a <= -8.4e+142) {
tmp = y * (1.0 - (z / a));
} else if (a <= -1.7e-17) {
tmp = x + y;
} else if (a <= -4.3e-47) {
tmp = (y / t) * (z - a);
} else if (a <= -6.2e-77) {
tmp = x + y;
} else if (a <= 2.8e+43) {
tmp = x + (y / (t / z));
} 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 <= (-4.3d+173)) then
tmp = x + y
else if (a <= (-8.4d+142)) then
tmp = y * (1.0d0 - (z / a))
else if (a <= (-1.7d-17)) then
tmp = x + y
else if (a <= (-4.3d-47)) then
tmp = (y / t) * (z - a)
else if (a <= (-6.2d-77)) then
tmp = x + y
else if (a <= 2.8d+43) then
tmp = x + (y / (t / z))
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 <= -4.3e+173) {
tmp = x + y;
} else if (a <= -8.4e+142) {
tmp = y * (1.0 - (z / a));
} else if (a <= -1.7e-17) {
tmp = x + y;
} else if (a <= -4.3e-47) {
tmp = (y / t) * (z - a);
} else if (a <= -6.2e-77) {
tmp = x + y;
} else if (a <= 2.8e+43) {
tmp = x + (y / (t / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.3e+173: tmp = x + y elif a <= -8.4e+142: tmp = y * (1.0 - (z / a)) elif a <= -1.7e-17: tmp = x + y elif a <= -4.3e-47: tmp = (y / t) * (z - a) elif a <= -6.2e-77: tmp = x + y elif a <= 2.8e+43: tmp = x + (y / (t / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.3e+173) tmp = Float64(x + y); elseif (a <= -8.4e+142) tmp = Float64(y * Float64(1.0 - Float64(z / a))); elseif (a <= -1.7e-17) tmp = Float64(x + y); elseif (a <= -4.3e-47) tmp = Float64(Float64(y / t) * Float64(z - a)); elseif (a <= -6.2e-77) tmp = Float64(x + y); elseif (a <= 2.8e+43) tmp = Float64(x + Float64(y / Float64(t / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -4.3e+173) tmp = x + y; elseif (a <= -8.4e+142) tmp = y * (1.0 - (z / a)); elseif (a <= -1.7e-17) tmp = x + y; elseif (a <= -4.3e-47) tmp = (y / t) * (z - a); elseif (a <= -6.2e-77) tmp = x + y; elseif (a <= 2.8e+43) tmp = x + (y / (t / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.3e+173], N[(x + y), $MachinePrecision], If[LessEqual[a, -8.4e+142], N[(y * N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.7e-17], N[(x + y), $MachinePrecision], If[LessEqual[a, -4.3e-47], N[(N[(y / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -6.2e-77], N[(x + y), $MachinePrecision], If[LessEqual[a, 2.8e+43], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.3 \cdot 10^{+173}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -8.4 \cdot 10^{+142}:\\
\;\;\;\;y \cdot \left(1 - \frac{z}{a}\right)\\
\mathbf{elif}\;a \leq -1.7 \cdot 10^{-17}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -4.3 \cdot 10^{-47}:\\
\;\;\;\;\frac{y}{t} \cdot \left(z - a\right)\\
\mathbf{elif}\;a \leq -6.2 \cdot 10^{-77}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{+43}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -4.30000000000000025e173 or -8.3999999999999999e142 < a < -1.6999999999999999e-17 or -4.2999999999999998e-47 < a < -6.20000000000000016e-77 or 2.80000000000000019e43 < a Initial program 76.3%
associate--l+77.2%
sub-neg77.2%
+-commutative77.2%
associate-/l*90.8%
distribute-neg-frac90.8%
associate-/r/91.6%
fma-def91.6%
sub-neg91.6%
+-commutative91.6%
distribute-neg-in91.6%
unsub-neg91.6%
remove-double-neg91.6%
Simplified91.6%
Taylor expanded in a around inf 78.5%
if -4.30000000000000025e173 < a < -8.3999999999999999e142Initial program 72.7%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in t around 0 99.8%
Taylor expanded in y around inf 91.7%
if -1.6999999999999999e-17 < a < -4.2999999999999998e-47Initial program 52.1%
associate--l+52.1%
associate-/l*76.2%
Simplified76.2%
Taylor expanded in t around inf 40.5%
sub-neg40.5%
+-commutative40.5%
mul-1-neg40.5%
unsub-neg40.5%
associate-/l*40.5%
mul-1-neg40.5%
remove-double-neg40.5%
associate-/l*63.4%
Simplified63.4%
Taylor expanded in x around 0 40.5%
associate-*l/63.0%
associate-*l/63.0%
distribute-lft-out--75.5%
Simplified75.5%
if -6.20000000000000016e-77 < a < 2.80000000000000019e43Initial program 72.2%
associate--l+75.5%
sub-neg75.5%
+-commutative75.5%
associate-/l*87.1%
distribute-neg-frac87.1%
associate-/r/86.9%
fma-def86.9%
sub-neg86.9%
+-commutative86.9%
distribute-neg-in86.9%
unsub-neg86.9%
remove-double-neg86.9%
Simplified86.9%
Taylor expanded in z around inf 86.5%
associate-*r/86.5%
associate-*r*86.5%
neg-mul-186.5%
Simplified86.5%
Taylor expanded in a around 0 74.3%
associate-/l*78.8%
Simplified78.8%
Final simplification78.9%
(FPCore (x y z t a)
:precision binary64
(if (<= a -4.3e+173)
(+ x y)
(if (<= a -2.6e+142)
(- y (* y (/ z a)))
(if (<= a -1.6e-17)
(+ x y)
(if (<= a -6.7e-47)
(* (/ y t) (- z a))
(if (<= a -1.12e-79)
(+ x y)
(if (<= a 5.8e+42) (+ x (/ y (/ t z))) (+ x y))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.3e+173) {
tmp = x + y;
} else if (a <= -2.6e+142) {
tmp = y - (y * (z / a));
} else if (a <= -1.6e-17) {
tmp = x + y;
} else if (a <= -6.7e-47) {
tmp = (y / t) * (z - a);
} else if (a <= -1.12e-79) {
tmp = x + y;
} else if (a <= 5.8e+42) {
tmp = x + (y / (t / z));
} 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 <= (-4.3d+173)) then
tmp = x + y
else if (a <= (-2.6d+142)) then
tmp = y - (y * (z / a))
else if (a <= (-1.6d-17)) then
tmp = x + y
else if (a <= (-6.7d-47)) then
tmp = (y / t) * (z - a)
else if (a <= (-1.12d-79)) then
tmp = x + y
else if (a <= 5.8d+42) then
tmp = x + (y / (t / z))
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 <= -4.3e+173) {
tmp = x + y;
} else if (a <= -2.6e+142) {
tmp = y - (y * (z / a));
} else if (a <= -1.6e-17) {
tmp = x + y;
} else if (a <= -6.7e-47) {
tmp = (y / t) * (z - a);
} else if (a <= -1.12e-79) {
tmp = x + y;
} else if (a <= 5.8e+42) {
tmp = x + (y / (t / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.3e+173: tmp = x + y elif a <= -2.6e+142: tmp = y - (y * (z / a)) elif a <= -1.6e-17: tmp = x + y elif a <= -6.7e-47: tmp = (y / t) * (z - a) elif a <= -1.12e-79: tmp = x + y elif a <= 5.8e+42: tmp = x + (y / (t / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.3e+173) tmp = Float64(x + y); elseif (a <= -2.6e+142) tmp = Float64(y - Float64(y * Float64(z / a))); elseif (a <= -1.6e-17) tmp = Float64(x + y); elseif (a <= -6.7e-47) tmp = Float64(Float64(y / t) * Float64(z - a)); elseif (a <= -1.12e-79) tmp = Float64(x + y); elseif (a <= 5.8e+42) tmp = Float64(x + Float64(y / Float64(t / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -4.3e+173) tmp = x + y; elseif (a <= -2.6e+142) tmp = y - (y * (z / a)); elseif (a <= -1.6e-17) tmp = x + y; elseif (a <= -6.7e-47) tmp = (y / t) * (z - a); elseif (a <= -1.12e-79) tmp = x + y; elseif (a <= 5.8e+42) tmp = x + (y / (t / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.3e+173], N[(x + y), $MachinePrecision], If[LessEqual[a, -2.6e+142], N[(y - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.6e-17], N[(x + y), $MachinePrecision], If[LessEqual[a, -6.7e-47], N[(N[(y / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.12e-79], N[(x + y), $MachinePrecision], If[LessEqual[a, 5.8e+42], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.3 \cdot 10^{+173}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -2.6 \cdot 10^{+142}:\\
\;\;\;\;y - y \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq -1.6 \cdot 10^{-17}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -6.7 \cdot 10^{-47}:\\
\;\;\;\;\frac{y}{t} \cdot \left(z - a\right)\\
\mathbf{elif}\;a \leq -1.12 \cdot 10^{-79}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{+42}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -4.30000000000000025e173 or -2.60000000000000021e142 < a < -1.6000000000000001e-17 or -6.6999999999999997e-47 < a < -1.11999999999999996e-79 or 5.79999999999999961e42 < a Initial program 76.3%
associate--l+77.2%
sub-neg77.2%
+-commutative77.2%
associate-/l*90.8%
distribute-neg-frac90.8%
associate-/r/91.6%
fma-def91.6%
sub-neg91.6%
+-commutative91.6%
distribute-neg-in91.6%
unsub-neg91.6%
remove-double-neg91.6%
Simplified91.6%
Taylor expanded in a around inf 78.5%
if -4.30000000000000025e173 < a < -2.60000000000000021e142Initial program 72.7%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in t around 0 99.8%
Taylor expanded in x around 0 64.8%
associate-*l/72.8%
*-commutative72.8%
Simplified72.8%
Taylor expanded in z around 0 64.8%
*-commutative64.8%
associate-/l*72.6%
associate-/r/92.0%
Simplified92.0%
if -1.6000000000000001e-17 < a < -6.6999999999999997e-47Initial program 52.1%
associate--l+52.1%
associate-/l*76.2%
Simplified76.2%
Taylor expanded in t around inf 40.5%
sub-neg40.5%
+-commutative40.5%
mul-1-neg40.5%
unsub-neg40.5%
associate-/l*40.5%
mul-1-neg40.5%
remove-double-neg40.5%
associate-/l*63.4%
Simplified63.4%
Taylor expanded in x around 0 40.5%
associate-*l/63.0%
associate-*l/63.0%
distribute-lft-out--75.5%
Simplified75.5%
if -1.11999999999999996e-79 < a < 5.79999999999999961e42Initial program 72.2%
associate--l+75.5%
sub-neg75.5%
+-commutative75.5%
associate-/l*87.1%
distribute-neg-frac87.1%
associate-/r/86.9%
fma-def86.9%
sub-neg86.9%
+-commutative86.9%
distribute-neg-in86.9%
unsub-neg86.9%
remove-double-neg86.9%
Simplified86.9%
Taylor expanded in z around inf 86.5%
associate-*r/86.5%
associate-*r*86.5%
neg-mul-186.5%
Simplified86.5%
Taylor expanded in a around 0 74.3%
associate-/l*78.8%
Simplified78.8%
Final simplification78.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.25e+85) (not (<= t 8.8e+148))) (+ (- x (/ y (/ t a))) (/ y (/ t z))) (- x (- (/ (- z t) (/ (- a t) y)) y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.25e+85) || !(t <= 8.8e+148)) {
tmp = (x - (y / (t / a))) + (y / (t / z));
} else {
tmp = x - (((z - t) / ((a - t) / y)) - 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 ((t <= (-1.25d+85)) .or. (.not. (t <= 8.8d+148))) then
tmp = (x - (y / (t / a))) + (y / (t / z))
else
tmp = x - (((z - t) / ((a - t) / y)) - y)
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.25e+85) || !(t <= 8.8e+148)) {
tmp = (x - (y / (t / a))) + (y / (t / z));
} else {
tmp = x - (((z - t) / ((a - t) / y)) - y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.25e+85) or not (t <= 8.8e+148): tmp = (x - (y / (t / a))) + (y / (t / z)) else: tmp = x - (((z - t) / ((a - t) / y)) - y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.25e+85) || !(t <= 8.8e+148)) tmp = Float64(Float64(x - Float64(y / Float64(t / a))) + Float64(y / Float64(t / z))); else tmp = Float64(x - Float64(Float64(Float64(z - t) / Float64(Float64(a - t) / y)) - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.25e+85) || ~((t <= 8.8e+148))) tmp = (x - (y / (t / a))) + (y / (t / z)); else tmp = x - (((z - t) / ((a - t) / y)) - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.25e+85], N[Not[LessEqual[t, 8.8e+148]], $MachinePrecision]], N[(N[(x - N[(y / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(N[(z - t), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{+85} \lor \neg \left(t \leq 8.8 \cdot 10^{+148}\right):\\
\;\;\;\;\left(x - \frac{y}{\frac{t}{a}}\right) + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - \left(\frac{z - t}{\frac{a - t}{y}} - y\right)\\
\end{array}
\end{array}
if t < -1.25e85 or 8.7999999999999995e148 < t Initial program 44.4%
associate--l+48.5%
associate-/l*75.6%
Simplified75.6%
Taylor expanded in t around inf 74.2%
sub-neg74.2%
+-commutative74.2%
mul-1-neg74.2%
unsub-neg74.2%
associate-/l*81.7%
mul-1-neg81.7%
remove-double-neg81.7%
associate-/l*96.5%
Simplified96.5%
if -1.25e85 < t < 8.7999999999999995e148Initial program 86.4%
associate--l+87.5%
associate-/l*93.6%
Simplified93.6%
Final simplification94.5%
(FPCore (x y z t a)
:precision binary64
(if (<= x -2.5e+121)
x
(if (<= x -3.5e-182)
(+ x y)
(if (<= x 1.5e-244)
(* z (/ y t))
(if (<= x 7e-110) (* y (- 1.0 (/ z a))) (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.5e+121) {
tmp = x;
} else if (x <= -3.5e-182) {
tmp = x + y;
} else if (x <= 1.5e-244) {
tmp = z * (y / t);
} else if (x <= 7e-110) {
tmp = y * (1.0 - (z / a));
} 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 (x <= (-2.5d+121)) then
tmp = x
else if (x <= (-3.5d-182)) then
tmp = x + y
else if (x <= 1.5d-244) then
tmp = z * (y / t)
else if (x <= 7d-110) then
tmp = y * (1.0d0 - (z / a))
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 (x <= -2.5e+121) {
tmp = x;
} else if (x <= -3.5e-182) {
tmp = x + y;
} else if (x <= 1.5e-244) {
tmp = z * (y / t);
} else if (x <= 7e-110) {
tmp = y * (1.0 - (z / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -2.5e+121: tmp = x elif x <= -3.5e-182: tmp = x + y elif x <= 1.5e-244: tmp = z * (y / t) elif x <= 7e-110: tmp = y * (1.0 - (z / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.5e+121) tmp = x; elseif (x <= -3.5e-182) tmp = Float64(x + y); elseif (x <= 1.5e-244) tmp = Float64(z * Float64(y / t)); elseif (x <= 7e-110) tmp = Float64(y * Float64(1.0 - Float64(z / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -2.5e+121) tmp = x; elseif (x <= -3.5e-182) tmp = x + y; elseif (x <= 1.5e-244) tmp = z * (y / t); elseif (x <= 7e-110) tmp = y * (1.0 - (z / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.5e+121], x, If[LessEqual[x, -3.5e-182], N[(x + y), $MachinePrecision], If[LessEqual[x, 1.5e-244], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7e-110], N[(y * N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+121}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{-182}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-244}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-110}:\\
\;\;\;\;y \cdot \left(1 - \frac{z}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if x < -2.50000000000000004e121Initial program 69.4%
associate--l+69.4%
sub-neg69.4%
+-commutative69.4%
associate-/l*96.4%
distribute-neg-frac96.4%
associate-/r/94.3%
fma-def94.3%
sub-neg94.3%
+-commutative94.3%
distribute-neg-in94.3%
unsub-neg94.3%
remove-double-neg94.3%
Simplified94.3%
Taylor expanded in x around inf 88.7%
if -2.50000000000000004e121 < x < -3.49999999999999983e-182 or 6.99999999999999947e-110 < x Initial program 80.2%
associate--l+82.6%
sub-neg82.6%
+-commutative82.6%
associate-/l*91.0%
distribute-neg-frac91.0%
associate-/r/92.3%
fma-def92.3%
sub-neg92.3%
+-commutative92.3%
distribute-neg-in92.3%
unsub-neg92.3%
remove-double-neg92.3%
Simplified92.3%
Taylor expanded in a around inf 64.2%
if -3.49999999999999983e-182 < x < 1.5000000000000001e-244Initial program 59.5%
associate--l+59.4%
associate-/l*68.6%
Simplified68.6%
Taylor expanded in t around inf 57.2%
sub-neg57.2%
+-commutative57.2%
mul-1-neg57.2%
unsub-neg57.2%
associate-/l*57.1%
mul-1-neg57.1%
remove-double-neg57.1%
associate-/l*70.7%
Simplified70.7%
clear-num70.6%
inv-pow70.6%
Applied egg-rr70.6%
unpow-170.6%
Simplified70.6%
Taylor expanded in z around inf 40.1%
associate-*l/51.0%
*-commutative51.0%
Simplified51.0%
if 1.5000000000000001e-244 < x < 6.99999999999999947e-110Initial program 67.7%
associate-*l/75.9%
Simplified75.9%
Taylor expanded in t around 0 63.6%
Taylor expanded in y around inf 59.8%
Final simplification66.5%
(FPCore (x y z t a)
:precision binary64
(if (<= x -7.5e+121)
x
(if (<= x -4.7e-182)
(+ x y)
(if (<= x 2.5e-243)
(* (/ y t) (- z a))
(if (<= x 8e-110) (* y (- 1.0 (/ z a))) (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -7.5e+121) {
tmp = x;
} else if (x <= -4.7e-182) {
tmp = x + y;
} else if (x <= 2.5e-243) {
tmp = (y / t) * (z - a);
} else if (x <= 8e-110) {
tmp = y * (1.0 - (z / a));
} 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 (x <= (-7.5d+121)) then
tmp = x
else if (x <= (-4.7d-182)) then
tmp = x + y
else if (x <= 2.5d-243) then
tmp = (y / t) * (z - a)
else if (x <= 8d-110) then
tmp = y * (1.0d0 - (z / a))
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 (x <= -7.5e+121) {
tmp = x;
} else if (x <= -4.7e-182) {
tmp = x + y;
} else if (x <= 2.5e-243) {
tmp = (y / t) * (z - a);
} else if (x <= 8e-110) {
tmp = y * (1.0 - (z / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -7.5e+121: tmp = x elif x <= -4.7e-182: tmp = x + y elif x <= 2.5e-243: tmp = (y / t) * (z - a) elif x <= 8e-110: tmp = y * (1.0 - (z / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -7.5e+121) tmp = x; elseif (x <= -4.7e-182) tmp = Float64(x + y); elseif (x <= 2.5e-243) tmp = Float64(Float64(y / t) * Float64(z - a)); elseif (x <= 8e-110) tmp = Float64(y * Float64(1.0 - Float64(z / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -7.5e+121) tmp = x; elseif (x <= -4.7e-182) tmp = x + y; elseif (x <= 2.5e-243) tmp = (y / t) * (z - a); elseif (x <= 8e-110) tmp = y * (1.0 - (z / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -7.5e+121], x, If[LessEqual[x, -4.7e-182], N[(x + y), $MachinePrecision], If[LessEqual[x, 2.5e-243], N[(N[(y / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e-110], N[(y * N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{+121}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -4.7 \cdot 10^{-182}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-243}:\\
\;\;\;\;\frac{y}{t} \cdot \left(z - a\right)\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-110}:\\
\;\;\;\;y \cdot \left(1 - \frac{z}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if x < -7.49999999999999965e121Initial program 69.4%
associate--l+69.4%
sub-neg69.4%
+-commutative69.4%
associate-/l*96.4%
distribute-neg-frac96.4%
associate-/r/94.3%
fma-def94.3%
sub-neg94.3%
+-commutative94.3%
distribute-neg-in94.3%
unsub-neg94.3%
remove-double-neg94.3%
Simplified94.3%
Taylor expanded in x around inf 88.7%
if -7.49999999999999965e121 < x < -4.7e-182 or 8.0000000000000004e-110 < x Initial program 80.2%
associate--l+82.6%
sub-neg82.6%
+-commutative82.6%
associate-/l*91.0%
distribute-neg-frac91.0%
associate-/r/92.3%
fma-def92.3%
sub-neg92.3%
+-commutative92.3%
distribute-neg-in92.3%
unsub-neg92.3%
remove-double-neg92.3%
Simplified92.3%
Taylor expanded in a around inf 64.2%
if -4.7e-182 < x < 2.5e-243Initial program 59.5%
associate--l+59.4%
associate-/l*68.6%
Simplified68.6%
Taylor expanded in t around inf 57.2%
sub-neg57.2%
+-commutative57.2%
mul-1-neg57.2%
unsub-neg57.2%
associate-/l*57.1%
mul-1-neg57.1%
remove-double-neg57.1%
associate-/l*70.7%
Simplified70.7%
Taylor expanded in x around 0 48.5%
associate-*l/59.6%
associate-*l/61.6%
distribute-lft-out--61.6%
Simplified61.6%
if 2.5e-243 < x < 8.0000000000000004e-110Initial program 67.7%
associate-*l/75.9%
Simplified75.9%
Taylor expanded in t around 0 63.6%
Taylor expanded in y around inf 59.8%
Final simplification68.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.1e+85) (not (<= t 2.2e+119))) (+ x (/ y (/ t z))) (+ x (- y (/ y (/ (- a t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.1e+85) || !(t <= 2.2e+119)) {
tmp = x + (y / (t / z));
} else {
tmp = x + (y - (y / ((a - 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) :: tmp
if ((t <= (-1.1d+85)) .or. (.not. (t <= 2.2d+119))) then
tmp = x + (y / (t / z))
else
tmp = x + (y - (y / ((a - t) / z)))
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.1e+85) || !(t <= 2.2e+119)) {
tmp = x + (y / (t / z));
} else {
tmp = x + (y - (y / ((a - t) / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.1e+85) or not (t <= 2.2e+119): tmp = x + (y / (t / z)) else: tmp = x + (y - (y / ((a - t) / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.1e+85) || !(t <= 2.2e+119)) tmp = Float64(x + Float64(y / Float64(t / z))); else tmp = Float64(x + Float64(y - Float64(y / Float64(Float64(a - t) / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.1e+85) || ~((t <= 2.2e+119))) tmp = x + (y / (t / z)); else tmp = x + (y - (y / ((a - t) / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.1e+85], N[Not[LessEqual[t, 2.2e+119]], $MachinePrecision]], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y - N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{+85} \lor \neg \left(t \leq 2.2 \cdot 10^{+119}\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - \frac{y}{\frac{a - t}{z}}\right)\\
\end{array}
\end{array}
if t < -1.1000000000000001e85 or 2.2000000000000001e119 < t Initial program 44.0%
associate--l+47.8%
sub-neg47.8%
+-commutative47.8%
associate-/l*76.7%
distribute-neg-frac76.7%
associate-/r/77.9%
fma-def77.9%
sub-neg77.9%
+-commutative77.9%
distribute-neg-in77.9%
unsub-neg77.9%
remove-double-neg77.9%
Simplified77.9%
Taylor expanded in z around inf 71.5%
associate-*r/71.5%
associate-*r*71.5%
neg-mul-171.5%
Simplified71.5%
Taylor expanded in a around 0 71.5%
associate-/l*83.6%
Simplified83.6%
if -1.1000000000000001e85 < t < 2.2000000000000001e119Initial program 88.5%
associate--l+89.7%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in z around inf 88.2%
associate-/l*93.2%
Simplified93.2%
Final simplification90.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.95e+77) (+ x (/ y (/ t z))) (- x (- (/ (- z t) (/ (- a t) y)) y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.95e+77) {
tmp = x + (y / (t / z));
} else {
tmp = x - (((z - t) / ((a - t) / y)) - 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 (t <= (-3.95d+77)) then
tmp = x + (y / (t / z))
else
tmp = x - (((z - t) / ((a - t) / y)) - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.95e+77) {
tmp = x + (y / (t / z));
} else {
tmp = x - (((z - t) / ((a - t) / y)) - y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.95e+77: tmp = x + (y / (t / z)) else: tmp = x - (((z - t) / ((a - t) / y)) - y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.95e+77) tmp = Float64(x + Float64(y / Float64(t / z))); else tmp = Float64(x - Float64(Float64(Float64(z - t) / Float64(Float64(a - t) / y)) - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.95e+77) tmp = x + (y / (t / z)); else tmp = x - (((z - t) / ((a - t) / y)) - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.95e+77], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(N[(z - t), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.95 \cdot 10^{+77}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - \left(\frac{z - t}{\frac{a - t}{y}} - y\right)\\
\end{array}
\end{array}
if t < -3.95000000000000011e77Initial program 43.5%
associate--l+50.2%
sub-neg50.2%
+-commutative50.2%
associate-/l*70.8%
distribute-neg-frac70.8%
associate-/r/73.1%
fma-def73.1%
sub-neg73.1%
+-commutative73.1%
distribute-neg-in73.1%
unsub-neg73.1%
remove-double-neg73.1%
Simplified73.1%
Taylor expanded in z around inf 77.8%
associate-*r/77.8%
associate-*r*77.8%
neg-mul-177.8%
Simplified77.8%
Taylor expanded in a around 0 77.8%
associate-/l*84.5%
Simplified84.5%
if -3.95000000000000011e77 < t Initial program 79.4%
associate--l+80.5%
associate-/l*91.5%
Simplified91.5%
Final simplification90.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.5e-137) (not (<= a 1.7e-35))) (+ y (- x (/ y (/ a z)))) (+ x (/ y (/ t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.5e-137) || !(a <= 1.7e-35)) {
tmp = y + (x - (y / (a / z)));
} else {
tmp = x + (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) :: tmp
if ((a <= (-1.5d-137)) .or. (.not. (a <= 1.7d-35))) then
tmp = y + (x - (y / (a / z)))
else
tmp = x + (y / (t / z))
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.5e-137) || !(a <= 1.7e-35)) {
tmp = y + (x - (y / (a / z)));
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.5e-137) or not (a <= 1.7e-35): tmp = y + (x - (y / (a / z))) else: tmp = x + (y / (t / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.5e-137) || !(a <= 1.7e-35)) tmp = Float64(y + Float64(x - Float64(y / Float64(a / z)))); else tmp = Float64(x + Float64(y / Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.5e-137) || ~((a <= 1.7e-35))) tmp = y + (x - (y / (a / z))); else tmp = x + (y / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.5e-137], N[Not[LessEqual[a, 1.7e-35]], $MachinePrecision]], N[(y + N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.5 \cdot 10^{-137} \lor \neg \left(a \leq 1.7 \cdot 10^{-35}\right):\\
\;\;\;\;y + \left(x - \frac{y}{\frac{a}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if a < -1.4999999999999999e-137 or 1.7000000000000001e-35 < a Initial program 75.3%
associate--l+75.9%
sub-neg75.9%
+-commutative75.9%
associate-/l*89.0%
distribute-neg-frac89.0%
associate-/r/90.8%
fma-def90.7%
sub-neg90.7%
+-commutative90.7%
distribute-neg-in90.7%
unsub-neg90.7%
remove-double-neg90.7%
Simplified90.7%
Taylor expanded in t around 0 75.1%
mul-1-neg75.1%
sub-neg75.1%
associate-/l*82.4%
Simplified82.4%
if -1.4999999999999999e-137 < a < 1.7000000000000001e-35Initial program 70.5%
associate--l+74.7%
sub-neg74.7%
+-commutative74.7%
associate-/l*86.5%
distribute-neg-frac86.5%
associate-/r/86.3%
fma-def86.3%
sub-neg86.3%
+-commutative86.3%
distribute-neg-in86.3%
unsub-neg86.3%
remove-double-neg86.3%
Simplified86.3%
Taylor expanded in z around inf 88.6%
associate-*r/88.6%
associate-*r*88.6%
neg-mul-188.6%
Simplified88.6%
Taylor expanded in a around 0 79.9%
associate-/l*84.6%
Simplified84.6%
Final simplification83.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.95e-17) (- (+ x y) (* y (/ z a))) (if (<= a 1.8e+43) (- x (/ (* y z) (- a t))) (+ y (- x (/ y (/ a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.95e-17) {
tmp = (x + y) - (y * (z / a));
} else if (a <= 1.8e+43) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = y + (x - (y / (a / 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) :: tmp
if (a <= (-1.95d-17)) then
tmp = (x + y) - (y * (z / a))
else if (a <= 1.8d+43) then
tmp = x - ((y * z) / (a - t))
else
tmp = y + (x - (y / (a / z)))
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.95e-17) {
tmp = (x + y) - (y * (z / a));
} else if (a <= 1.8e+43) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = y + (x - (y / (a / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.95e-17: tmp = (x + y) - (y * (z / a)) elif a <= 1.8e+43: tmp = x - ((y * z) / (a - t)) else: tmp = y + (x - (y / (a / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.95e-17) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); elseif (a <= 1.8e+43) tmp = Float64(x - Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(y + Float64(x - Float64(y / Float64(a / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.95e-17) tmp = (x + y) - (y * (z / a)); elseif (a <= 1.8e+43) tmp = x - ((y * z) / (a - t)); else tmp = y + (x - (y / (a / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.95e-17], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.8e+43], N[(x - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.95 \cdot 10^{-17}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{+43}:\\
\;\;\;\;x - \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;y + \left(x - \frac{y}{\frac{a}{z}}\right)\\
\end{array}
\end{array}
if a < -1.94999999999999995e-17Initial program 74.8%
associate-*l/87.2%
Simplified87.2%
Taylor expanded in t around 0 85.8%
if -1.94999999999999995e-17 < a < 1.80000000000000005e43Initial program 72.0%
associate--l+75.0%
sub-neg75.0%
+-commutative75.0%
associate-/l*87.0%
distribute-neg-frac87.0%
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 z around inf 84.4%
associate-*r/84.4%
associate-*r*84.4%
neg-mul-184.4%
Simplified84.4%
if 1.80000000000000005e43 < a Initial program 75.3%
associate--l+75.3%
sub-neg75.3%
+-commutative75.3%
associate-/l*94.8%
distribute-neg-frac94.8%
associate-/r/94.9%
fma-def94.9%
sub-neg94.9%
+-commutative94.9%
distribute-neg-in94.9%
unsub-neg94.9%
remove-double-neg94.9%
Simplified94.9%
Taylor expanded in t around 0 79.6%
mul-1-neg79.6%
sub-neg79.6%
associate-/l*90.4%
Simplified90.4%
Final simplification86.0%
(FPCore (x y z t a) :precision binary64 (if (<= x -7e+121) x (if (<= x -3.8e-182) (+ x y) (if (<= x 5.1e-197) (* z (/ y t)) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -7e+121) {
tmp = x;
} else if (x <= -3.8e-182) {
tmp = x + y;
} else if (x <= 5.1e-197) {
tmp = z * (y / 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 (x <= (-7d+121)) then
tmp = x
else if (x <= (-3.8d-182)) then
tmp = x + y
else if (x <= 5.1d-197) then
tmp = z * (y / 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 (x <= -7e+121) {
tmp = x;
} else if (x <= -3.8e-182) {
tmp = x + y;
} else if (x <= 5.1e-197) {
tmp = z * (y / t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -7e+121: tmp = x elif x <= -3.8e-182: tmp = x + y elif x <= 5.1e-197: tmp = z * (y / t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -7e+121) tmp = x; elseif (x <= -3.8e-182) tmp = Float64(x + y); elseif (x <= 5.1e-197) tmp = Float64(z * Float64(y / t)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -7e+121) tmp = x; elseif (x <= -3.8e-182) tmp = x + y; elseif (x <= 5.1e-197) tmp = z * (y / t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -7e+121], x, If[LessEqual[x, -3.8e-182], N[(x + y), $MachinePrecision], If[LessEqual[x, 5.1e-197], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{+121}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-182}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;x \leq 5.1 \cdot 10^{-197}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if x < -6.9999999999999999e121Initial program 69.4%
associate--l+69.4%
sub-neg69.4%
+-commutative69.4%
associate-/l*96.4%
distribute-neg-frac96.4%
associate-/r/94.3%
fma-def94.3%
sub-neg94.3%
+-commutative94.3%
distribute-neg-in94.3%
unsub-neg94.3%
remove-double-neg94.3%
Simplified94.3%
Taylor expanded in x around inf 88.7%
if -6.9999999999999999e121 < x < -3.8000000000000003e-182 or 5.1000000000000003e-197 < x Initial program 79.1%
associate--l+81.9%
sub-neg81.9%
+-commutative81.9%
associate-/l*90.7%
distribute-neg-frac90.7%
associate-/r/91.9%
fma-def91.8%
sub-neg91.8%
+-commutative91.8%
distribute-neg-in91.8%
unsub-neg91.8%
remove-double-neg91.8%
Simplified91.8%
Taylor expanded in a around inf 62.3%
if -3.8000000000000003e-182 < x < 5.1000000000000003e-197Initial program 60.2%
associate--l+62.0%
associate-/l*71.7%
Simplified71.7%
Taylor expanded in t around inf 54.3%
sub-neg54.3%
+-commutative54.3%
mul-1-neg54.3%
unsub-neg54.3%
associate-/l*54.2%
mul-1-neg54.2%
remove-double-neg54.2%
associate-/l*65.6%
Simplified65.6%
clear-num65.6%
inv-pow65.6%
Applied egg-rr65.6%
unpow-165.6%
Simplified65.6%
Taylor expanded in z around inf 38.1%
associate-*l/47.3%
*-commutative47.3%
Simplified47.3%
Final simplification64.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.02e+52) x (if (<= t 2.9e+95) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.02e+52) {
tmp = x;
} else if (t <= 2.9e+95) {
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 <= (-1.02d+52)) then
tmp = x
else if (t <= 2.9d+95) 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 <= -1.02e+52) {
tmp = x;
} else if (t <= 2.9e+95) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.02e+52: tmp = x elif t <= 2.9e+95: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.02e+52) tmp = x; elseif (t <= 2.9e+95) 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 <= -1.02e+52) tmp = x; elseif (t <= 2.9e+95) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.02e+52], x, If[LessEqual[t, 2.9e+95], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.02 \cdot 10^{+52}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+95}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.02000000000000002e52 or 2.90000000000000013e95 < t Initial program 47.5%
associate--l+50.7%
sub-neg50.7%
+-commutative50.7%
associate-/l*77.9%
distribute-neg-frac77.9%
associate-/r/78.9%
fma-def78.9%
sub-neg78.9%
+-commutative78.9%
distribute-neg-in78.9%
unsub-neg78.9%
remove-double-neg78.9%
Simplified78.9%
Taylor expanded in x around inf 67.3%
if -1.02000000000000002e52 < t < 2.90000000000000013e95Initial program 90.0%
associate--l+91.3%
sub-neg91.3%
+-commutative91.3%
associate-/l*94.5%
distribute-neg-frac94.5%
associate-/r/95.5%
fma-def95.5%
sub-neg95.5%
+-commutative95.5%
distribute-neg-in95.5%
unsub-neg95.5%
remove-double-neg95.5%
Simplified95.5%
Taylor expanded in a around inf 58.4%
Final simplification61.9%
(FPCore (x y z t a) :precision binary64 (if (<= a 5.6e+261) x y))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 5.6e+261) {
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 (a <= 5.6d+261) 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 (a <= 5.6e+261) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 5.6e+261: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 5.6e+261) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 5.6e+261) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 5.6e+261], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 5.6 \cdot 10^{+261}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if a < 5.5999999999999996e261Initial program 73.4%
associate--l+75.6%
sub-neg75.6%
+-commutative75.6%
associate-/l*87.1%
distribute-neg-frac87.1%
associate-/r/88.2%
fma-def88.2%
sub-neg88.2%
+-commutative88.2%
distribute-neg-in88.2%
unsub-neg88.2%
remove-double-neg88.2%
Simplified88.2%
Taylor expanded in x around inf 50.7%
if 5.5999999999999996e261 < a Initial program 72.9%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
Taylor expanded in x around 0 48.7%
associate-*l/70.6%
*-commutative70.6%
Simplified70.6%
Taylor expanded in z around 0 70.6%
Final simplification52.1%
(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+75.4%
sub-neg75.4%
+-commutative75.4%
associate-/l*88.0%
distribute-neg-frac88.0%
associate-/r/89.0%
fma-def89.0%
sub-neg89.0%
+-commutative89.0%
distribute-neg-in89.0%
unsub-neg89.0%
remove-double-neg89.0%
Simplified89.0%
Taylor expanded in x around inf 49.2%
Final simplification49.2%
(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 2023229
(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))))