
(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 12 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 #s(literal 1 binary64) a)
(FPCore (a_s x y z t a_m)
:precision binary64
(*
a_s
(if (<= a_m 6.3e+106)
(/ (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 tmp;
if (a_m <= 6.3e+106) {
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) tmp = 0.0 if (a_m <= 6.3e+106) 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_] := N[(a$95$s * If[LessEqual[a$95$m, 6.3e+106], 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)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \leq 6.3 \cdot 10^{+106}:\\
\;\;\;\;\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}
if a < 6.29999999999999974e106Initial program 94.4%
div-sub91.6%
*-commutative91.6%
div-sub94.4%
*-commutative94.4%
fma-neg94.4%
distribute-rgt-neg-out94.4%
Simplified94.4%
if 6.29999999999999974e106 < a Initial program 74.4%
div-sub74.4%
associate-/l*89.7%
associate-/l*92.8%
Applied egg-rr92.8%
div-inv92.7%
add-sqr-sqrt47.9%
sqrt-unprod59.9%
sqr-neg59.9%
sqrt-unprod27.0%
add-sqr-sqrt55.1%
associate-*l*55.0%
*-commutative55.0%
div-inv55.0%
associate-/l*55.0%
clear-num55.0%
un-div-inv55.0%
add-sqr-sqrt27.1%
sqrt-unprod60.9%
sqr-neg60.9%
sqrt-unprod51.1%
add-sqr-sqrt93.8%
Applied egg-rr93.8%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s x y z t a_m)
:precision binary64
(*
a_s
(if (<= (* x y) -5e+145)
(/ x (/ a_m y))
(if (<= (* x y) -2e+57)
(/ (* z (- t)) a_m)
(if (<= (* x y) -2e-32)
(/ (* x y) a_m)
(if (<= (* x y) 5e-30) (/ -1.0 (/ (/ a_m t) z)) (* 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 * y) <= -5e+145) {
tmp = x / (a_m / y);
} else if ((x * y) <= -2e+57) {
tmp = (z * -t) / a_m;
} else if ((x * y) <= -2e-32) {
tmp = (x * y) / a_m;
} else if ((x * y) <= 5e-30) {
tmp = -1.0 / ((a_m / t) / z);
} 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 * y) <= (-5d+145)) then
tmp = x / (a_m / y)
else if ((x * y) <= (-2d+57)) then
tmp = (z * -t) / a_m
else if ((x * y) <= (-2d-32)) then
tmp = (x * y) / a_m
else if ((x * y) <= 5d-30) then
tmp = (-1.0d0) / ((a_m / t) / z)
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 * y) <= -5e+145) {
tmp = x / (a_m / y);
} else if ((x * y) <= -2e+57) {
tmp = (z * -t) / a_m;
} else if ((x * y) <= -2e-32) {
tmp = (x * y) / a_m;
} else if ((x * y) <= 5e-30) {
tmp = -1.0 / ((a_m / t) / z);
} 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 * y) <= -5e+145: tmp = x / (a_m / y) elif (x * y) <= -2e+57: tmp = (z * -t) / a_m elif (x * y) <= -2e-32: tmp = (x * y) / a_m elif (x * y) <= 5e-30: tmp = -1.0 / ((a_m / t) / z) 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 (Float64(x * y) <= -5e+145) tmp = Float64(x / Float64(a_m / y)); elseif (Float64(x * y) <= -2e+57) tmp = Float64(Float64(z * Float64(-t)) / a_m); elseif (Float64(x * y) <= -2e-32) tmp = Float64(Float64(x * y) / a_m); elseif (Float64(x * y) <= 5e-30) tmp = Float64(-1.0 / Float64(Float64(a_m / t) / z)); 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 * y) <= -5e+145) tmp = x / (a_m / y); elseif ((x * y) <= -2e+57) tmp = (z * -t) / a_m; elseif ((x * y) <= -2e-32) tmp = (x * y) / a_m; elseif ((x * y) <= 5e-30) tmp = -1.0 / ((a_m / t) / z); 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[N[(x * y), $MachinePrecision], -5e+145], N[(x / N[(a$95$m / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e+57], N[(N[(z * (-t)), $MachinePrecision] / a$95$m), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e-32], N[(N[(x * y), $MachinePrecision] / a$95$m), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-30], N[(-1.0 / N[(N[(a$95$m / t), $MachinePrecision] / z), $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 \cdot y \leq -5 \cdot 10^{+145}:\\
\;\;\;\;\frac{x}{\frac{a\_m}{y}}\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+57}:\\
\;\;\;\;\frac{z \cdot \left(-t\right)}{a\_m}\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-32}:\\
\;\;\;\;\frac{x \cdot y}{a\_m}\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-30}:\\
\;\;\;\;\frac{-1}{\frac{\frac{a\_m}{t}}{z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a\_m}\\
\end{array}
\end{array}
if (*.f64 x y) < -4.99999999999999967e145Initial program 88.6%
Taylor expanded in x around inf 72.2%
associate-*r/83.4%
Simplified83.4%
clear-num83.3%
un-div-inv83.5%
Applied egg-rr83.5%
if -4.99999999999999967e145 < (*.f64 x y) < -2.0000000000000001e57Initial program 99.7%
Taylor expanded in x around 0 77.3%
associate-*r*77.3%
mul-1-neg77.3%
Simplified77.3%
if -2.0000000000000001e57 < (*.f64 x y) < -2.00000000000000011e-32Initial program 99.7%
Taylor expanded in x around inf 76.3%
if -2.00000000000000011e-32 < (*.f64 x y) < 4.99999999999999972e-30Initial program 93.6%
Taylor expanded in x around 0 82.9%
associate-*r*82.9%
mul-1-neg82.9%
Simplified82.9%
*-commutative82.9%
distribute-rgt-neg-out82.9%
distribute-neg-frac82.9%
associate-*r/79.2%
*-commutative79.2%
distribute-rgt-neg-in79.2%
Applied egg-rr79.2%
distribute-rgt-neg-out79.2%
associate-*l/82.9%
clear-num82.4%
distribute-neg-frac82.4%
metadata-eval82.4%
associate-/r*79.8%
Applied egg-rr79.8%
if 4.99999999999999972e-30 < (*.f64 x y) Initial program 84.8%
Taylor expanded in x around inf 73.7%
associate-*r/76.3%
Simplified76.3%
Final simplification79.2%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s x y z t a_m)
:precision binary64
(let* ((t_1 (/ (* z (- t)) a_m)))
(*
a_s
(if (<= (* x y) -5e+145)
(/ x (/ a_m y))
(if (<= (* x y) -2e+57)
t_1
(if (<= (* x y) -2e-32)
(/ (* x y) a_m)
(if (<= (* x y) 5e-30) t_1 (* 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 t_1 = (z * -t) / a_m;
double tmp;
if ((x * y) <= -5e+145) {
tmp = x / (a_m / y);
} else if ((x * y) <= -2e+57) {
tmp = t_1;
} else if ((x * y) <= -2e-32) {
tmp = (x * y) / a_m;
} else if ((x * y) <= 5e-30) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (z * -t) / a_m
if ((x * y) <= (-5d+145)) then
tmp = x / (a_m / y)
else if ((x * y) <= (-2d+57)) then
tmp = t_1
else if ((x * y) <= (-2d-32)) then
tmp = (x * y) / a_m
else if ((x * y) <= 5d-30) then
tmp = t_1
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 t_1 = (z * -t) / a_m;
double tmp;
if ((x * y) <= -5e+145) {
tmp = x / (a_m / y);
} else if ((x * y) <= -2e+57) {
tmp = t_1;
} else if ((x * y) <= -2e-32) {
tmp = (x * y) / a_m;
} else if ((x * y) <= 5e-30) {
tmp = t_1;
} 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): t_1 = (z * -t) / a_m tmp = 0 if (x * y) <= -5e+145: tmp = x / (a_m / y) elif (x * y) <= -2e+57: tmp = t_1 elif (x * y) <= -2e-32: tmp = (x * y) / a_m elif (x * y) <= 5e-30: tmp = t_1 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) t_1 = Float64(Float64(z * Float64(-t)) / a_m) tmp = 0.0 if (Float64(x * y) <= -5e+145) tmp = Float64(x / Float64(a_m / y)); elseif (Float64(x * y) <= -2e+57) tmp = t_1; elseif (Float64(x * y) <= -2e-32) tmp = Float64(Float64(x * y) / a_m); elseif (Float64(x * y) <= 5e-30) tmp = t_1; 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) t_1 = (z * -t) / a_m; tmp = 0.0; if ((x * y) <= -5e+145) tmp = x / (a_m / y); elseif ((x * y) <= -2e+57) tmp = t_1; elseif ((x * y) <= -2e-32) tmp = (x * y) / a_m; elseif ((x * y) <= 5e-30) tmp = t_1; 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_] := Block[{t$95$1 = N[(N[(z * (-t)), $MachinePrecision] / a$95$m), $MachinePrecision]}, N[(a$95$s * If[LessEqual[N[(x * y), $MachinePrecision], -5e+145], N[(x / N[(a$95$m / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e+57], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2e-32], N[(N[(x * y), $MachinePrecision] / a$95$m), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-30], t$95$1, 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)
\\
\begin{array}{l}
t_1 := \frac{z \cdot \left(-t\right)}{a\_m}\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+145}:\\
\;\;\;\;\frac{x}{\frac{a\_m}{y}}\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-32}:\\
\;\;\;\;\frac{x \cdot y}{a\_m}\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-30}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a\_m}\\
\end{array}
\end{array}
\end{array}
if (*.f64 x y) < -4.99999999999999967e145Initial program 88.6%
Taylor expanded in x around inf 72.2%
associate-*r/83.4%
Simplified83.4%
clear-num83.3%
un-div-inv83.5%
Applied egg-rr83.5%
if -4.99999999999999967e145 < (*.f64 x y) < -2.0000000000000001e57 or -2.00000000000000011e-32 < (*.f64 x y) < 4.99999999999999972e-30Initial program 94.1%
Taylor expanded in x around 0 82.4%
associate-*r*82.4%
mul-1-neg82.4%
Simplified82.4%
if -2.0000000000000001e57 < (*.f64 x y) < -2.00000000000000011e-32Initial program 99.7%
Taylor expanded in x around inf 76.3%
if 4.99999999999999972e-30 < (*.f64 x y) Initial program 84.8%
Taylor expanded in x around inf 73.7%
associate-*r/76.3%
Simplified76.3%
Final simplification80.7%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s x y z t a_m)
:precision binary64
(*
a_s
(if (<= (* x y) -5e+145)
(/ x (/ a_m y))
(if (<= (* x y) -2e+57)
(* (- t) (/ z a_m))
(if (<= (* x y) -2e-32)
(/ (* x y) a_m)
(if (<= (* x y) 5e-30) (* z (/ (- t) 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 * y) <= -5e+145) {
tmp = x / (a_m / y);
} else if ((x * y) <= -2e+57) {
tmp = -t * (z / a_m);
} else if ((x * y) <= -2e-32) {
tmp = (x * y) / a_m;
} else if ((x * y) <= 5e-30) {
tmp = z * (-t / 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 * y) <= (-5d+145)) then
tmp = x / (a_m / y)
else if ((x * y) <= (-2d+57)) then
tmp = -t * (z / a_m)
else if ((x * y) <= (-2d-32)) then
tmp = (x * y) / a_m
else if ((x * y) <= 5d-30) then
tmp = z * (-t / 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 * y) <= -5e+145) {
tmp = x / (a_m / y);
} else if ((x * y) <= -2e+57) {
tmp = -t * (z / a_m);
} else if ((x * y) <= -2e-32) {
tmp = (x * y) / a_m;
} else if ((x * y) <= 5e-30) {
tmp = z * (-t / 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 * y) <= -5e+145: tmp = x / (a_m / y) elif (x * y) <= -2e+57: tmp = -t * (z / a_m) elif (x * y) <= -2e-32: tmp = (x * y) / a_m elif (x * y) <= 5e-30: tmp = z * (-t / 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 (Float64(x * y) <= -5e+145) tmp = Float64(x / Float64(a_m / y)); elseif (Float64(x * y) <= -2e+57) tmp = Float64(Float64(-t) * Float64(z / a_m)); elseif (Float64(x * y) <= -2e-32) tmp = Float64(Float64(x * y) / a_m); elseif (Float64(x * y) <= 5e-30) tmp = Float64(z * Float64(Float64(-t) / 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 * y) <= -5e+145) tmp = x / (a_m / y); elseif ((x * y) <= -2e+57) tmp = -t * (z / a_m); elseif ((x * y) <= -2e-32) tmp = (x * y) / a_m; elseif ((x * y) <= 5e-30) tmp = z * (-t / 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[N[(x * y), $MachinePrecision], -5e+145], N[(x / N[(a$95$m / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e+57], N[((-t) * N[(z / a$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e-32], N[(N[(x * y), $MachinePrecision] / a$95$m), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-30], N[(z * N[((-t) / 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 \cdot y \leq -5 \cdot 10^{+145}:\\
\;\;\;\;\frac{x}{\frac{a\_m}{y}}\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+57}:\\
\;\;\;\;\left(-t\right) \cdot \frac{z}{a\_m}\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-32}:\\
\;\;\;\;\frac{x \cdot y}{a\_m}\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-30}:\\
\;\;\;\;z \cdot \frac{-t}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a\_m}\\
\end{array}
\end{array}
if (*.f64 x y) < -4.99999999999999967e145Initial program 88.6%
Taylor expanded in x around inf 72.2%
associate-*r/83.4%
Simplified83.4%
clear-num83.3%
un-div-inv83.5%
Applied egg-rr83.5%
if -4.99999999999999967e145 < (*.f64 x y) < -2.0000000000000001e57Initial program 99.7%
Taylor expanded in x around 0 77.3%
mul-1-neg77.3%
associate-/l*77.0%
distribute-rgt-neg-in77.0%
distribute-neg-frac277.0%
Simplified77.0%
if -2.0000000000000001e57 < (*.f64 x y) < -2.00000000000000011e-32Initial program 99.7%
Taylor expanded in x around inf 76.3%
if -2.00000000000000011e-32 < (*.f64 x y) < 4.99999999999999972e-30Initial program 93.6%
Taylor expanded in x around 0 82.9%
*-commutative82.9%
associate-*r/79.2%
neg-mul-179.2%
distribute-rgt-neg-in79.2%
distribute-frac-neg79.2%
Simplified79.2%
if 4.99999999999999972e-30 < (*.f64 x y) Initial program 84.8%
Taylor expanded in x around inf 73.7%
associate-*r/76.3%
Simplified76.3%
Final simplification78.9%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s x y z t a_m)
:precision binary64
(let* ((t_1 (* (- t) (/ z a_m))))
(*
a_s
(if (<= (* x y) -5e+145)
(/ x (/ a_m y))
(if (<= (* x y) -2e+57)
t_1
(if (<= (* x y) -2e-32)
(/ (* x y) a_m)
(if (<= (* x y) 5e-49) t_1 (* 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 t_1 = -t * (z / a_m);
double tmp;
if ((x * y) <= -5e+145) {
tmp = x / (a_m / y);
} else if ((x * y) <= -2e+57) {
tmp = t_1;
} else if ((x * y) <= -2e-32) {
tmp = (x * y) / a_m;
} else if ((x * y) <= 5e-49) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = -t * (z / a_m)
if ((x * y) <= (-5d+145)) then
tmp = x / (a_m / y)
else if ((x * y) <= (-2d+57)) then
tmp = t_1
else if ((x * y) <= (-2d-32)) then
tmp = (x * y) / a_m
else if ((x * y) <= 5d-49) then
tmp = t_1
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 t_1 = -t * (z / a_m);
double tmp;
if ((x * y) <= -5e+145) {
tmp = x / (a_m / y);
} else if ((x * y) <= -2e+57) {
tmp = t_1;
} else if ((x * y) <= -2e-32) {
tmp = (x * y) / a_m;
} else if ((x * y) <= 5e-49) {
tmp = t_1;
} 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): t_1 = -t * (z / a_m) tmp = 0 if (x * y) <= -5e+145: tmp = x / (a_m / y) elif (x * y) <= -2e+57: tmp = t_1 elif (x * y) <= -2e-32: tmp = (x * y) / a_m elif (x * y) <= 5e-49: tmp = t_1 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) t_1 = Float64(Float64(-t) * Float64(z / a_m)) tmp = 0.0 if (Float64(x * y) <= -5e+145) tmp = Float64(x / Float64(a_m / y)); elseif (Float64(x * y) <= -2e+57) tmp = t_1; elseif (Float64(x * y) <= -2e-32) tmp = Float64(Float64(x * y) / a_m); elseif (Float64(x * y) <= 5e-49) tmp = t_1; 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) t_1 = -t * (z / a_m); tmp = 0.0; if ((x * y) <= -5e+145) tmp = x / (a_m / y); elseif ((x * y) <= -2e+57) tmp = t_1; elseif ((x * y) <= -2e-32) tmp = (x * y) / a_m; elseif ((x * y) <= 5e-49) tmp = t_1; 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_] := Block[{t$95$1 = N[((-t) * N[(z / a$95$m), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[N[(x * y), $MachinePrecision], -5e+145], N[(x / N[(a$95$m / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e+57], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2e-32], N[(N[(x * y), $MachinePrecision] / a$95$m), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-49], t$95$1, 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)
\\
\begin{array}{l}
t_1 := \left(-t\right) \cdot \frac{z}{a\_m}\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+145}:\\
\;\;\;\;\frac{x}{\frac{a\_m}{y}}\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-32}:\\
\;\;\;\;\frac{x \cdot y}{a\_m}\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-49}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a\_m}\\
\end{array}
\end{array}
\end{array}
if (*.f64 x y) < -4.99999999999999967e145Initial program 88.6%
Taylor expanded in x around inf 72.2%
associate-*r/83.4%
Simplified83.4%
clear-num83.3%
un-div-inv83.5%
Applied egg-rr83.5%
if -4.99999999999999967e145 < (*.f64 x y) < -2.0000000000000001e57 or -2.00000000000000011e-32 < (*.f64 x y) < 4.9999999999999999e-49Initial program 93.9%
Taylor expanded in x around 0 84.4%
mul-1-neg84.4%
associate-/l*84.2%
distribute-rgt-neg-in84.2%
distribute-neg-frac284.2%
Simplified84.2%
if -2.0000000000000001e57 < (*.f64 x y) < -2.00000000000000011e-32Initial program 99.7%
Taylor expanded in x around inf 76.3%
if 4.9999999999999999e-49 < (*.f64 x y) Initial program 86.0%
Taylor expanded in x around inf 71.9%
associate-*r/74.3%
Simplified74.3%
Final simplification80.9%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s x y z t a_m)
:precision binary64
(*
a_s
(if (<= (* z t) 2e+274)
(/ (- (* x y) (* z t)) a_m)
(* t (/ (- (/ (* x y) 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 ((z * t) <= 2e+274) {
tmp = ((x * y) - (z * t)) / a_m;
} else {
tmp = t * ((((x * y) / 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 ((z * t) <= 2d+274) then
tmp = ((x * y) - (z * t)) / a_m
else
tmp = t * ((((x * y) / 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 ((z * t) <= 2e+274) {
tmp = ((x * y) - (z * t)) / a_m;
} else {
tmp = t * ((((x * y) / 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 (z * t) <= 2e+274: tmp = ((x * y) - (z * t)) / a_m else: tmp = t * ((((x * y) / 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 (Float64(z * t) <= 2e+274) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a_m); else tmp = Float64(t * Float64(Float64(Float64(Float64(x * y) / t) - z) / 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 * t) <= 2e+274) tmp = ((x * y) - (z * t)) / a_m; else tmp = t * ((((x * y) / 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[N[(z * t), $MachinePrecision], 2e+274], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a$95$m), $MachinePrecision], N[(t * N[(N[(N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision] - z), $MachinePrecision] / 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}\;z \cdot t \leq 2 \cdot 10^{+274}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{\frac{x \cdot y}{t} - z}{a\_m}\\
\end{array}
\end{array}
if (*.f64 z t) < 1.99999999999999984e274Initial program 93.8%
if 1.99999999999999984e274 < (*.f64 z t) Initial program 55.2%
Taylor expanded in t around inf 89.2%
+-commutative89.2%
mul-1-neg89.2%
unsub-neg89.2%
times-frac94.4%
Simplified94.4%
Taylor expanded in a around 0 94.5%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s x y z t a_m)
:precision binary64
(*
a_s
(if (<= a_m 7.5e+106)
(/ (- (* 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 tmp;
if (a_m <= 7.5e+106) {
tmp = ((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.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 (a_m <= 7.5d+106) then
tmp = ((x * y) - (z * t)) / a_m
else
tmp = (x * (y / a_m)) - (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 (a_m <= 7.5e+106) {
tmp = ((x * y) - (z * t)) / a_m;
} else {
tmp = (x * (y / a_m)) - (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 a_m <= 7.5e+106: tmp = ((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) tmp = 0.0 if (a_m <= 7.5e+106) tmp = Float64(Float64(Float64(x * y) - Float64(z * 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 = 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 (a_m <= 7.5e+106) tmp = ((x * y) - (z * t)) / a_m; else tmp = (x * (y / a_m)) - (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[a$95$m, 7.5e+106], N[(N[(N[(x * y), $MachinePrecision] - 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)
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \leq 7.5 \cdot 10^{+106}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a\_m} - \frac{t}{\frac{a\_m}{z}}\\
\end{array}
\end{array}
if a < 7.50000000000000058e106Initial program 94.4%
if 7.50000000000000058e106 < a Initial program 74.4%
div-sub74.4%
associate-/l*89.7%
associate-/l*92.8%
Applied egg-rr92.8%
div-inv92.7%
add-sqr-sqrt47.9%
sqrt-unprod59.9%
sqr-neg59.9%
sqrt-unprod27.0%
add-sqr-sqrt55.1%
associate-*l*55.0%
*-commutative55.0%
div-inv55.0%
associate-/l*55.0%
clear-num55.0%
un-div-inv55.0%
add-sqr-sqrt27.1%
sqrt-unprod60.9%
sqr-neg60.9%
sqrt-unprod51.1%
add-sqr-sqrt93.8%
Applied egg-rr93.8%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s x y z t a_m)
:precision binary64
(*
a_s
(if (<= a_m 1.4e-5)
(/ (- (* x y) (* z t)) a_m)
(- (* x (/ y a_m)) (* 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 (a_m <= 1.4e-5) {
tmp = ((x * y) - (z * t)) / a_m;
} else {
tmp = (x * (y / a_m)) - (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 (a_m <= 1.4d-5) then
tmp = ((x * y) - (z * t)) / a_m
else
tmp = (x * (y / a_m)) - (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 (a_m <= 1.4e-5) {
tmp = ((x * y) - (z * t)) / a_m;
} else {
tmp = (x * (y / a_m)) - (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 a_m <= 1.4e-5: tmp = ((x * y) - (z * t)) / a_m else: tmp = (x * (y / a_m)) - (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 (a_m <= 1.4e-5) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a_m); else tmp = Float64(Float64(x * Float64(y / a_m)) - Float64(z * Float64(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 (a_m <= 1.4e-5) tmp = ((x * y) - (z * t)) / a_m; else tmp = (x * (y / a_m)) - (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[a$95$m, 1.4e-5], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a$95$m), $MachinePrecision], N[(N[(x * N[(y / a$95$m), $MachinePrecision]), $MachinePrecision] - N[(z * N[(t / a$95$m), $MachinePrecision]), $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}\;a\_m \leq 1.4 \cdot 10^{-5}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a\_m} - z \cdot \frac{t}{a\_m}\\
\end{array}
\end{array}
if a < 1.39999999999999998e-5Initial program 93.8%
if 1.39999999999999998e-5 < a Initial program 82.8%
div-sub82.8%
associate-/l*93.0%
associate-/l*93.7%
Applied egg-rr93.7%
a\_m = (fabs.f64 a) a\_s = (copysign.f64 #s(literal 1 binary64) a) (FPCore (a_s x y z t a_m) :precision binary64 (* a_s (if (<= (* z t) 2e+274) (/ (- (* x y) (* z t)) 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 ((z * t) <= 2e+274) {
tmp = ((x * y) - (z * t)) / 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 ((z * t) <= 2d+274) then
tmp = ((x * y) - (z * t)) / 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 ((z * t) <= 2e+274) {
tmp = ((x * y) - (z * t)) / 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 (z * t) <= 2e+274: tmp = ((x * y) - (z * t)) / 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 (Float64(z * t) <= 2e+274) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a_m); else tmp = Float64(Float64(-t) * Float64(z / 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 * t) <= 2e+274) tmp = ((x * y) - (z * t)) / 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[N[(z * t), $MachinePrecision], 2e+274], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a$95$m), $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}\;z \cdot t \leq 2 \cdot 10^{+274}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot \frac{z}{a\_m}\\
\end{array}
\end{array}
if (*.f64 z t) < 1.99999999999999984e274Initial program 93.8%
if 1.99999999999999984e274 < (*.f64 z t) Initial program 55.2%
Taylor expanded in x around 0 55.5%
mul-1-neg55.5%
associate-/l*94.4%
distribute-rgt-neg-in94.4%
distribute-neg-frac294.4%
Simplified94.4%
Final simplification93.9%
a\_m = (fabs.f64 a) a\_s = (copysign.f64 #s(literal 1 binary64) a) (FPCore (a_s x y z t a_m) :precision binary64 (* a_s (if (<= a_m 1.35e+94) (/ (* x y) a_m) (/ x (/ a_m y)))))
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 (a_m <= 1.35e+94) {
tmp = (x * y) / a_m;
} else {
tmp = x / (a_m / y);
}
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 (a_m <= 1.35d+94) then
tmp = (x * y) / a_m
else
tmp = x / (a_m / y)
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 (a_m <= 1.35e+94) {
tmp = (x * y) / a_m;
} else {
tmp = x / (a_m / y);
}
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 a_m <= 1.35e+94: tmp = (x * y) / a_m else: tmp = x / (a_m / y) 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 (a_m <= 1.35e+94) tmp = Float64(Float64(x * y) / a_m); else tmp = Float64(x / Float64(a_m / y)); 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 (a_m <= 1.35e+94) tmp = (x * y) / a_m; else tmp = x / (a_m / y); 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[a$95$m, 1.35e+94], N[(N[(x * y), $MachinePrecision] / a$95$m), $MachinePrecision], N[(x / N[(a$95$m / y), $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}\;a\_m \leq 1.35 \cdot 10^{+94}:\\
\;\;\;\;\frac{x \cdot y}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a\_m}{y}}\\
\end{array}
\end{array}
if a < 1.3500000000000001e94Initial program 94.3%
Taylor expanded in x around inf 48.3%
if 1.3500000000000001e94 < a Initial program 76.5%
Taylor expanded in x around inf 41.6%
associate-*r/55.6%
Simplified55.6%
clear-num54.0%
un-div-inv54.2%
Applied egg-rr54.2%
a\_m = (fabs.f64 a) a\_s = (copysign.f64 #s(literal 1 binary64) a) (FPCore (a_s x y z t a_m) :precision binary64 (* a_s (if (<= z -4.4e-184) (* x (/ y 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 (z <= -4.4e-184) {
tmp = x * (y / 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 (z <= (-4.4d-184)) then
tmp = x * (y / 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 (z <= -4.4e-184) {
tmp = x * (y / 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 z <= -4.4e-184: tmp = x * (y / 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 (z <= -4.4e-184) tmp = Float64(x * Float64(y / 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 (z <= -4.4e-184) tmp = x * (y / 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[LessEqual[z, -4.4e-184], N[(x * N[(y / 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}\;z \leq -4.4 \cdot 10^{-184}:\\
\;\;\;\;x \cdot \frac{y}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a\_m}\\
\end{array}
\end{array}
if z < -4.39999999999999984e-184Initial program 91.7%
Taylor expanded in x around inf 40.8%
associate-*r/41.6%
Simplified41.6%
if -4.39999999999999984e-184 < z Initial program 90.4%
Taylor expanded in y around inf 77.4%
fma-define77.4%
times-frac72.9%
Simplified72.9%
Taylor expanded in t around 0 54.2%
a\_m = (fabs.f64 a) a\_s = (copysign.f64 #s(literal 1 binary64) 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 91.0%
Taylor expanded in x around inf 47.1%
associate-*r/48.6%
Simplified48.6%
(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 2024085
(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))