
(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 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
:precision binary64
(let* ((t_1 (- (* x y) (* z t))))
(*
a_s
(if (<= t_1 (- INFINITY))
(* x (pow (sqrt (/ (- y (* t (/ z x))) a_m)) 2.0))
(if (<= t_1 5e+267)
(/ (fma x y (* z (- t))) a_m)
(fma y (/ x a_m) (* z (/ t (- a_m)))))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
assert(x < y && y < z && z < t && t < a_m);
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 = x * pow(sqrt(((y - (t * (z / x))) / a_m)), 2.0);
} else if (t_1 <= 5e+267) {
tmp = fma(x, y, (z * -t)) / a_m;
} else {
tmp = fma(y, (x / a_m), (z * (t / -a_m)));
}
return a_s * tmp;
}
a\_m = abs(a) a\_s = copysign(1.0, a) x, y, z, t, a_m = sort([x, y, z, t, a_m]) x, y, z, t, a_m = sort([x, y, z, t, a_m]) 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(x * (sqrt(Float64(Float64(y - Float64(t * Float64(z / x))) / a_m)) ^ 2.0)); elseif (t_1 <= 5e+267) tmp = Float64(fma(x, y, Float64(z * Float64(-t))) / a_m); else tmp = fma(y, Float64(x / a_m), Float64(z * Float64(t / Float64(-a_m)))); 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]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
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[(x * N[Power[N[Sqrt[N[(N[(y - N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a$95$m), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+267], N[(N[(x * y + N[(z * (-t)), $MachinePrecision]), $MachinePrecision] / a$95$m), $MachinePrecision], N[(y * N[(x / a$95$m), $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)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x \cdot {\left(\sqrt{\frac{y - t \cdot \frac{z}{x}}{a\_m}}\right)}^{2}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+267}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{a\_m}, z \cdot \frac{t}{-a\_m}\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 72.3%
Taylor expanded in x around inf 85.9%
+-commutative85.9%
mul-1-neg85.9%
unsub-neg85.9%
associate-/l*89.7%
*-commutative89.7%
associate-/r*93.3%
Simplified93.3%
add-sqr-sqrt37.5%
pow237.5%
associate-*r/37.5%
sub-div37.5%
Applied egg-rr37.5%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 4.9999999999999999e267Initial program 98.8%
div-sub97.2%
*-commutative97.2%
div-sub98.8%
*-commutative98.8%
fmm-def98.8%
distribute-rgt-neg-out98.8%
Simplified98.8%
if 4.9999999999999999e267 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 63.0%
div-sub60.5%
*-commutative60.5%
associate-/l*72.5%
fmm-def75.0%
associate-/l*87.2%
Applied egg-rr87.2%
Final simplification90.5%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
:precision binary64
(let* ((t_1 (- (* x y) (* z t))))
(*
a_s
(if (<= t_1 (- INFINITY))
(* x (- (/ y a_m) (* t (/ (/ z x) a_m))))
(if (<= t_1 5e+267)
(/ (fma x y (* z (- t))) a_m)
(fma y (/ x a_m) (* z (/ t (- a_m)))))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
assert(x < y && y < z && z < t && t < a_m);
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 = x * ((y / a_m) - (t * ((z / x) / a_m)));
} else if (t_1 <= 5e+267) {
tmp = fma(x, y, (z * -t)) / a_m;
} else {
tmp = fma(y, (x / a_m), (z * (t / -a_m)));
}
return a_s * tmp;
}
a\_m = abs(a) a\_s = copysign(1.0, a) x, y, z, t, a_m = sort([x, y, z, t, a_m]) x, y, z, t, a_m = sort([x, y, z, t, a_m]) 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(x * Float64(Float64(y / a_m) - Float64(t * Float64(Float64(z / x) / a_m)))); elseif (t_1 <= 5e+267) tmp = Float64(fma(x, y, Float64(z * Float64(-t))) / a_m); else tmp = fma(y, Float64(x / a_m), Float64(z * Float64(t / Float64(-a_m)))); 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]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
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[(x * N[(N[(y / a$95$m), $MachinePrecision] - N[(t * N[(N[(z / x), $MachinePrecision] / a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+267], N[(N[(x * y + N[(z * (-t)), $MachinePrecision]), $MachinePrecision] / a$95$m), $MachinePrecision], N[(y * N[(x / a$95$m), $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)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x \cdot \left(\frac{y}{a\_m} - t \cdot \frac{\frac{z}{x}}{a\_m}\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+267}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{a\_m}, z \cdot \frac{t}{-a\_m}\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 72.3%
Taylor expanded in x around inf 85.9%
+-commutative85.9%
mul-1-neg85.9%
unsub-neg85.9%
associate-/l*89.7%
*-commutative89.7%
associate-/r*93.3%
Simplified93.3%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 4.9999999999999999e267Initial program 98.8%
div-sub97.2%
*-commutative97.2%
div-sub98.8%
*-commutative98.8%
fmm-def98.8%
distribute-rgt-neg-out98.8%
Simplified98.8%
if 4.9999999999999999e267 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 63.0%
div-sub60.5%
*-commutative60.5%
associate-/l*72.5%
fmm-def75.0%
associate-/l*87.2%
Applied egg-rr87.2%
Final simplification96.4%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
:precision binary64
(*
a_s
(if (<= a_m 7e-30)
(/ (fma x y (* z (- t))) a_m)
(- (/ y (/ a_m x)) (* t (/ z a_m))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if (a_m <= 7e-30) {
tmp = fma(x, y, (z * -t)) / a_m;
} else {
tmp = (y / (a_m / x)) - (t * (z / a_m));
}
return a_s * tmp;
}
a\_m = abs(a) a\_s = copysign(1.0, a) x, y, z, t, a_m = sort([x, y, z, t, a_m]) x, y, z, t, a_m = sort([x, y, z, t, a_m]) function code(a_s, x, y, z, t, a_m) tmp = 0.0 if (a_m <= 7e-30) tmp = Float64(fma(x, y, Float64(z * Float64(-t))) / a_m); else tmp = Float64(Float64(y / Float64(a_m / x)) - Float64(t * Float64(z / a_m))); 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]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[a$95$m, 7e-30], N[(N[(x * y + N[(z * (-t)), $MachinePrecision]), $MachinePrecision] / a$95$m), $MachinePrecision], N[(N[(y / N[(a$95$m / x), $MachinePrecision]), $MachinePrecision] - N[(t * N[(z / a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \leq 7 \cdot 10^{-30}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a\_m}{x}} - t \cdot \frac{z}{a\_m}\\
\end{array}
\end{array}
if a < 7.0000000000000006e-30Initial program 91.4%
div-sub88.7%
*-commutative88.7%
div-sub91.4%
*-commutative91.4%
fmm-def92.5%
distribute-rgt-neg-out92.5%
Simplified92.5%
if 7.0000000000000006e-30 < a Initial program 88.3%
div-sub88.3%
*-un-lft-identity88.3%
add-sqr-sqrt88.1%
times-frac88.1%
fmm-def88.1%
associate-/l*89.3%
Applied egg-rr89.3%
fmm-undef89.3%
associate-*l/89.3%
*-lft-identity89.3%
associate-/l*93.0%
associate-*l/92.9%
associate-*r/91.7%
*-commutative91.7%
associate-/l*92.8%
Simplified92.8%
clear-num92.8%
frac-times91.9%
*-un-lft-identity91.9%
Applied egg-rr91.9%
associate-*l/91.9%
rem-square-sqrt92.0%
Simplified92.0%
Final simplification92.4%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
:precision binary64
(let* ((t_1 (* x (/ y a_m))))
(*
a_s
(if (<= (* x y) -4e-14)
t_1
(if (<= (* x y) 4e-155)
(* t (/ z (- a_m)))
(if (<= (* x y) 2e-71)
t_1
(if (<= (* x y) 2e-36)
(* z (/ t (- a_m)))
(if (<= (* x y) 4e+111) (/ (* x y) a_m) t_1))))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double t_1 = x * (y / a_m);
double tmp;
if ((x * y) <= -4e-14) {
tmp = t_1;
} else if ((x * y) <= 4e-155) {
tmp = t * (z / -a_m);
} else if ((x * y) <= 2e-71) {
tmp = t_1;
} else if ((x * y) <= 2e-36) {
tmp = z * (t / -a_m);
} else if ((x * y) <= 4e+111) {
tmp = (x * y) / a_m;
} else {
tmp = t_1;
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
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 = x * (y / a_m)
if ((x * y) <= (-4d-14)) then
tmp = t_1
else if ((x * y) <= 4d-155) then
tmp = t * (z / -a_m)
else if ((x * y) <= 2d-71) then
tmp = t_1
else if ((x * y) <= 2d-36) then
tmp = z * (t / -a_m)
else if ((x * y) <= 4d+111) then
tmp = (x * y) / a_m
else
tmp = t_1
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
assert x < y && y < z && z < t && t < a_m;
assert x < y && y < z && z < t && t < a_m;
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 tmp;
if ((x * y) <= -4e-14) {
tmp = t_1;
} else if ((x * y) <= 4e-155) {
tmp = t * (z / -a_m);
} else if ((x * y) <= 2e-71) {
tmp = t_1;
} else if ((x * y) <= 2e-36) {
tmp = z * (t / -a_m);
} else if ((x * y) <= 4e+111) {
tmp = (x * y) / a_m;
} else {
tmp = t_1;
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) def code(a_s, x, y, z, t, a_m): t_1 = x * (y / a_m) tmp = 0 if (x * y) <= -4e-14: tmp = t_1 elif (x * y) <= 4e-155: tmp = t * (z / -a_m) elif (x * y) <= 2e-71: tmp = t_1 elif (x * y) <= 2e-36: tmp = z * (t / -a_m) elif (x * y) <= 4e+111: tmp = (x * y) / a_m else: tmp = t_1 return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) x, y, z, t, a_m = sort([x, y, z, t, a_m]) x, y, z, t, a_m = sort([x, y, z, t, a_m]) function code(a_s, x, y, z, t, a_m) t_1 = Float64(x * Float64(y / a_m)) tmp = 0.0 if (Float64(x * y) <= -4e-14) tmp = t_1; elseif (Float64(x * y) <= 4e-155) tmp = Float64(t * Float64(z / Float64(-a_m))); elseif (Float64(x * y) <= 2e-71) tmp = t_1; elseif (Float64(x * y) <= 2e-36) tmp = Float64(z * Float64(t / Float64(-a_m))); elseif (Float64(x * y) <= 4e+111) tmp = Float64(Float64(x * y) / a_m); else tmp = t_1; end return Float64(a_s * tmp) end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
function tmp_2 = code(a_s, x, y, z, t, a_m)
t_1 = x * (y / a_m);
tmp = 0.0;
if ((x * y) <= -4e-14)
tmp = t_1;
elseif ((x * y) <= 4e-155)
tmp = t * (z / -a_m);
elseif ((x * y) <= 2e-71)
tmp = t_1;
elseif ((x * y) <= 2e-36)
tmp = z * (t / -a_m);
elseif ((x * y) <= 4e+111)
tmp = (x * y) / a_m;
else
tmp = t_1;
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]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[(x * N[(y / a$95$m), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[N[(x * y), $MachinePrecision], -4e-14], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4e-155], N[(t * N[(z / (-a$95$m)), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e-71], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-36], N[(z * N[(t / (-a$95$m)), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e+111], N[(N[(x * y), $MachinePrecision] / a$95$m), $MachinePrecision], t$95$1]]]]]), $MachinePrecision]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{a\_m}\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-155}:\\
\;\;\;\;t \cdot \frac{z}{-a\_m}\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-36}:\\
\;\;\;\;z \cdot \frac{t}{-a\_m}\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+111}:\\
\;\;\;\;\frac{x \cdot y}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if (*.f64 x y) < -4e-14 or 4.00000000000000006e-155 < (*.f64 x y) < 1.9999999999999998e-71 or 3.99999999999999983e111 < (*.f64 x y) Initial program 85.1%
Taylor expanded in x around inf 76.9%
associate-*r/81.0%
Simplified81.0%
if -4e-14 < (*.f64 x y) < 4.00000000000000006e-155Initial program 95.3%
Taylor expanded in x around 0 81.9%
mul-1-neg81.9%
associate-/l*74.4%
distribute-rgt-neg-in74.4%
distribute-neg-frac274.4%
Simplified74.4%
if 1.9999999999999998e-71 < (*.f64 x y) < 1.9999999999999999e-36Initial program 89.3%
Taylor expanded in x around 0 67.2%
mul-1-neg67.2%
*-commutative67.2%
associate-*r/65.9%
distribute-rgt-neg-in65.9%
distribute-frac-neg65.9%
Simplified65.9%
if 1.9999999999999999e-36 < (*.f64 x y) < 3.99999999999999983e111Initial program 96.2%
Taylor expanded in x around inf 66.0%
Final simplification76.2%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
:precision binary64
(let* ((t_1 (* x (/ y a_m))))
(*
a_s
(if (<= (* x y) -4e-14)
t_1
(if (<= (* x y) 4e-155)
(/ (* z t) (- a_m))
(if (<= (* x y) 2e-71)
t_1
(if (<= (* x y) 2e-36)
(* z (/ t (- a_m)))
(if (<= (* x y) 4e+111) (/ (* x y) a_m) t_1))))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double t_1 = x * (y / a_m);
double tmp;
if ((x * y) <= -4e-14) {
tmp = t_1;
} else if ((x * y) <= 4e-155) {
tmp = (z * t) / -a_m;
} else if ((x * y) <= 2e-71) {
tmp = t_1;
} else if ((x * y) <= 2e-36) {
tmp = z * (t / -a_m);
} else if ((x * y) <= 4e+111) {
tmp = (x * y) / a_m;
} else {
tmp = t_1;
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
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 = x * (y / a_m)
if ((x * y) <= (-4d-14)) then
tmp = t_1
else if ((x * y) <= 4d-155) then
tmp = (z * t) / -a_m
else if ((x * y) <= 2d-71) then
tmp = t_1
else if ((x * y) <= 2d-36) then
tmp = z * (t / -a_m)
else if ((x * y) <= 4d+111) then
tmp = (x * y) / a_m
else
tmp = t_1
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
assert x < y && y < z && z < t && t < a_m;
assert x < y && y < z && z < t && t < a_m;
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 tmp;
if ((x * y) <= -4e-14) {
tmp = t_1;
} else if ((x * y) <= 4e-155) {
tmp = (z * t) / -a_m;
} else if ((x * y) <= 2e-71) {
tmp = t_1;
} else if ((x * y) <= 2e-36) {
tmp = z * (t / -a_m);
} else if ((x * y) <= 4e+111) {
tmp = (x * y) / a_m;
} else {
tmp = t_1;
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) def code(a_s, x, y, z, t, a_m): t_1 = x * (y / a_m) tmp = 0 if (x * y) <= -4e-14: tmp = t_1 elif (x * y) <= 4e-155: tmp = (z * t) / -a_m elif (x * y) <= 2e-71: tmp = t_1 elif (x * y) <= 2e-36: tmp = z * (t / -a_m) elif (x * y) <= 4e+111: tmp = (x * y) / a_m else: tmp = t_1 return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) x, y, z, t, a_m = sort([x, y, z, t, a_m]) x, y, z, t, a_m = sort([x, y, z, t, a_m]) function code(a_s, x, y, z, t, a_m) t_1 = Float64(x * Float64(y / a_m)) tmp = 0.0 if (Float64(x * y) <= -4e-14) tmp = t_1; elseif (Float64(x * y) <= 4e-155) tmp = Float64(Float64(z * t) / Float64(-a_m)); elseif (Float64(x * y) <= 2e-71) tmp = t_1; elseif (Float64(x * y) <= 2e-36) tmp = Float64(z * Float64(t / Float64(-a_m))); elseif (Float64(x * y) <= 4e+111) tmp = Float64(Float64(x * y) / a_m); else tmp = t_1; end return Float64(a_s * tmp) end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
function tmp_2 = code(a_s, x, y, z, t, a_m)
t_1 = x * (y / a_m);
tmp = 0.0;
if ((x * y) <= -4e-14)
tmp = t_1;
elseif ((x * y) <= 4e-155)
tmp = (z * t) / -a_m;
elseif ((x * y) <= 2e-71)
tmp = t_1;
elseif ((x * y) <= 2e-36)
tmp = z * (t / -a_m);
elseif ((x * y) <= 4e+111)
tmp = (x * y) / a_m;
else
tmp = t_1;
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]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[(x * N[(y / a$95$m), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[N[(x * y), $MachinePrecision], -4e-14], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4e-155], N[(N[(z * t), $MachinePrecision] / (-a$95$m)), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e-71], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-36], N[(z * N[(t / (-a$95$m)), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e+111], N[(N[(x * y), $MachinePrecision] / a$95$m), $MachinePrecision], t$95$1]]]]]), $MachinePrecision]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{a\_m}\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-155}:\\
\;\;\;\;\frac{z \cdot t}{-a\_m}\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-36}:\\
\;\;\;\;z \cdot \frac{t}{-a\_m}\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+111}:\\
\;\;\;\;\frac{x \cdot y}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if (*.f64 x y) < -4e-14 or 4.00000000000000006e-155 < (*.f64 x y) < 1.9999999999999998e-71 or 3.99999999999999983e111 < (*.f64 x y) Initial program 85.1%
Taylor expanded in x around inf 76.9%
associate-*r/81.0%
Simplified81.0%
if -4e-14 < (*.f64 x y) < 4.00000000000000006e-155Initial program 95.3%
Taylor expanded in x around 0 81.9%
associate-*r*81.9%
mul-1-neg81.9%
Simplified81.9%
if 1.9999999999999998e-71 < (*.f64 x y) < 1.9999999999999999e-36Initial program 89.3%
Taylor expanded in x around 0 67.2%
mul-1-neg67.2%
*-commutative67.2%
associate-*r/65.9%
distribute-rgt-neg-in65.9%
distribute-frac-neg65.9%
Simplified65.9%
if 1.9999999999999999e-36 < (*.f64 x y) < 3.99999999999999983e111Initial program 96.2%
Taylor expanded in x around inf 66.0%
Final simplification79.2%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
:precision binary64
(let* ((t_1 (- (* x y) (* z t))))
(*
a_s
(if (or (<= t_1 -5e+234) (not (<= t_1 5e+267)))
(- (* x (/ y a_m)) (* z (/ t a_m)))
(/ t_1 a_m)))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
assert(x < y && y < z && z < t && t < a_m);
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 <= -5e+234) || !(t_1 <= 5e+267)) {
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.0d0, a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
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 = (x * y) - (z * t)
if ((t_1 <= (-5d+234)) .or. (.not. (t_1 <= 5d+267))) then
tmp = (x * (y / a_m)) - (z * (t / a_m))
else
tmp = t_1 / a_m
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
assert x < y && y < z && z < t && t < a_m;
assert x < y && y < z && z < t && t < a_m;
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 <= -5e+234) || !(t_1 <= 5e+267)) {
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) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) def code(a_s, x, y, z, t, a_m): t_1 = (x * y) - (z * t) tmp = 0 if (t_1 <= -5e+234) or not (t_1 <= 5e+267): 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) x, y, z, t, a_m = sort([x, y, z, t, a_m]) x, y, z, t, a_m = sort([x, y, z, t, a_m]) 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 <= -5e+234) || !(t_1 <= 5e+267)) 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);
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
function tmp_2 = code(a_s, x, y, z, t, a_m)
t_1 = (x * y) - (z * t);
tmp = 0.0;
if ((t_1 <= -5e+234) || ~((t_1 <= 5e+267)))
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]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
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, -5e+234], N[Not[LessEqual[t$95$1, 5e+267]], $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)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+234} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+267}\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)) < -5.0000000000000003e234 or 4.9999999999999999e267 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 72.2%
div-sub69.7%
associate-/l*82.9%
associate-/l*92.2%
Applied egg-rr92.2%
if -5.0000000000000003e234 < (-.f64 (*.f64 x y) (*.f64 z t)) < 4.9999999999999999e267Initial program 98.7%
Final simplification96.7%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
:precision binary64
(let* ((t_1 (- (* x y) (* z t))))
(*
a_s
(if (<= t_1 -5e+234)
(- (/ x (/ a_m y)) (* t (/ z a_m)))
(if (<= t_1 5e+267) (/ t_1 a_m) (- (* x (/ y a_m)) (* z (/ t a_m))))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
assert(x < y && y < z && z < t && t < a_m);
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 <= -5e+234) {
tmp = (x / (a_m / y)) - (t * (z / a_m));
} else if (t_1 <= 5e+267) {
tmp = t_1 / 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)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
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 = (x * y) - (z * t)
if (t_1 <= (-5d+234)) then
tmp = (x / (a_m / y)) - (t * (z / a_m))
else if (t_1 <= 5d+267) then
tmp = t_1 / 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);
assert x < y && y < z && z < t && t < a_m;
assert x < y && y < z && z < t && t < a_m;
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 <= -5e+234) {
tmp = (x / (a_m / y)) - (t * (z / a_m));
} else if (t_1 <= 5e+267) {
tmp = t_1 / 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) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) def code(a_s, x, y, z, t, a_m): t_1 = (x * y) - (z * t) tmp = 0 if t_1 <= -5e+234: tmp = (x / (a_m / y)) - (t * (z / a_m)) elif t_1 <= 5e+267: tmp = t_1 / 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) x, y, z, t, a_m = sort([x, y, z, t, a_m]) x, y, z, t, a_m = sort([x, y, z, t, a_m]) 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 <= -5e+234) tmp = Float64(Float64(x / Float64(a_m / y)) - Float64(t * Float64(z / a_m))); elseif (t_1 <= 5e+267) tmp = Float64(t_1 / 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);
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
function tmp_2 = code(a_s, x, y, z, t, a_m)
t_1 = (x * y) - (z * t);
tmp = 0.0;
if (t_1 <= -5e+234)
tmp = (x / (a_m / y)) - (t * (z / a_m));
elseif (t_1 <= 5e+267)
tmp = t_1 / 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]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
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, -5e+234], N[(N[(x / N[(a$95$m / y), $MachinePrecision]), $MachinePrecision] - N[(t * N[(z / a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+267], N[(t$95$1 / 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)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+234}:\\
\;\;\;\;\frac{x}{\frac{a\_m}{y}} - t \cdot \frac{z}{a\_m}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+267}:\\
\;\;\;\;\frac{t\_1}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a\_m} - z \cdot \frac{t}{a\_m}\\
\end{array}
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -5.0000000000000003e234Initial program 81.2%
div-sub78.7%
*-un-lft-identity78.7%
add-sqr-sqrt33.4%
times-frac33.5%
fmm-def33.5%
associate-/l*37.8%
Applied egg-rr37.8%
fmm-undef37.8%
associate-*l/37.8%
*-lft-identity37.8%
associate-/l*42.5%
associate-*l/44.8%
associate-*r/40.4%
*-commutative40.4%
associate-/l*44.8%
Simplified44.8%
*-commutative44.8%
clear-num44.8%
frac-times44.9%
*-un-lft-identity44.9%
Applied egg-rr44.9%
associate-*l/44.9%
rem-square-sqrt97.3%
Simplified97.3%
if -5.0000000000000003e234 < (-.f64 (*.f64 x y) (*.f64 z t)) < 4.9999999999999999e267Initial program 98.7%
if 4.9999999999999999e267 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 63.0%
div-sub60.5%
associate-/l*75.0%
associate-/l*87.1%
Applied egg-rr87.1%
Final simplification96.7%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
:precision binary64
(let* ((t_1 (- (* x y) (* z t))))
(*
a_s
(if (<= t_1 (- INFINITY))
(* x (- (/ y a_m) (* t (/ (/ z x) a_m))))
(if (<= t_1 5e+267) (/ t_1 a_m) (- (* x (/ y a_m)) (* z (/ t a_m))))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
assert(x < y && y < z && z < t && t < a_m);
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 = x * ((y / a_m) - (t * ((z / x) / a_m)));
} else if (t_1 <= 5e+267) {
tmp = t_1 / a_m;
} else {
tmp = (x * (y / a_m)) - (z * (t / a_m));
}
return a_s * tmp;
}
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
assert x < y && y < z && z < t && t < a_m;
assert x < y && y < z && z < t && t < a_m;
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) {
tmp = x * ((y / a_m) - (t * ((z / x) / a_m)));
} else if (t_1 <= 5e+267) {
tmp = t_1 / 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) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) def code(a_s, x, y, z, t, a_m): t_1 = (x * y) - (z * t) tmp = 0 if t_1 <= -math.inf: tmp = x * ((y / a_m) - (t * ((z / x) / a_m))) elif t_1 <= 5e+267: tmp = t_1 / 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) x, y, z, t, a_m = sort([x, y, z, t, a_m]) x, y, z, t, a_m = sort([x, y, z, t, a_m]) 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(x * Float64(Float64(y / a_m) - Float64(t * Float64(Float64(z / x) / a_m)))); elseif (t_1 <= 5e+267) tmp = Float64(t_1 / 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);
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
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)
tmp = x * ((y / a_m) - (t * ((z / x) / a_m)));
elseif (t_1 <= 5e+267)
tmp = t_1 / 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]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
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[(x * N[(N[(y / a$95$m), $MachinePrecision] - N[(t * N[(N[(z / x), $MachinePrecision] / a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+267], N[(t$95$1 / 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)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x \cdot \left(\frac{y}{a\_m} - t \cdot \frac{\frac{z}{x}}{a\_m}\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+267}:\\
\;\;\;\;\frac{t\_1}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a\_m} - z \cdot \frac{t}{a\_m}\\
\end{array}
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 72.3%
Taylor expanded in x around inf 85.9%
+-commutative85.9%
mul-1-neg85.9%
unsub-neg85.9%
associate-/l*89.7%
*-commutative89.7%
associate-/r*93.3%
Simplified93.3%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 4.9999999999999999e267Initial program 98.8%
if 4.9999999999999999e267 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 63.0%
div-sub60.5%
associate-/l*75.0%
associate-/l*87.1%
Applied egg-rr87.1%
Final simplification96.4%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
:precision binary64
(let* ((t_1 (* x (/ y a_m))))
(*
a_s
(if (<= (* x y) -4e-14)
t_1
(if (<= (* x y) 4e-155)
(* t (/ z (- a_m)))
(if (<= (* x y) 4e+111) (/ (* x y) a_m) t_1))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double t_1 = x * (y / a_m);
double tmp;
if ((x * y) <= -4e-14) {
tmp = t_1;
} else if ((x * y) <= 4e-155) {
tmp = t * (z / -a_m);
} else if ((x * y) <= 4e+111) {
tmp = (x * y) / a_m;
} else {
tmp = t_1;
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
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 = x * (y / a_m)
if ((x * y) <= (-4d-14)) then
tmp = t_1
else if ((x * y) <= 4d-155) then
tmp = t * (z / -a_m)
else if ((x * y) <= 4d+111) then
tmp = (x * y) / a_m
else
tmp = t_1
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
assert x < y && y < z && z < t && t < a_m;
assert x < y && y < z && z < t && t < a_m;
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 tmp;
if ((x * y) <= -4e-14) {
tmp = t_1;
} else if ((x * y) <= 4e-155) {
tmp = t * (z / -a_m);
} else if ((x * y) <= 4e+111) {
tmp = (x * y) / a_m;
} else {
tmp = t_1;
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) def code(a_s, x, y, z, t, a_m): t_1 = x * (y / a_m) tmp = 0 if (x * y) <= -4e-14: tmp = t_1 elif (x * y) <= 4e-155: tmp = t * (z / -a_m) elif (x * y) <= 4e+111: tmp = (x * y) / a_m else: tmp = t_1 return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) x, y, z, t, a_m = sort([x, y, z, t, a_m]) x, y, z, t, a_m = sort([x, y, z, t, a_m]) function code(a_s, x, y, z, t, a_m) t_1 = Float64(x * Float64(y / a_m)) tmp = 0.0 if (Float64(x * y) <= -4e-14) tmp = t_1; elseif (Float64(x * y) <= 4e-155) tmp = Float64(t * Float64(z / Float64(-a_m))); elseif (Float64(x * y) <= 4e+111) tmp = Float64(Float64(x * y) / a_m); else tmp = t_1; end return Float64(a_s * tmp) end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
function tmp_2 = code(a_s, x, y, z, t, a_m)
t_1 = x * (y / a_m);
tmp = 0.0;
if ((x * y) <= -4e-14)
tmp = t_1;
elseif ((x * y) <= 4e-155)
tmp = t * (z / -a_m);
elseif ((x * y) <= 4e+111)
tmp = (x * y) / a_m;
else
tmp = t_1;
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]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[(x * N[(y / a$95$m), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[N[(x * y), $MachinePrecision], -4e-14], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4e-155], N[(t * N[(z / (-a$95$m)), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e+111], N[(N[(x * y), $MachinePrecision] / a$95$m), $MachinePrecision], t$95$1]]]), $MachinePrecision]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{a\_m}\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-155}:\\
\;\;\;\;t \cdot \frac{z}{-a\_m}\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+111}:\\
\;\;\;\;\frac{x \cdot y}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if (*.f64 x y) < -4e-14 or 3.99999999999999983e111 < (*.f64 x y) Initial program 84.0%
Taylor expanded in x around inf 76.1%
associate-*r/80.5%
Simplified80.5%
if -4e-14 < (*.f64 x y) < 4.00000000000000006e-155Initial program 95.3%
Taylor expanded in x around 0 81.9%
mul-1-neg81.9%
associate-/l*74.4%
distribute-rgt-neg-in74.4%
distribute-neg-frac274.4%
Simplified74.4%
if 4.00000000000000006e-155 < (*.f64 x y) < 3.99999999999999983e111Initial program 95.6%
Taylor expanded in x around inf 61.1%
Final simplification74.7%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
:precision binary64
(*
a_s
(if (or (<= (* x y) -5e+234) (not (<= (* x y) 1e+164)))
(* x (/ y a_m))
(/ (- (* x y) (* z t)) a_m))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if (((x * y) <= -5e+234) || !((x * y) <= 1e+164)) {
tmp = x * (y / a_m);
} else {
tmp = ((x * y) - (z * t)) / a_m;
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
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+234)) .or. (.not. ((x * y) <= 1d+164))) then
tmp = x * (y / 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);
assert x < y && y < z && z < t && t < a_m;
assert x < y && y < z && z < t && t < a_m;
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if (((x * y) <= -5e+234) || !((x * y) <= 1e+164)) {
tmp = x * (y / 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) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) def code(a_s, x, y, z, t, a_m): tmp = 0 if ((x * y) <= -5e+234) or not ((x * y) <= 1e+164): tmp = x * (y / a_m) else: tmp = ((x * y) - (z * t)) / a_m return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) x, y, z, t, a_m = sort([x, y, z, t, a_m]) x, y, z, t, a_m = sort([x, y, z, t, a_m]) function code(a_s, x, y, z, t, a_m) tmp = 0.0 if ((Float64(x * y) <= -5e+234) || !(Float64(x * y) <= 1e+164)) tmp = Float64(x * Float64(y / 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);
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
function tmp_2 = code(a_s, x, y, z, t, a_m)
tmp = 0.0;
if (((x * y) <= -5e+234) || ~(((x * y) <= 1e+164)))
tmp = x * (y / 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]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[Or[LessEqual[N[(x * y), $MachinePrecision], -5e+234], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+164]], $MachinePrecision]], N[(x * N[(y / 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)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+234} \lor \neg \left(x \cdot y \leq 10^{+164}\right):\\
\;\;\;\;x \cdot \frac{y}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a\_m}\\
\end{array}
\end{array}
if (*.f64 x y) < -5.0000000000000003e234 or 1e164 < (*.f64 x y) Initial program 74.2%
Taylor expanded in x around inf 76.0%
associate-*r/90.2%
Simplified90.2%
if -5.0000000000000003e234 < (*.f64 x y) < 1e164Initial program 95.5%
Final simplification94.3%
a\_m = (fabs.f64 a) a\_s = (copysign.f64 #s(literal 1 binary64) a) NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function. (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);
assert(x < y && y < z && z < t && t < a_m);
assert(x < y && y < z && z < t && t < a_m);
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)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
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);
assert x < y && y < z && z < t && t < a_m;
assert x < y && y < z && z < t && t < a_m;
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) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) 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) x, y, z, t, a_m = sort([x, y, z, t, a_m]) x, y, z, t, a_m = sort([x, y, z, t, a_m]) 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);
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
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]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
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)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
a\_s \cdot \left(x \cdot \frac{y}{a\_m}\right)
\end{array}
Initial program 90.5%
Taylor expanded in x around inf 52.8%
associate-*r/54.0%
Simplified54.0%
Final simplification54.0%
(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 2024089
(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))