
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* z t)) a))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
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)) / a
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
def code(x, y, z, t, a): return ((x * y) - (z * t)) / a
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(z * t)) / a) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - (z * t)) / a; end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - z \cdot t}{a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* z t)) a))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
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)) / a
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
def code(x, y, z, t, a): return ((x * y) - (z * t)) / a
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(z * t)) / a) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - (z * t)) / a; end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - z \cdot t}{a}
\end{array}
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 1 a)
(FPCore (a_s x y z t a_m)
:precision binary64
(let* ((t_1 (* t (/ z a_m))) (t_2 (- (* x y) (* z t))))
(*
a_s
(if (<= t_2 (- INFINITY))
(- (/ (* y (/ x (sqrt a_m))) (sqrt a_m)) t_1)
(if (<= t_2 5e+261)
(/ (fma x y (* z (- t))) a_m)
(- (* (* x (/ 1.0 (sqrt a_m))) (/ y (sqrt a_m))) t_1))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double t_1 = t * (z / a_m);
double t_2 = (x * y) - (z * t);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = ((y * (x / sqrt(a_m))) / sqrt(a_m)) - t_1;
} else if (t_2 <= 5e+261) {
tmp = fma(x, y, (z * -t)) / a_m;
} else {
tmp = ((x * (1.0 / sqrt(a_m))) * (y / sqrt(a_m))) - t_1;
}
return a_s * tmp;
}
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, x, y, z, t, a_m) t_1 = Float64(t * Float64(z / a_m)) t_2 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(Float64(y * Float64(x / sqrt(a_m))) / sqrt(a_m)) - t_1); elseif (t_2 <= 5e+261) tmp = Float64(fma(x, y, Float64(z * Float64(-t))) / a_m); else tmp = Float64(Float64(Float64(x * Float64(1.0 / sqrt(a_m))) * Float64(y / sqrt(a_m))) - t_1); end return Float64(a_s * tmp) end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[(t * N[(z / a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[t$95$2, (-Infinity)], N[(N[(N[(y * N[(x / N[Sqrt[a$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[a$95$m], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 5e+261], N[(N[(x * y + N[(z * (-t)), $MachinePrecision]), $MachinePrecision] / a$95$m), $MachinePrecision], N[(N[(N[(x * N[(1.0 / N[Sqrt[a$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[Sqrt[a$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_1 := t \cdot \frac{z}{a\_m}\\
t_2 := x \cdot y - z \cdot t\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\frac{y \cdot \frac{x}{\sqrt{a\_m}}}{\sqrt{a\_m}} - t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+261}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \frac{1}{\sqrt{a\_m}}\right) \cdot \frac{y}{\sqrt{a\_m}} - t\_1\\
\end{array}
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 60.0%
div-sub60.0%
*-un-lft-identity60.0%
add-sqr-sqrt23.5%
times-frac23.5%
fma-neg23.5%
associate-/l*35.1%
Applied egg-rr35.1%
fma-undefine35.1%
distribute-lft-neg-in35.1%
cancel-sign-sub-inv35.1%
associate-*l/35.1%
*-lft-identity35.1%
*-commutative35.1%
associate-/l*43.4%
associate-*r/31.8%
*-commutative31.8%
associate-/l*43.3%
Simplified43.3%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 5.0000000000000001e261Initial program 98.7%
div-sub97.1%
*-commutative97.1%
div-sub98.7%
*-commutative98.7%
fma-neg98.7%
distribute-rgt-neg-out98.7%
Simplified98.7%
if 5.0000000000000001e261 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 71.5%
div-sub71.5%
*-un-lft-identity71.5%
add-sqr-sqrt32.9%
times-frac32.9%
fma-neg32.9%
associate-/l*37.5%
Applied egg-rr37.5%
fma-undefine37.5%
distribute-lft-neg-in37.5%
cancel-sign-sub-inv37.5%
associate-/l*39.9%
associate-*r*39.9%
associate-*r/35.3%
*-commutative35.3%
associate-/l*40.0%
Simplified40.0%
Final simplification84.5%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 1 a)
(FPCore (a_s x y z t a_m)
:precision binary64
(let* ((t_1 (- (* x y) (* z t))))
(*
a_s
(if (<= t_1 (- INFINITY))
(- (/ (* y (/ x (sqrt a_m))) (sqrt a_m)) (* t (/ z a_m)))
(if (<= t_1 1e+168)
(/ (fma x y (* z (- t))) a_m)
(- (* x (/ y a_m)) (/ t (/ a_m z))))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double t_1 = (x * y) - (z * t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = ((y * (x / sqrt(a_m))) / sqrt(a_m)) - (t * (z / a_m));
} else if (t_1 <= 1e+168) {
tmp = fma(x, y, (z * -t)) / a_m;
} else {
tmp = (x * (y / a_m)) - (t / (a_m / z));
}
return a_s * tmp;
}
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, x, y, z, t, a_m) t_1 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(Float64(y * Float64(x / sqrt(a_m))) / sqrt(a_m)) - Float64(t * Float64(z / a_m))); elseif (t_1 <= 1e+168) tmp = Float64(fma(x, y, Float64(z * Float64(-t))) / a_m); else tmp = Float64(Float64(x * Float64(y / a_m)) - Float64(t / Float64(a_m / z))); end return Float64(a_s * tmp) end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(y * N[(x / N[Sqrt[a$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[a$95$m], $MachinePrecision]), $MachinePrecision] - N[(t * N[(z / a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+168], N[(N[(x * y + N[(z * (-t)), $MachinePrecision]), $MachinePrecision] / a$95$m), $MachinePrecision], N[(N[(x * N[(y / a$95$m), $MachinePrecision]), $MachinePrecision] - N[(t / N[(a$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{y \cdot \frac{x}{\sqrt{a\_m}}}{\sqrt{a\_m}} - t \cdot \frac{z}{a\_m}\\
\mathbf{elif}\;t\_1 \leq 10^{+168}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a\_m} - \frac{t}{\frac{a\_m}{z}}\\
\end{array}
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 60.0%
div-sub60.0%
*-un-lft-identity60.0%
add-sqr-sqrt23.5%
times-frac23.5%
fma-neg23.5%
associate-/l*35.1%
Applied egg-rr35.1%
fma-undefine35.1%
distribute-lft-neg-in35.1%
cancel-sign-sub-inv35.1%
associate-*l/35.1%
*-lft-identity35.1%
*-commutative35.1%
associate-/l*43.4%
associate-*r/31.8%
*-commutative31.8%
associate-/l*43.3%
Simplified43.3%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 9.9999999999999993e167Initial program 98.6%
div-sub96.8%
*-commutative96.8%
div-sub98.6%
*-commutative98.6%
fma-neg98.6%
distribute-rgt-neg-out98.6%
Simplified98.6%
if 9.9999999999999993e167 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 81.2%
div-sub81.2%
*-un-lft-identity81.2%
add-sqr-sqrt37.9%
times-frac37.8%
fma-neg37.8%
associate-/l*40.8%
Applied egg-rr40.8%
fma-undefine40.8%
distribute-lft-neg-in40.8%
cancel-sign-sub-inv40.8%
associate-*l/40.8%
*-lft-identity40.8%
*-commutative40.8%
associate-/l*42.4%
associate-*r/39.4%
*-commutative39.4%
associate-/l*42.4%
Simplified42.4%
clear-num42.4%
un-div-inv42.4%
Applied egg-rr42.4%
associate-/l*42.5%
associate-/l/42.5%
add-sqr-sqrt96.6%
associate-/l*88.9%
associate-*l/98.1%
Applied egg-rr98.1%
Final simplification93.5%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 1 a)
(FPCore (a_s x y z t a_m)
:precision binary64
(let* ((t_1 (* x (/ y a_m))) (t_2 (- (* x y) (* z t))))
(*
a_s
(if (<= t_2 (- INFINITY))
(- t_1 (* z (/ t a_m)))
(if (<= t_2 1e+168)
(/ (fma x y (* z (- t))) a_m)
(- t_1 (/ t (/ a_m z))))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double t_1 = x * (y / a_m);
double t_2 = (x * y) - (z * t);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1 - (z * (t / a_m));
} else if (t_2 <= 1e+168) {
tmp = fma(x, y, (z * -t)) / a_m;
} else {
tmp = t_1 - (t / (a_m / z));
}
return a_s * tmp;
}
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, x, y, z, t, a_m) t_1 = Float64(x * Float64(y / a_m)) t_2 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(t_1 - Float64(z * Float64(t / a_m))); elseif (t_2 <= 1e+168) tmp = Float64(fma(x, y, Float64(z * Float64(-t))) / a_m); else tmp = Float64(t_1 - Float64(t / Float64(a_m / z))); end return Float64(a_s * tmp) end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[(x * N[(y / a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[t$95$2, (-Infinity)], N[(t$95$1 - N[(z * N[(t / a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+168], N[(N[(x * y + N[(z * (-t)), $MachinePrecision]), $MachinePrecision] / a$95$m), $MachinePrecision], N[(t$95$1 - N[(t / N[(a$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{a\_m}\\
t_2 := x \cdot y - z \cdot t\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1 - z \cdot \frac{t}{a\_m}\\
\mathbf{elif}\;t\_2 \leq 10^{+168}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_1 - \frac{t}{\frac{a\_m}{z}}\\
\end{array}
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 60.0%
div-sub60.0%
associate-/l*75.9%
associate-/l*95.5%
Applied egg-rr95.5%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 9.9999999999999993e167Initial program 98.6%
div-sub96.8%
*-commutative96.8%
div-sub98.6%
*-commutative98.6%
fma-neg98.6%
distribute-rgt-neg-out98.6%
Simplified98.6%
if 9.9999999999999993e167 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 81.2%
div-sub81.2%
*-un-lft-identity81.2%
add-sqr-sqrt37.9%
times-frac37.8%
fma-neg37.8%
associate-/l*40.8%
Applied egg-rr40.8%
fma-undefine40.8%
distribute-lft-neg-in40.8%
cancel-sign-sub-inv40.8%
associate-*l/40.8%
*-lft-identity40.8%
*-commutative40.8%
associate-/l*42.4%
associate-*r/39.4%
*-commutative39.4%
associate-/l*42.4%
Simplified42.4%
clear-num42.4%
un-div-inv42.4%
Applied egg-rr42.4%
associate-/l*42.5%
associate-/l/42.5%
add-sqr-sqrt96.6%
associate-/l*88.9%
associate-*l/98.1%
Applied egg-rr98.1%
Final simplification98.2%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 1 a)
(FPCore (a_s x y z t a_m)
:precision binary64
(let* ((t_1 (- (* x y) (* z t))))
(*
a_s
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+303)))
(- (* x (/ y a_m)) (* z (/ t a_m)))
(/ t_1 a_m)))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double t_1 = (x * y) - (z * t);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+303)) {
tmp = (x * (y / a_m)) - (z * (t / a_m));
} else {
tmp = t_1 / a_m;
}
return a_s * tmp;
}
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
double t_1 = (x * y) - (z * t);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+303)) {
tmp = (x * (y / a_m)) - (z * (t / a_m));
} else {
tmp = t_1 / a_m;
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, x, y, z, t, a_m): t_1 = (x * y) - (z * t) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 1e+303): tmp = (x * (y / a_m)) - (z * (t / a_m)) else: tmp = t_1 / a_m return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, x, y, z, t, a_m) t_1 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+303)) tmp = Float64(Float64(x * Float64(y / a_m)) - Float64(z * Float64(t / a_m))); else tmp = Float64(t_1 / a_m); end return Float64(a_s * tmp) end
a\_m = abs(a); a\_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, x, y, z, t, a_m) t_1 = (x * y) - (z * t); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 1e+303))) tmp = (x * (y / a_m)) - (z * (t / a_m)); else tmp = t_1 / a_m; end tmp_2 = a_s * tmp; end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+303]], $MachinePrecision]], N[(N[(x * N[(y / a$95$m), $MachinePrecision]), $MachinePrecision] - N[(z * N[(t / a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / a$95$m), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 10^{+303}\right):\\
\;\;\;\;x \cdot \frac{y}{a\_m} - z \cdot \frac{t}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{a\_m}\\
\end{array}
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0 or 1e303 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 63.3%
div-sub63.3%
associate-/l*76.6%
associate-/l*96.1%
Applied egg-rr96.1%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1e303Initial program 98.7%
Final simplification98.1%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 1 a)
(FPCore (a_s x y z t a_m)
:precision binary64
(let* ((t_1 (* x (/ y a_m))) (t_2 (- (* x y) (* z t))))
(*
a_s
(if (<= t_2 (- INFINITY))
(- t_1 (* z (/ t a_m)))
(if (<= t_2 1e+168) (/ t_2 a_m) (- t_1 (/ t (/ a_m z))))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double t_1 = x * (y / a_m);
double t_2 = (x * y) - (z * t);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1 - (z * (t / a_m));
} else if (t_2 <= 1e+168) {
tmp = t_2 / a_m;
} else {
tmp = t_1 - (t / (a_m / z));
}
return a_s * tmp;
}
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
double t_1 = x * (y / a_m);
double t_2 = (x * y) - (z * t);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1 - (z * (t / a_m));
} else if (t_2 <= 1e+168) {
tmp = t_2 / a_m;
} else {
tmp = t_1 - (t / (a_m / z));
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, x, y, z, t, a_m): t_1 = x * (y / a_m) t_2 = (x * y) - (z * t) tmp = 0 if t_2 <= -math.inf: tmp = t_1 - (z * (t / a_m)) elif t_2 <= 1e+168: tmp = t_2 / a_m else: tmp = t_1 - (t / (a_m / z)) return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, x, y, z, t, a_m) t_1 = Float64(x * Float64(y / a_m)) t_2 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(t_1 - Float64(z * Float64(t / a_m))); elseif (t_2 <= 1e+168) tmp = Float64(t_2 / a_m); else tmp = Float64(t_1 - Float64(t / Float64(a_m / z))); end return Float64(a_s * tmp) end
a\_m = abs(a); a\_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, x, y, z, t, a_m) t_1 = x * (y / a_m); t_2 = (x * y) - (z * t); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1 - (z * (t / a_m)); elseif (t_2 <= 1e+168) tmp = t_2 / a_m; else tmp = t_1 - (t / (a_m / z)); end tmp_2 = a_s * tmp; end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[(x * N[(y / a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[t$95$2, (-Infinity)], N[(t$95$1 - N[(z * N[(t / a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+168], N[(t$95$2 / a$95$m), $MachinePrecision], N[(t$95$1 - N[(t / N[(a$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{a\_m}\\
t_2 := x \cdot y - z \cdot t\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1 - z \cdot \frac{t}{a\_m}\\
\mathbf{elif}\;t\_2 \leq 10^{+168}:\\
\;\;\;\;\frac{t\_2}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_1 - \frac{t}{\frac{a\_m}{z}}\\
\end{array}
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 60.0%
div-sub60.0%
associate-/l*75.9%
associate-/l*95.5%
Applied egg-rr95.5%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 9.9999999999999993e167Initial program 98.6%
if 9.9999999999999993e167 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 81.2%
div-sub81.2%
*-un-lft-identity81.2%
add-sqr-sqrt37.9%
times-frac37.8%
fma-neg37.8%
associate-/l*40.8%
Applied egg-rr40.8%
fma-undefine40.8%
distribute-lft-neg-in40.8%
cancel-sign-sub-inv40.8%
associate-*l/40.8%
*-lft-identity40.8%
*-commutative40.8%
associate-/l*42.4%
associate-*r/39.4%
*-commutative39.4%
associate-/l*42.4%
Simplified42.4%
clear-num42.4%
un-div-inv42.4%
Applied egg-rr42.4%
associate-/l*42.5%
associate-/l/42.5%
add-sqr-sqrt96.6%
associate-/l*88.9%
associate-*l/98.1%
Applied egg-rr98.1%
Final simplification98.2%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 1 a)
(FPCore (a_s x y z t a_m)
:precision binary64
(*
a_s
(if (or (<= t -2.7e-85) (not (<= t 2e+170)))
(* t (/ z (- a_m)))
(* y (/ x a_m)))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if ((t <= -2.7e-85) || !(t <= 2e+170)) {
tmp = t * (z / -a_m);
} else {
tmp = y * (x / a_m);
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, x, y, z, t, a_m)
real(8), intent (in) :: a_s
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_m
real(8) :: tmp
if ((t <= (-2.7d-85)) .or. (.not. (t <= 2d+170))) then
tmp = t * (z / -a_m)
else
tmp = y * (x / a_m)
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if ((t <= -2.7e-85) || !(t <= 2e+170)) {
tmp = t * (z / -a_m);
} else {
tmp = y * (x / a_m);
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, x, y, z, t, a_m): tmp = 0 if (t <= -2.7e-85) or not (t <= 2e+170): tmp = t * (z / -a_m) else: tmp = y * (x / a_m) return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, x, y, z, t, a_m) tmp = 0.0 if ((t <= -2.7e-85) || !(t <= 2e+170)) tmp = Float64(t * Float64(z / Float64(-a_m))); else tmp = Float64(y * Float64(x / a_m)); end return Float64(a_s * tmp) end
a\_m = abs(a); a\_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, x, y, z, t, a_m) tmp = 0.0; if ((t <= -2.7e-85) || ~((t <= 2e+170))) tmp = t * (z / -a_m); else tmp = y * (x / a_m); end tmp_2 = a_s * tmp; end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[Or[LessEqual[t, -2.7e-85], N[Not[LessEqual[t, 2e+170]], $MachinePrecision]], N[(t * N[(z / (-a$95$m)), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / a$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{-85} \lor \neg \left(t \leq 2 \cdot 10^{+170}\right):\\
\;\;\;\;t \cdot \frac{z}{-a\_m}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a\_m}\\
\end{array}
\end{array}
if t < -2.7000000000000001e-85 or 2.00000000000000007e170 < t Initial program 88.6%
Taylor expanded in x around 0 62.4%
mul-1-neg62.4%
associate-/l*68.3%
distribute-rgt-neg-in68.3%
Simplified68.3%
if -2.7000000000000001e-85 < t < 2.00000000000000007e170Initial program 92.7%
Taylor expanded in x around inf 65.8%
*-commutative65.8%
associate-*r/69.1%
Simplified69.1%
Final simplification68.7%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 1 a)
(FPCore (a_s x y z t a_m)
:precision binary64
(*
a_s
(if (<= t -2.45e-85)
(* z (/ t (- a_m)))
(if (<= t 7.2e+171) (* y (/ x a_m)) (* t (/ z (- a_m)))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if (t <= -2.45e-85) {
tmp = z * (t / -a_m);
} else if (t <= 7.2e+171) {
tmp = y * (x / a_m);
} else {
tmp = t * (z / -a_m);
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, x, y, z, t, a_m)
real(8), intent (in) :: a_s
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_m
real(8) :: tmp
if (t <= (-2.45d-85)) then
tmp = z * (t / -a_m)
else if (t <= 7.2d+171) then
tmp = y * (x / a_m)
else
tmp = t * (z / -a_m)
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if (t <= -2.45e-85) {
tmp = z * (t / -a_m);
} else if (t <= 7.2e+171) {
tmp = y * (x / a_m);
} else {
tmp = t * (z / -a_m);
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, x, y, z, t, a_m): tmp = 0 if t <= -2.45e-85: tmp = z * (t / -a_m) elif t <= 7.2e+171: tmp = y * (x / a_m) else: tmp = t * (z / -a_m) return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, x, y, z, t, a_m) tmp = 0.0 if (t <= -2.45e-85) tmp = Float64(z * Float64(t / Float64(-a_m))); elseif (t <= 7.2e+171) tmp = Float64(y * Float64(x / a_m)); else tmp = Float64(t * Float64(z / Float64(-a_m))); end return Float64(a_s * tmp) end
a\_m = abs(a); a\_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, x, y, z, t, a_m) tmp = 0.0; if (t <= -2.45e-85) tmp = z * (t / -a_m); elseif (t <= 7.2e+171) tmp = y * (x / a_m); else tmp = t * (z / -a_m); end tmp_2 = a_s * tmp; end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[t, -2.45e-85], N[(z * N[(t / (-a$95$m)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e+171], N[(y * N[(x / a$95$m), $MachinePrecision]), $MachinePrecision], N[(t * N[(z / (-a$95$m)), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2.45 \cdot 10^{-85}:\\
\;\;\;\;z \cdot \frac{t}{-a\_m}\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+171}:\\
\;\;\;\;y \cdot \frac{x}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{z}{-a\_m}\\
\end{array}
\end{array}
if t < -2.45000000000000007e-85Initial program 87.4%
Taylor expanded in x around 0 54.9%
*-commutative54.9%
associate-*r/66.0%
neg-mul-166.0%
distribute-lft-neg-in66.0%
Simplified66.0%
if -2.45000000000000007e-85 < t < 7.20000000000000036e171Initial program 92.7%
Taylor expanded in x around inf 65.8%
*-commutative65.8%
associate-*r/69.1%
Simplified69.1%
if 7.20000000000000036e171 < t Initial program 92.4%
Taylor expanded in x around 0 85.3%
mul-1-neg85.3%
associate-/l*81.7%
distribute-rgt-neg-in81.7%
Simplified81.7%
Final simplification69.4%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 1 a)
(FPCore (a_s x y z t a_m)
:precision binary64
(*
a_s
(if (<= t -2.2e-80)
(* z (/ t (- a_m)))
(if (<= t 2e+170) (* y (/ x a_m)) (/ t (/ a_m (- z)))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if (t <= -2.2e-80) {
tmp = z * (t / -a_m);
} else if (t <= 2e+170) {
tmp = y * (x / a_m);
} else {
tmp = t / (a_m / -z);
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, x, y, z, t, a_m)
real(8), intent (in) :: a_s
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_m
real(8) :: tmp
if (t <= (-2.2d-80)) then
tmp = z * (t / -a_m)
else if (t <= 2d+170) then
tmp = y * (x / a_m)
else
tmp = t / (a_m / -z)
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if (t <= -2.2e-80) {
tmp = z * (t / -a_m);
} else if (t <= 2e+170) {
tmp = y * (x / a_m);
} else {
tmp = t / (a_m / -z);
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, x, y, z, t, a_m): tmp = 0 if t <= -2.2e-80: tmp = z * (t / -a_m) elif t <= 2e+170: tmp = y * (x / a_m) else: tmp = t / (a_m / -z) return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, x, y, z, t, a_m) tmp = 0.0 if (t <= -2.2e-80) tmp = Float64(z * Float64(t / Float64(-a_m))); elseif (t <= 2e+170) tmp = Float64(y * Float64(x / a_m)); else tmp = Float64(t / Float64(a_m / Float64(-z))); end return Float64(a_s * tmp) end
a\_m = abs(a); a\_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, x, y, z, t, a_m) tmp = 0.0; if (t <= -2.2e-80) tmp = z * (t / -a_m); elseif (t <= 2e+170) tmp = y * (x / a_m); else tmp = t / (a_m / -z); end tmp_2 = a_s * tmp; end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[t, -2.2e-80], N[(z * N[(t / (-a$95$m)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e+170], N[(y * N[(x / a$95$m), $MachinePrecision]), $MachinePrecision], N[(t / N[(a$95$m / (-z)), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{-80}:\\
\;\;\;\;z \cdot \frac{t}{-a\_m}\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+170}:\\
\;\;\;\;y \cdot \frac{x}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{a\_m}{-z}}\\
\end{array}
\end{array}
if t < -2.2000000000000001e-80Initial program 87.4%
Taylor expanded in x around 0 54.9%
*-commutative54.9%
associate-*r/66.0%
neg-mul-166.0%
distribute-lft-neg-in66.0%
Simplified66.0%
if -2.2000000000000001e-80 < t < 2.00000000000000007e170Initial program 92.7%
Taylor expanded in x around inf 65.8%
*-commutative65.8%
associate-*r/69.1%
Simplified69.1%
if 2.00000000000000007e170 < t Initial program 92.4%
Taylor expanded in x around 0 85.3%
mul-1-neg85.3%
*-commutative85.3%
distribute-rgt-neg-in85.3%
Simplified85.3%
*-commutative85.3%
associate-/l*81.7%
add-sqr-sqrt0.0%
sqrt-unprod7.5%
sqr-neg7.5%
sqrt-unprod1.1%
add-sqr-sqrt1.1%
clear-num1.1%
div-inv1.1%
frac-2neg1.1%
div-inv1.1%
add-sqr-sqrt0.0%
sqrt-unprod32.9%
sqr-neg32.9%
sqrt-unprod81.5%
add-sqr-sqrt81.7%
distribute-neg-frac281.7%
Applied egg-rr81.7%
associate-*r/81.8%
*-rgt-identity81.8%
Simplified81.8%
Final simplification69.4%
a\_m = (fabs.f64 a) a\_s = (copysign.f64 1 a) (FPCore (a_s x y z t a_m) :precision binary64 (* a_s (if (<= z -1.25e+242) (* z (/ t (- a_m))) (/ (- (* x y) (* z t)) a_m))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if (z <= -1.25e+242) {
tmp = z * (t / -a_m);
} else {
tmp = ((x * y) - (z * t)) / a_m;
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, x, y, z, t, a_m)
real(8), intent (in) :: a_s
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_m
real(8) :: tmp
if (z <= (-1.25d+242)) then
tmp = z * (t / -a_m)
else
tmp = ((x * y) - (z * t)) / a_m
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if (z <= -1.25e+242) {
tmp = z * (t / -a_m);
} else {
tmp = ((x * y) - (z * t)) / a_m;
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, x, y, z, t, a_m): tmp = 0 if z <= -1.25e+242: tmp = z * (t / -a_m) else: tmp = ((x * y) - (z * t)) / a_m return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, x, y, z, t, a_m) tmp = 0.0 if (z <= -1.25e+242) tmp = Float64(z * Float64(t / Float64(-a_m))); else tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a_m); end return Float64(a_s * tmp) end
a\_m = abs(a); a\_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, x, y, z, t, a_m) tmp = 0.0; if (z <= -1.25e+242) tmp = z * (t / -a_m); else tmp = ((x * y) - (z * t)) / a_m; end tmp_2 = a_s * tmp; end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[z, -1.25e+242], N[(z * N[(t / (-a$95$m)), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a$95$m), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{+242}:\\
\;\;\;\;z \cdot \frac{t}{-a\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a\_m}\\
\end{array}
\end{array}
if z < -1.2500000000000001e242Initial program 61.9%
Taylor expanded in x around 0 62.5%
*-commutative62.5%
associate-*r/96.4%
neg-mul-196.4%
distribute-lft-neg-in96.4%
Simplified96.4%
if -1.2500000000000001e242 < z Initial program 92.1%
Final simplification92.3%
a\_m = (fabs.f64 a) a\_s = (copysign.f64 1 a) (FPCore (a_s x y z t a_m) :precision binary64 (* a_s (if (<= x -4.7e-208) (* y (/ x a_m)) (* x (/ y a_m)))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if (x <= -4.7e-208) {
tmp = y * (x / a_m);
} else {
tmp = x * (y / a_m);
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, x, y, z, t, a_m)
real(8), intent (in) :: a_s
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_m
real(8) :: tmp
if (x <= (-4.7d-208)) then
tmp = y * (x / a_m)
else
tmp = x * (y / a_m)
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if (x <= -4.7e-208) {
tmp = y * (x / a_m);
} else {
tmp = x * (y / a_m);
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, x, y, z, t, a_m): tmp = 0 if x <= -4.7e-208: tmp = y * (x / a_m) else: tmp = x * (y / a_m) return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, x, y, z, t, a_m) tmp = 0.0 if (x <= -4.7e-208) tmp = Float64(y * Float64(x / a_m)); else tmp = Float64(x * Float64(y / a_m)); end return Float64(a_s * tmp) end
a\_m = abs(a); a\_s = sign(a) * abs(1.0); function tmp_2 = code(a_s, x, y, z, t, a_m) tmp = 0.0; if (x <= -4.7e-208) tmp = y * (x / a_m); else tmp = x * (y / a_m); end tmp_2 = a_s * tmp; end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[x, -4.7e-208], N[(y * N[(x / a$95$m), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / a$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -4.7 \cdot 10^{-208}:\\
\;\;\;\;y \cdot \frac{x}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a\_m}\\
\end{array}
\end{array}
if x < -4.7000000000000003e-208Initial program 89.4%
Taylor expanded in x around inf 53.6%
*-commutative53.6%
associate-*r/53.6%
Simplified53.6%
if -4.7000000000000003e-208 < x Initial program 92.1%
Taylor expanded in x around inf 50.0%
associate-*r/55.4%
Simplified55.4%
Final simplification54.7%
a\_m = (fabs.f64 a) a\_s = (copysign.f64 1 a) (FPCore (a_s x y z t a_m) :precision binary64 (* a_s (* x (/ y a_m))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
return a_s * (x * (y / a_m));
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, x, y, z, t, a_m)
real(8), intent (in) :: a_s
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_m
code = a_s * (x * (y / a_m))
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
return a_s * (x * (y / a_m));
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) def code(a_s, x, y, z, t, a_m): return a_s * (x * (y / a_m))
a\_m = abs(a) a\_s = copysign(1.0, a) function code(a_s, x, y, z, t, a_m) return Float64(a_s * Float64(x * Float64(y / a_m))) end
a\_m = abs(a); a\_s = sign(a) * abs(1.0); function tmp = code(a_s, x, y, z, t, a_m) tmp = a_s * (x * (y / a_m)); end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * N[(x * N[(y / a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
a\_s \cdot \left(x \cdot \frac{y}{a\_m}\right)
\end{array}
Initial program 90.9%
Taylor expanded in x around inf 51.6%
associate-*r/53.4%
Simplified53.4%
Final simplification53.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* (/ y a) x) (* (/ t a) z))))
(if (< z -2.468684968699548e+170)
t_1
(if (< z 6.309831121978371e-71) (/ (- (* x y) (* z t)) a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y / a) * x) - ((t / a) * z);
double tmp;
if (z < -2.468684968699548e+170) {
tmp = t_1;
} else if (z < 6.309831121978371e-71) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = ((y / a) * x) - ((t / a) * z)
if (z < (-2.468684968699548d+170)) then
tmp = t_1
else if (z < 6.309831121978371d-71) then
tmp = ((x * y) - (z * t)) / a
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 / a) * x) - ((t / a) * z);
double tmp;
if (z < -2.468684968699548e+170) {
tmp = t_1;
} else if (z < 6.309831121978371e-71) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y / a) * x) - ((t / a) * z) tmp = 0 if z < -2.468684968699548e+170: tmp = t_1 elif z < 6.309831121978371e-71: tmp = ((x * y) - (z * t)) / a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y / a) * x) - Float64(Float64(t / a) * z)) tmp = 0.0 if (z < -2.468684968699548e+170) tmp = t_1; elseif (z < 6.309831121978371e-71) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y / a) * x) - ((t / a) * z); tmp = 0.0; if (z < -2.468684968699548e+170) tmp = t_1; elseif (z < 6.309831121978371e-71) tmp = ((x * y) - (z * t)) / a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y / a), $MachinePrecision] * x), $MachinePrecision] - N[(N[(t / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -2.468684968699548e+170], t$95$1, If[Less[z, 6.309831121978371e-71], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a} \cdot x - \frac{t}{a} \cdot z\\
\mathbf{if}\;z < -2.468684968699548 \cdot 10^{+170}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 6.309831121978371 \cdot 10^{-71}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024053
(FPCore (x y z t a)
:name "Data.Colour.Matrix:inverse from colour-2.3.3, B"
:precision binary64
:alt
(if (< z -2.468684968699548e+170) (- (* (/ y a) x) (* (/ t a) z)) (if (< z 6.309831121978371e-71) (/ (- (* x y) (* z t)) a) (- (* (/ y a) x) (* (/ t a) z))))
(/ (- (* x y) (* z t)) a))