
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * 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) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * 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) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
(FPCore (z_s y_s x_s x_m y_m z_m t a)
:precision binary64
(let* ((t_1 (sqrt (- (* z_m z_m) (* t a)))) (t_2 (/ (* z_m (* y_m x_m)) t_1)))
(*
z_s
(*
y_s
(*
x_s
(if (<= t_2 0.0)
(*
y_m
(/
x_m
(+ 1.0 (* (* a 0.3333333333333333) (* (/ t (pow z_m 2.0)) -1.5)))))
(if (<= t_2 1e+232)
t_2
(if (<= t_2 INFINITY)
(/ y_m (/ t_1 (* z_m x_m)))
(* y_m (/ x_m (/ (fma -0.5 (* t (/ a z_m)) z_m) z_m)))))))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y_m && y_m < z_m && z_m < t && t < a);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double t_1 = sqrt(((z_m * z_m) - (t * a)));
double t_2 = (z_m * (y_m * x_m)) / t_1;
double tmp;
if (t_2 <= 0.0) {
tmp = y_m * (x_m / (1.0 + ((a * 0.3333333333333333) * ((t / pow(z_m, 2.0)) * -1.5))));
} else if (t_2 <= 1e+232) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = y_m / (t_1 / (z_m * x_m));
} else {
tmp = y_m * (x_m / (fma(-0.5, (t * (a / z_m)), z_m) / z_m));
}
return z_s * (y_s * (x_s * tmp));
}
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) z_m = abs(z) z_s = copysign(1.0, z) x_m, y_m, z_m, t, a = sort([x_m, y_m, z_m, t, a]) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a) t_1 = sqrt(Float64(Float64(z_m * z_m) - Float64(t * a))) t_2 = Float64(Float64(z_m * Float64(y_m * x_m)) / t_1) tmp = 0.0 if (t_2 <= 0.0) tmp = Float64(y_m * Float64(x_m / Float64(1.0 + Float64(Float64(a * 0.3333333333333333) * Float64(Float64(t / (z_m ^ 2.0)) * -1.5))))); elseif (t_2 <= 1e+232) tmp = t_2; elseif (t_2 <= Inf) tmp = Float64(y_m / Float64(t_1 / Float64(z_m * x_m))); else tmp = Float64(y_m * Float64(x_m / Float64(fma(-0.5, Float64(t * Float64(a / z_m)), z_m) / z_m))); end return Float64(z_s * Float64(y_s * Float64(x_s * tmp))) end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_, t_, a_] := Block[{t$95$1 = N[Sqrt[N[(N[(z$95$m * z$95$m), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(z$95$m * N[(y$95$m * x$95$m), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[t$95$2, 0.0], N[(y$95$m * N[(x$95$m / N[(1.0 + N[(N[(a * 0.3333333333333333), $MachinePrecision] * N[(N[(t / N[Power[z$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * -1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+232], t$95$2, If[LessEqual[t$95$2, Infinity], N[(y$95$m / N[(t$95$1 / N[(z$95$m * x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$95$m * N[(x$95$m / N[(N[(-0.5 * N[(t * N[(a / z$95$m), $MachinePrecision]), $MachinePrecision] + z$95$m), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y_m, z_m, t, a] = \mathsf{sort}([x_m, y_m, z_m, t, a])\\
\\
\begin{array}{l}
t_1 := \sqrt{z_m \cdot z_m - t \cdot a}\\
t_2 := \frac{z_m \cdot \left(y_m \cdot x_m\right)}{t_1}\\
z_s \cdot \left(y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;t_2 \leq 0:\\
\;\;\;\;y_m \cdot \frac{x_m}{1 + \left(a \cdot 0.3333333333333333\right) \cdot \left(\frac{t}{{z_m}^{2}} \cdot -1.5\right)}\\
\mathbf{elif}\;t_2 \leq 10^{+232}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;\frac{y_m}{\frac{t_1}{z_m \cdot x_m}}\\
\mathbf{else}:\\
\;\;\;\;y_m \cdot \frac{x_m}{\frac{\mathsf{fma}\left(-0.5, t \cdot \frac{a}{z_m}, z_m\right)}{z_m}}\\
\end{array}\right)\right)
\end{array}
\end{array}
if (/.f64 (*.f64 (*.f64 x y) z) (sqrt.f64 (-.f64 (*.f64 z z) (*.f64 t a)))) < 0.0Initial program 64.4%
associate-*l*62.7%
*-commutative62.7%
associate-*l*61.1%
*-commutative61.1%
associate-/l*61.8%
Simplified61.8%
Taylor expanded in z around inf 47.3%
div-inv47.3%
associate-/l*48.6%
clear-num48.7%
*-commutative48.7%
associate-/l*50.1%
+-commutative50.1%
associate-/l*48.3%
fma-def48.3%
associate-/l*50.1%
associate-/r/50.1%
Applied egg-rr50.1%
add-cbrt-cube50.0%
pow1/350.0%
pow350.0%
associate-*l/48.2%
associate-/l*50.0%
Applied egg-rr50.0%
Taylor expanded in a around 0 50.0%
associate-*r*50.0%
distribute-rgt-out50.0%
metadata-eval50.0%
Simplified50.0%
if 0.0 < (/.f64 (*.f64 (*.f64 x y) z) (sqrt.f64 (-.f64 (*.f64 z z) (*.f64 t a)))) < 1.00000000000000006e232Initial program 99.6%
if 1.00000000000000006e232 < (/.f64 (*.f64 (*.f64 x y) z) (sqrt.f64 (-.f64 (*.f64 z z) (*.f64 t a)))) < +inf.0Initial program 34.5%
associate-*l*62.7%
*-commutative62.7%
associate-*l*62.7%
*-commutative62.7%
associate-/l*81.2%
Simplified81.2%
if +inf.0 < (/.f64 (*.f64 (*.f64 x y) z) (sqrt.f64 (-.f64 (*.f64 z z) (*.f64 t a)))) Initial program 0.0%
associate-*l*0.1%
*-commutative0.1%
associate-*l*0.1%
*-commutative0.1%
associate-/l*0.7%
Simplified0.7%
Taylor expanded in z around inf 30.4%
div-inv30.4%
associate-/l*37.8%
clear-num37.8%
*-commutative37.8%
associate-/l*51.7%
+-commutative51.7%
associate-/l*42.2%
fma-def42.2%
associate-/l*51.7%
associate-/r/51.7%
Applied egg-rr51.7%
Final simplification60.0%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
(FPCore (z_s y_s x_s x_m y_m z_m t a)
:precision binary64
(let* ((t_1 (sqrt (- (* z_m z_m) (* t a))))
(t_2 (/ (* z_m (* y_m x_m)) t_1))
(t_3 (* y_m (/ x_m (/ (fma -0.5 (* t (/ a z_m)) z_m) z_m)))))
(*
z_s
(*
y_s
(*
x_s
(if (<= t_2 0.0)
t_3
(if (<= t_2 1e+232)
t_2
(if (<= t_2 INFINITY) (/ y_m (/ t_1 (* z_m x_m))) t_3))))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y_m && y_m < z_m && z_m < t && t < a);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double t_1 = sqrt(((z_m * z_m) - (t * a)));
double t_2 = (z_m * (y_m * x_m)) / t_1;
double t_3 = y_m * (x_m / (fma(-0.5, (t * (a / z_m)), z_m) / z_m));
double tmp;
if (t_2 <= 0.0) {
tmp = t_3;
} else if (t_2 <= 1e+232) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = y_m / (t_1 / (z_m * x_m));
} else {
tmp = t_3;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) z_m = abs(z) z_s = copysign(1.0, z) x_m, y_m, z_m, t, a = sort([x_m, y_m, z_m, t, a]) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a) t_1 = sqrt(Float64(Float64(z_m * z_m) - Float64(t * a))) t_2 = Float64(Float64(z_m * Float64(y_m * x_m)) / t_1) t_3 = Float64(y_m * Float64(x_m / Float64(fma(-0.5, Float64(t * Float64(a / z_m)), z_m) / z_m))) tmp = 0.0 if (t_2 <= 0.0) tmp = t_3; elseif (t_2 <= 1e+232) tmp = t_2; elseif (t_2 <= Inf) tmp = Float64(y_m / Float64(t_1 / Float64(z_m * x_m))); else tmp = t_3; end return Float64(z_s * Float64(y_s * Float64(x_s * tmp))) end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_, t_, a_] := Block[{t$95$1 = N[Sqrt[N[(N[(z$95$m * z$95$m), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(z$95$m * N[(y$95$m * x$95$m), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(y$95$m * N[(x$95$m / N[(N[(-0.5 * N[(t * N[(a / z$95$m), $MachinePrecision]), $MachinePrecision] + z$95$m), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[t$95$2, 0.0], t$95$3, If[LessEqual[t$95$2, 1e+232], t$95$2, If[LessEqual[t$95$2, Infinity], N[(y$95$m / N[(t$95$1 / N[(z$95$m * x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y_m, z_m, t, a] = \mathsf{sort}([x_m, y_m, z_m, t, a])\\
\\
\begin{array}{l}
t_1 := \sqrt{z_m \cdot z_m - t \cdot a}\\
t_2 := \frac{z_m \cdot \left(y_m \cdot x_m\right)}{t_1}\\
t_3 := y_m \cdot \frac{x_m}{\frac{\mathsf{fma}\left(-0.5, t \cdot \frac{a}{z_m}, z_m\right)}{z_m}}\\
z_s \cdot \left(y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;t_2 \leq 0:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq 10^{+232}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;\frac{y_m}{\frac{t_1}{z_m \cdot x_m}}\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}\right)\right)
\end{array}
\end{array}
if (/.f64 (*.f64 (*.f64 x y) z) (sqrt.f64 (-.f64 (*.f64 z z) (*.f64 t a)))) < 0.0 or +inf.0 < (/.f64 (*.f64 (*.f64 x y) z) (sqrt.f64 (-.f64 (*.f64 z z) (*.f64 t a)))) Initial program 51.3%
associate-*l*50.0%
*-commutative50.0%
associate-*l*48.7%
*-commutative48.7%
associate-/l*49.4%
Simplified49.4%
Taylor expanded in z around inf 43.9%
div-inv43.9%
associate-/l*46.4%
clear-num46.5%
*-commutative46.5%
associate-/l*50.4%
+-commutative50.4%
associate-/l*47.0%
fma-def47.0%
associate-/l*50.4%
associate-/r/50.4%
Applied egg-rr50.4%
if 0.0 < (/.f64 (*.f64 (*.f64 x y) z) (sqrt.f64 (-.f64 (*.f64 z z) (*.f64 t a)))) < 1.00000000000000006e232Initial program 99.6%
if 1.00000000000000006e232 < (/.f64 (*.f64 (*.f64 x y) z) (sqrt.f64 (-.f64 (*.f64 z z) (*.f64 t a)))) < +inf.0Initial program 34.5%
associate-*l*62.7%
*-commutative62.7%
associate-*l*62.7%
*-commutative62.7%
associate-/l*81.2%
Simplified81.2%
Final simplification60.1%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
(FPCore (z_s y_s x_s x_m y_m z_m t a)
:precision binary64
(*
z_s
(*
y_s
(*
x_s
(if (<= z_m 5.5e+37)
(/ (* z_m y_m) (/ (sqrt (- (pow z_m 2.0) (* t a))) x_m))
(* y_m x_m))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y_m && y_m < z_m && z_m < t && t < a);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 5.5e+37) {
tmp = (z_m * y_m) / (sqrt((pow(z_m, 2.0) - (t * a))) / x_m);
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z_m <= 5.5d+37) then
tmp = (z_m * y_m) / (sqrt(((z_m ** 2.0d0) - (t * a))) / x_m)
else
tmp = y_m * x_m
end if
code = z_s * (y_s * (x_s * tmp))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y_m && y_m < z_m && z_m < t && t < a;
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 5.5e+37) {
tmp = (z_m * y_m) / (Math.sqrt((Math.pow(z_m, 2.0) - (t * a))) / x_m);
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y_m, z_m, t, a] = sort([x_m, y_m, z_m, t, a]) def code(z_s, y_s, x_s, x_m, y_m, z_m, t, a): tmp = 0 if z_m <= 5.5e+37: tmp = (z_m * y_m) / (math.sqrt((math.pow(z_m, 2.0) - (t * a))) / x_m) else: tmp = y_m * x_m return z_s * (y_s * (x_s * tmp))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) z_m = abs(z) z_s = copysign(1.0, z) x_m, y_m, z_m, t, a = sort([x_m, y_m, z_m, t, a]) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a) tmp = 0.0 if (z_m <= 5.5e+37) tmp = Float64(Float64(z_m * y_m) / Float64(sqrt(Float64((z_m ^ 2.0) - Float64(t * a))) / x_m)); else tmp = Float64(y_m * x_m); end return Float64(z_s * Float64(y_s * Float64(x_s * tmp))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y_m, z_m, t, a = num2cell(sort([x_m, y_m, z_m, t, a])){:}
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
tmp = 0.0;
if (z_m <= 5.5e+37)
tmp = (z_m * y_m) / (sqrt(((z_m ^ 2.0) - (t * a))) / x_m);
else
tmp = y_m * x_m;
end
tmp_2 = z_s * (y_s * (x_s * tmp));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_, t_, a_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[z$95$m, 5.5e+37], N[(N[(z$95$m * y$95$m), $MachinePrecision] / N[(N[Sqrt[N[(N[Power[z$95$m, 2.0], $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision], N[(y$95$m * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y_m, z_m, t, a] = \mathsf{sort}([x_m, y_m, z_m, t, a])\\
\\
z_s \cdot \left(y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 5.5 \cdot 10^{+37}:\\
\;\;\;\;\frac{z_m \cdot y_m}{\frac{\sqrt{{z_m}^{2} - t \cdot a}}{x_m}}\\
\mathbf{else}:\\
\;\;\;\;y_m \cdot x_m\\
\end{array}\right)\right)
\end{array}
if z < 5.50000000000000016e37Initial program 64.8%
associate-/l*65.1%
associate-*l/66.0%
*-commutative66.0%
associate-/l*63.1%
Simplified63.1%
associate-*r/61.4%
*-commutative61.4%
associate-*r*63.1%
associate-/l*64.0%
*-commutative64.0%
pow264.0%
Applied egg-rr64.0%
if 5.50000000000000016e37 < z Initial program 43.3%
associate-/l*46.3%
associate-*l/46.5%
*-commutative46.5%
associate-/l*41.9%
Simplified41.9%
Taylor expanded in z around inf 90.8%
Final simplification71.2%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
(FPCore (z_s y_s x_s x_m y_m z_m t a)
:precision binary64
(*
z_s
(*
y_s
(*
x_s
(if (<= z_m 6.2e-103)
(/ (* z_m y_m) (/ (sqrt (* t (- a))) x_m))
(if (<= z_m 9.5e+135)
(* y_m (/ (* z_m x_m) (sqrt (- (* z_m z_m) (* t a)))))
(* y_m x_m)))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y_m && y_m < z_m && z_m < t && t < a);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 6.2e-103) {
tmp = (z_m * y_m) / (sqrt((t * -a)) / x_m);
} else if (z_m <= 9.5e+135) {
tmp = y_m * ((z_m * x_m) / sqrt(((z_m * z_m) - (t * a))));
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z_m <= 6.2d-103) then
tmp = (z_m * y_m) / (sqrt((t * -a)) / x_m)
else if (z_m <= 9.5d+135) then
tmp = y_m * ((z_m * x_m) / sqrt(((z_m * z_m) - (t * a))))
else
tmp = y_m * x_m
end if
code = z_s * (y_s * (x_s * tmp))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y_m && y_m < z_m && z_m < t && t < a;
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 6.2e-103) {
tmp = (z_m * y_m) / (Math.sqrt((t * -a)) / x_m);
} else if (z_m <= 9.5e+135) {
tmp = y_m * ((z_m * x_m) / Math.sqrt(((z_m * z_m) - (t * a))));
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y_m, z_m, t, a] = sort([x_m, y_m, z_m, t, a]) def code(z_s, y_s, x_s, x_m, y_m, z_m, t, a): tmp = 0 if z_m <= 6.2e-103: tmp = (z_m * y_m) / (math.sqrt((t * -a)) / x_m) elif z_m <= 9.5e+135: tmp = y_m * ((z_m * x_m) / math.sqrt(((z_m * z_m) - (t * a)))) else: tmp = y_m * x_m return z_s * (y_s * (x_s * tmp))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) z_m = abs(z) z_s = copysign(1.0, z) x_m, y_m, z_m, t, a = sort([x_m, y_m, z_m, t, a]) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a) tmp = 0.0 if (z_m <= 6.2e-103) tmp = Float64(Float64(z_m * y_m) / Float64(sqrt(Float64(t * Float64(-a))) / x_m)); elseif (z_m <= 9.5e+135) tmp = Float64(y_m * Float64(Float64(z_m * x_m) / sqrt(Float64(Float64(z_m * z_m) - Float64(t * a))))); else tmp = Float64(y_m * x_m); end return Float64(z_s * Float64(y_s * Float64(x_s * tmp))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y_m, z_m, t, a = num2cell(sort([x_m, y_m, z_m, t, a])){:}
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
tmp = 0.0;
if (z_m <= 6.2e-103)
tmp = (z_m * y_m) / (sqrt((t * -a)) / x_m);
elseif (z_m <= 9.5e+135)
tmp = y_m * ((z_m * x_m) / sqrt(((z_m * z_m) - (t * a))));
else
tmp = y_m * x_m;
end
tmp_2 = z_s * (y_s * (x_s * tmp));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_, t_, a_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[z$95$m, 6.2e-103], N[(N[(z$95$m * y$95$m), $MachinePrecision] / N[(N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[z$95$m, 9.5e+135], N[(y$95$m * N[(N[(z$95$m * x$95$m), $MachinePrecision] / N[Sqrt[N[(N[(z$95$m * z$95$m), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$95$m * x$95$m), $MachinePrecision]]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y_m, z_m, t, a] = \mathsf{sort}([x_m, y_m, z_m, t, a])\\
\\
z_s \cdot \left(y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 6.2 \cdot 10^{-103}:\\
\;\;\;\;\frac{z_m \cdot y_m}{\frac{\sqrt{t \cdot \left(-a\right)}}{x_m}}\\
\mathbf{elif}\;z_m \leq 9.5 \cdot 10^{+135}:\\
\;\;\;\;y_m \cdot \frac{z_m \cdot x_m}{\sqrt{z_m \cdot z_m - t \cdot a}}\\
\mathbf{else}:\\
\;\;\;\;y_m \cdot x_m\\
\end{array}\right)\right)
\end{array}
if z < 6.2000000000000003e-103Initial program 62.8%
associate-/l*63.2%
associate-*l/62.5%
*-commutative62.5%
associate-/l*59.1%
Simplified59.1%
associate-*r/58.3%
*-commutative58.3%
associate-*r*61.0%
associate-/l*60.8%
*-commutative60.8%
pow260.8%
Applied egg-rr60.8%
Taylor expanded in z around 0 37.8%
mul-1-neg37.8%
distribute-rgt-neg-in37.8%
Simplified37.8%
if 6.2000000000000003e-103 < z < 9.50000000000000036e135Initial program 80.8%
associate-/l*84.4%
associate-*l/89.4%
*-commutative89.4%
associate-/l*85.8%
Simplified85.8%
if 9.50000000000000036e135 < z Initial program 15.9%
associate-/l*16.4%
associate-*l/16.7%
*-commutative16.7%
associate-/l*13.7%
Simplified13.7%
Taylor expanded in z around inf 95.6%
Final simplification57.6%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
(FPCore (z_s y_s x_s x_m y_m z_m t a)
:precision binary64
(let* ((t_1 (sqrt (- (* z_m z_m) (* t a)))))
(*
z_s
(*
y_s
(*
x_s
(if (<= z_m 5.2e-61)
(/ (* (* z_m y_m) x_m) t_1)
(if (<= z_m 1e+135) (* y_m (/ (* z_m x_m) t_1)) (* y_m x_m))))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y_m && y_m < z_m && z_m < t && t < a);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double t_1 = sqrt(((z_m * z_m) - (t * a)));
double tmp;
if (z_m <= 5.2e-61) {
tmp = ((z_m * y_m) * x_m) / t_1;
} else if (z_m <= 1e+135) {
tmp = y_m * ((z_m * x_m) / t_1);
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(((z_m * z_m) - (t * a)))
if (z_m <= 5.2d-61) then
tmp = ((z_m * y_m) * x_m) / t_1
else if (z_m <= 1d+135) then
tmp = y_m * ((z_m * x_m) / t_1)
else
tmp = y_m * x_m
end if
code = z_s * (y_s * (x_s * tmp))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y_m && y_m < z_m && z_m < t && t < a;
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double t_1 = Math.sqrt(((z_m * z_m) - (t * a)));
double tmp;
if (z_m <= 5.2e-61) {
tmp = ((z_m * y_m) * x_m) / t_1;
} else if (z_m <= 1e+135) {
tmp = y_m * ((z_m * x_m) / t_1);
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y_m, z_m, t, a] = sort([x_m, y_m, z_m, t, a]) def code(z_s, y_s, x_s, x_m, y_m, z_m, t, a): t_1 = math.sqrt(((z_m * z_m) - (t * a))) tmp = 0 if z_m <= 5.2e-61: tmp = ((z_m * y_m) * x_m) / t_1 elif z_m <= 1e+135: tmp = y_m * ((z_m * x_m) / t_1) else: tmp = y_m * x_m return z_s * (y_s * (x_s * tmp))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) z_m = abs(z) z_s = copysign(1.0, z) x_m, y_m, z_m, t, a = sort([x_m, y_m, z_m, t, a]) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a) t_1 = sqrt(Float64(Float64(z_m * z_m) - Float64(t * a))) tmp = 0.0 if (z_m <= 5.2e-61) tmp = Float64(Float64(Float64(z_m * y_m) * x_m) / t_1); elseif (z_m <= 1e+135) tmp = Float64(y_m * Float64(Float64(z_m * x_m) / t_1)); else tmp = Float64(y_m * x_m); end return Float64(z_s * Float64(y_s * Float64(x_s * tmp))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y_m, z_m, t, a = num2cell(sort([x_m, y_m, z_m, t, a])){:}
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
t_1 = sqrt(((z_m * z_m) - (t * a)));
tmp = 0.0;
if (z_m <= 5.2e-61)
tmp = ((z_m * y_m) * x_m) / t_1;
elseif (z_m <= 1e+135)
tmp = y_m * ((z_m * x_m) / t_1);
else
tmp = y_m * x_m;
end
tmp_2 = z_s * (y_s * (x_s * tmp));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_, t_, a_] := Block[{t$95$1 = N[Sqrt[N[(N[(z$95$m * z$95$m), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[z$95$m, 5.2e-61], N[(N[(N[(z$95$m * y$95$m), $MachinePrecision] * x$95$m), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z$95$m, 1e+135], N[(y$95$m * N[(N[(z$95$m * x$95$m), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(y$95$m * x$95$m), $MachinePrecision]]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y_m, z_m, t, a] = \mathsf{sort}([x_m, y_m, z_m, t, a])\\
\\
\begin{array}{l}
t_1 := \sqrt{z_m \cdot z_m - t \cdot a}\\
z_s \cdot \left(y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 5.2 \cdot 10^{-61}:\\
\;\;\;\;\frac{\left(z_m \cdot y_m\right) \cdot x_m}{t_1}\\
\mathbf{elif}\;z_m \leq 10^{+135}:\\
\;\;\;\;y_m \cdot \frac{z_m \cdot x_m}{t_1}\\
\mathbf{else}:\\
\;\;\;\;y_m \cdot x_m\\
\end{array}\right)\right)
\end{array}
\end{array}
if z < 5.20000000000000021e-61Initial program 63.2%
associate-*l*61.4%
Simplified61.4%
if 5.20000000000000021e-61 < z < 9.99999999999999962e134Initial program 82.0%
associate-/l*86.0%
associate-*l/89.9%
*-commutative89.9%
associate-/l*85.9%
Simplified85.9%
if 9.99999999999999962e134 < z Initial program 15.9%
associate-/l*16.4%
associate-*l/16.7%
*-commutative16.7%
associate-/l*13.7%
Simplified13.7%
Taylor expanded in z around inf 95.6%
Final simplification71.6%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
(FPCore (z_s y_s x_s x_m y_m z_m t a)
:precision binary64
(*
z_s
(*
y_s
(*
x_s
(if (<= z_m 3.3e-65)
(* y_m (/ (* z_m x_m) (sqrt (* t (- a)))))
(* y_m x_m))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y_m && y_m < z_m && z_m < t && t < a);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 3.3e-65) {
tmp = y_m * ((z_m * x_m) / sqrt((t * -a)));
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z_m <= 3.3d-65) then
tmp = y_m * ((z_m * x_m) / sqrt((t * -a)))
else
tmp = y_m * x_m
end if
code = z_s * (y_s * (x_s * tmp))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y_m && y_m < z_m && z_m < t && t < a;
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 3.3e-65) {
tmp = y_m * ((z_m * x_m) / Math.sqrt((t * -a)));
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y_m, z_m, t, a] = sort([x_m, y_m, z_m, t, a]) def code(z_s, y_s, x_s, x_m, y_m, z_m, t, a): tmp = 0 if z_m <= 3.3e-65: tmp = y_m * ((z_m * x_m) / math.sqrt((t * -a))) else: tmp = y_m * x_m return z_s * (y_s * (x_s * tmp))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) z_m = abs(z) z_s = copysign(1.0, z) x_m, y_m, z_m, t, a = sort([x_m, y_m, z_m, t, a]) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a) tmp = 0.0 if (z_m <= 3.3e-65) tmp = Float64(y_m * Float64(Float64(z_m * x_m) / sqrt(Float64(t * Float64(-a))))); else tmp = Float64(y_m * x_m); end return Float64(z_s * Float64(y_s * Float64(x_s * tmp))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y_m, z_m, t, a = num2cell(sort([x_m, y_m, z_m, t, a])){:}
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
tmp = 0.0;
if (z_m <= 3.3e-65)
tmp = y_m * ((z_m * x_m) / sqrt((t * -a)));
else
tmp = y_m * x_m;
end
tmp_2 = z_s * (y_s * (x_s * tmp));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_, t_, a_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[z$95$m, 3.3e-65], N[(y$95$m * N[(N[(z$95$m * x$95$m), $MachinePrecision] / N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$95$m * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y_m, z_m, t, a] = \mathsf{sort}([x_m, y_m, z_m, t, a])\\
\\
z_s \cdot \left(y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 3.3 \cdot 10^{-65}:\\
\;\;\;\;y_m \cdot \frac{z_m \cdot x_m}{\sqrt{t \cdot \left(-a\right)}}\\
\mathbf{else}:\\
\;\;\;\;y_m \cdot x_m\\
\end{array}\right)\right)
\end{array}
if z < 3.3000000000000001e-65Initial program 63.0%
associate-/l*63.4%
associate-*l/63.2%
*-commutative63.2%
associate-/l*60.0%
Simplified60.0%
Taylor expanded in z around 0 36.5%
mul-1-neg36.5%
*-commutative36.5%
distribute-rgt-neg-in36.5%
Simplified36.5%
if 3.3000000000000001e-65 < z Initial program 51.7%
associate-/l*54.0%
associate-*l/56.2%
*-commutative56.2%
associate-/l*52.7%
Simplified52.7%
Taylor expanded in z around inf 84.7%
Final simplification53.6%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
(FPCore (z_s y_s x_s x_m y_m z_m t a)
:precision binary64
(*
z_s
(*
y_s
(*
x_s
(if (<= z_m 3e-65)
(/ (* (* z_m y_m) x_m) (sqrt (* t (- a))))
(* y_m x_m))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y_m && y_m < z_m && z_m < t && t < a);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 3e-65) {
tmp = ((z_m * y_m) * x_m) / sqrt((t * -a));
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z_m <= 3d-65) then
tmp = ((z_m * y_m) * x_m) / sqrt((t * -a))
else
tmp = y_m * x_m
end if
code = z_s * (y_s * (x_s * tmp))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y_m && y_m < z_m && z_m < t && t < a;
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 3e-65) {
tmp = ((z_m * y_m) * x_m) / Math.sqrt((t * -a));
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y_m, z_m, t, a] = sort([x_m, y_m, z_m, t, a]) def code(z_s, y_s, x_s, x_m, y_m, z_m, t, a): tmp = 0 if z_m <= 3e-65: tmp = ((z_m * y_m) * x_m) / math.sqrt((t * -a)) else: tmp = y_m * x_m return z_s * (y_s * (x_s * tmp))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) z_m = abs(z) z_s = copysign(1.0, z) x_m, y_m, z_m, t, a = sort([x_m, y_m, z_m, t, a]) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a) tmp = 0.0 if (z_m <= 3e-65) tmp = Float64(Float64(Float64(z_m * y_m) * x_m) / sqrt(Float64(t * Float64(-a)))); else tmp = Float64(y_m * x_m); end return Float64(z_s * Float64(y_s * Float64(x_s * tmp))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y_m, z_m, t, a = num2cell(sort([x_m, y_m, z_m, t, a])){:}
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
tmp = 0.0;
if (z_m <= 3e-65)
tmp = ((z_m * y_m) * x_m) / sqrt((t * -a));
else
tmp = y_m * x_m;
end
tmp_2 = z_s * (y_s * (x_s * tmp));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_, t_, a_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[z$95$m, 3e-65], N[(N[(N[(z$95$m * y$95$m), $MachinePrecision] * x$95$m), $MachinePrecision] / N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(y$95$m * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y_m, z_m, t, a] = \mathsf{sort}([x_m, y_m, z_m, t, a])\\
\\
z_s \cdot \left(y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 3 \cdot 10^{-65}:\\
\;\;\;\;\frac{\left(z_m \cdot y_m\right) \cdot x_m}{\sqrt{t \cdot \left(-a\right)}}\\
\mathbf{else}:\\
\;\;\;\;y_m \cdot x_m\\
\end{array}\right)\right)
\end{array}
if z < 2.99999999999999998e-65Initial program 63.0%
associate-*l*61.1%
Simplified61.1%
Taylor expanded in z around 0 38.0%
mul-1-neg36.5%
*-commutative36.5%
distribute-rgt-neg-in36.5%
Simplified38.0%
if 2.99999999999999998e-65 < z Initial program 51.7%
associate-/l*54.0%
associate-*l/56.2%
*-commutative56.2%
associate-/l*52.7%
Simplified52.7%
Taylor expanded in z around inf 84.7%
Final simplification54.6%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
(FPCore (z_s y_s x_s x_m y_m z_m t a)
:precision binary64
(*
z_s
(*
y_s
(*
x_s
(if (<= z_m 4.4e-65)
(/ (* z_m y_m) (/ (sqrt (* t (- a))) x_m))
(* y_m x_m))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y_m && y_m < z_m && z_m < t && t < a);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 4.4e-65) {
tmp = (z_m * y_m) / (sqrt((t * -a)) / x_m);
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z_m <= 4.4d-65) then
tmp = (z_m * y_m) / (sqrt((t * -a)) / x_m)
else
tmp = y_m * x_m
end if
code = z_s * (y_s * (x_s * tmp))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y_m && y_m < z_m && z_m < t && t < a;
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 4.4e-65) {
tmp = (z_m * y_m) / (Math.sqrt((t * -a)) / x_m);
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y_m, z_m, t, a] = sort([x_m, y_m, z_m, t, a]) def code(z_s, y_s, x_s, x_m, y_m, z_m, t, a): tmp = 0 if z_m <= 4.4e-65: tmp = (z_m * y_m) / (math.sqrt((t * -a)) / x_m) else: tmp = y_m * x_m return z_s * (y_s * (x_s * tmp))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) z_m = abs(z) z_s = copysign(1.0, z) x_m, y_m, z_m, t, a = sort([x_m, y_m, z_m, t, a]) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a) tmp = 0.0 if (z_m <= 4.4e-65) tmp = Float64(Float64(z_m * y_m) / Float64(sqrt(Float64(t * Float64(-a))) / x_m)); else tmp = Float64(y_m * x_m); end return Float64(z_s * Float64(y_s * Float64(x_s * tmp))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y_m, z_m, t, a = num2cell(sort([x_m, y_m, z_m, t, a])){:}
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
tmp = 0.0;
if (z_m <= 4.4e-65)
tmp = (z_m * y_m) / (sqrt((t * -a)) / x_m);
else
tmp = y_m * x_m;
end
tmp_2 = z_s * (y_s * (x_s * tmp));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_, t_, a_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[z$95$m, 4.4e-65], N[(N[(z$95$m * y$95$m), $MachinePrecision] / N[(N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision], N[(y$95$m * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y_m, z_m, t, a] = \mathsf{sort}([x_m, y_m, z_m, t, a])\\
\\
z_s \cdot \left(y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 4.4 \cdot 10^{-65}:\\
\;\;\;\;\frac{z_m \cdot y_m}{\frac{\sqrt{t \cdot \left(-a\right)}}{x_m}}\\
\mathbf{else}:\\
\;\;\;\;y_m \cdot x_m\\
\end{array}\right)\right)
\end{array}
if z < 4.40000000000000042e-65Initial program 63.0%
associate-/l*63.4%
associate-*l/63.2%
*-commutative63.2%
associate-/l*60.0%
Simplified60.0%
associate-*r/59.2%
*-commutative59.2%
associate-*r*61.1%
associate-/l*60.9%
*-commutative60.9%
pow260.9%
Applied egg-rr60.9%
Taylor expanded in z around 0 38.2%
mul-1-neg38.2%
distribute-rgt-neg-in38.2%
Simplified38.2%
if 4.40000000000000042e-65 < z Initial program 51.7%
associate-/l*54.0%
associate-*l/56.2%
*-commutative56.2%
associate-/l*52.7%
Simplified52.7%
Taylor expanded in z around inf 84.7%
Final simplification54.7%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
(FPCore (z_s y_s x_s x_m y_m z_m t a)
:precision binary64
(*
z_s
(*
y_s
(*
x_s
(if (<= z_m 0.0085)
(/ (* z_m y_m) (+ (* -0.5 (/ 1.0 (* (/ z_m t) (/ x_m a)))) (/ z_m x_m)))
(* y_m x_m))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y_m && y_m < z_m && z_m < t && t < a);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 0.0085) {
tmp = (z_m * y_m) / ((-0.5 * (1.0 / ((z_m / t) * (x_m / a)))) + (z_m / x_m));
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z_m <= 0.0085d0) then
tmp = (z_m * y_m) / (((-0.5d0) * (1.0d0 / ((z_m / t) * (x_m / a)))) + (z_m / x_m))
else
tmp = y_m * x_m
end if
code = z_s * (y_s * (x_s * tmp))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y_m && y_m < z_m && z_m < t && t < a;
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 0.0085) {
tmp = (z_m * y_m) / ((-0.5 * (1.0 / ((z_m / t) * (x_m / a)))) + (z_m / x_m));
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y_m, z_m, t, a] = sort([x_m, y_m, z_m, t, a]) def code(z_s, y_s, x_s, x_m, y_m, z_m, t, a): tmp = 0 if z_m <= 0.0085: tmp = (z_m * y_m) / ((-0.5 * (1.0 / ((z_m / t) * (x_m / a)))) + (z_m / x_m)) else: tmp = y_m * x_m return z_s * (y_s * (x_s * tmp))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) z_m = abs(z) z_s = copysign(1.0, z) x_m, y_m, z_m, t, a = sort([x_m, y_m, z_m, t, a]) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a) tmp = 0.0 if (z_m <= 0.0085) tmp = Float64(Float64(z_m * y_m) / Float64(Float64(-0.5 * Float64(1.0 / Float64(Float64(z_m / t) * Float64(x_m / a)))) + Float64(z_m / x_m))); else tmp = Float64(y_m * x_m); end return Float64(z_s * Float64(y_s * Float64(x_s * tmp))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y_m, z_m, t, a = num2cell(sort([x_m, y_m, z_m, t, a])){:}
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
tmp = 0.0;
if (z_m <= 0.0085)
tmp = (z_m * y_m) / ((-0.5 * (1.0 / ((z_m / t) * (x_m / a)))) + (z_m / x_m));
else
tmp = y_m * x_m;
end
tmp_2 = z_s * (y_s * (x_s * tmp));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_, t_, a_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[z$95$m, 0.0085], N[(N[(z$95$m * y$95$m), $MachinePrecision] / N[(N[(-0.5 * N[(1.0 / N[(N[(z$95$m / t), $MachinePrecision] * N[(x$95$m / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z$95$m / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$95$m * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y_m, z_m, t, a] = \mathsf{sort}([x_m, y_m, z_m, t, a])\\
\\
z_s \cdot \left(y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 0.0085:\\
\;\;\;\;\frac{z_m \cdot y_m}{-0.5 \cdot \frac{1}{\frac{z_m}{t} \cdot \frac{x_m}{a}} + \frac{z_m}{x_m}}\\
\mathbf{else}:\\
\;\;\;\;y_m \cdot x_m\\
\end{array}\right)\right)
\end{array}
if z < 0.0085000000000000006Initial program 64.0%
associate-/l*64.4%
associate-*l/64.8%
*-commutative64.8%
associate-/l*61.7%
Simplified61.7%
associate-*r/60.5%
*-commutative60.5%
associate-*r*62.3%
associate-/l*62.6%
*-commutative62.6%
pow262.6%
Applied egg-rr62.6%
Taylor expanded in z around inf 24.0%
clear-num24.0%
inv-pow24.0%
*-commutative24.0%
*-commutative24.0%
times-frac25.1%
Applied egg-rr25.1%
unpow-125.1%
Simplified25.1%
if 0.0085000000000000006 < z Initial program 48.1%
associate-/l*50.7%
associate-*l/52.0%
*-commutative52.0%
associate-/l*48.1%
Simplified48.1%
Taylor expanded in z around inf 87.5%
Final simplification44.8%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
(FPCore (z_s y_s x_s x_m y_m z_m t a)
:precision binary64
(*
z_s
(*
y_s
(*
x_s
(if (<= z_m 0.0082)
(/ (* z_m y_m) (+ (/ z_m x_m) (* -0.5 (* (/ a z_m) (/ t x_m)))))
(* y_m x_m))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y_m && y_m < z_m && z_m < t && t < a);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 0.0082) {
tmp = (z_m * y_m) / ((z_m / x_m) + (-0.5 * ((a / z_m) * (t / x_m))));
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z_m <= 0.0082d0) then
tmp = (z_m * y_m) / ((z_m / x_m) + ((-0.5d0) * ((a / z_m) * (t / x_m))))
else
tmp = y_m * x_m
end if
code = z_s * (y_s * (x_s * tmp))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y_m && y_m < z_m && z_m < t && t < a;
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 0.0082) {
tmp = (z_m * y_m) / ((z_m / x_m) + (-0.5 * ((a / z_m) * (t / x_m))));
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y_m, z_m, t, a] = sort([x_m, y_m, z_m, t, a]) def code(z_s, y_s, x_s, x_m, y_m, z_m, t, a): tmp = 0 if z_m <= 0.0082: tmp = (z_m * y_m) / ((z_m / x_m) + (-0.5 * ((a / z_m) * (t / x_m)))) else: tmp = y_m * x_m return z_s * (y_s * (x_s * tmp))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) z_m = abs(z) z_s = copysign(1.0, z) x_m, y_m, z_m, t, a = sort([x_m, y_m, z_m, t, a]) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a) tmp = 0.0 if (z_m <= 0.0082) tmp = Float64(Float64(z_m * y_m) / Float64(Float64(z_m / x_m) + Float64(-0.5 * Float64(Float64(a / z_m) * Float64(t / x_m))))); else tmp = Float64(y_m * x_m); end return Float64(z_s * Float64(y_s * Float64(x_s * tmp))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y_m, z_m, t, a = num2cell(sort([x_m, y_m, z_m, t, a])){:}
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
tmp = 0.0;
if (z_m <= 0.0082)
tmp = (z_m * y_m) / ((z_m / x_m) + (-0.5 * ((a / z_m) * (t / x_m))));
else
tmp = y_m * x_m;
end
tmp_2 = z_s * (y_s * (x_s * tmp));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_, t_, a_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[z$95$m, 0.0082], N[(N[(z$95$m * y$95$m), $MachinePrecision] / N[(N[(z$95$m / x$95$m), $MachinePrecision] + N[(-0.5 * N[(N[(a / z$95$m), $MachinePrecision] * N[(t / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$95$m * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y_m, z_m, t, a] = \mathsf{sort}([x_m, y_m, z_m, t, a])\\
\\
z_s \cdot \left(y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 0.0082:\\
\;\;\;\;\frac{z_m \cdot y_m}{\frac{z_m}{x_m} + -0.5 \cdot \left(\frac{a}{z_m} \cdot \frac{t}{x_m}\right)}\\
\mathbf{else}:\\
\;\;\;\;y_m \cdot x_m\\
\end{array}\right)\right)
\end{array}
if z < 0.00820000000000000069Initial program 64.0%
associate-/l*64.4%
associate-*l/64.8%
*-commutative64.8%
associate-/l*61.7%
Simplified61.7%
associate-*r/60.5%
*-commutative60.5%
associate-*r*62.3%
associate-/l*62.6%
*-commutative62.6%
pow262.6%
Applied egg-rr62.6%
Taylor expanded in z around inf 24.0%
*-commutative24.0%
times-frac24.7%
Applied egg-rr24.7%
if 0.00820000000000000069 < z Initial program 48.1%
associate-/l*50.7%
associate-*l/52.0%
*-commutative52.0%
associate-/l*48.1%
Simplified48.1%
Taylor expanded in z around inf 87.5%
Final simplification44.6%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
(FPCore (z_s y_s x_s x_m y_m z_m t a)
:precision binary64
(*
z_s
(*
y_s
(*
x_s
(if (<= z_m 0.02)
(/ (* (* z_m y_m) x_m) (+ z_m (* -0.5 (* t (/ a z_m)))))
(* y_m x_m))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y_m && y_m < z_m && z_m < t && t < a);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 0.02) {
tmp = ((z_m * y_m) * x_m) / (z_m + (-0.5 * (t * (a / z_m))));
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z_m <= 0.02d0) then
tmp = ((z_m * y_m) * x_m) / (z_m + ((-0.5d0) * (t * (a / z_m))))
else
tmp = y_m * x_m
end if
code = z_s * (y_s * (x_s * tmp))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y_m && y_m < z_m && z_m < t && t < a;
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 0.02) {
tmp = ((z_m * y_m) * x_m) / (z_m + (-0.5 * (t * (a / z_m))));
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y_m, z_m, t, a] = sort([x_m, y_m, z_m, t, a]) def code(z_s, y_s, x_s, x_m, y_m, z_m, t, a): tmp = 0 if z_m <= 0.02: tmp = ((z_m * y_m) * x_m) / (z_m + (-0.5 * (t * (a / z_m)))) else: tmp = y_m * x_m return z_s * (y_s * (x_s * tmp))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) z_m = abs(z) z_s = copysign(1.0, z) x_m, y_m, z_m, t, a = sort([x_m, y_m, z_m, t, a]) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a) tmp = 0.0 if (z_m <= 0.02) tmp = Float64(Float64(Float64(z_m * y_m) * x_m) / Float64(z_m + Float64(-0.5 * Float64(t * Float64(a / z_m))))); else tmp = Float64(y_m * x_m); end return Float64(z_s * Float64(y_s * Float64(x_s * tmp))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y_m, z_m, t, a = num2cell(sort([x_m, y_m, z_m, t, a])){:}
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
tmp = 0.0;
if (z_m <= 0.02)
tmp = ((z_m * y_m) * x_m) / (z_m + (-0.5 * (t * (a / z_m))));
else
tmp = y_m * x_m;
end
tmp_2 = z_s * (y_s * (x_s * tmp));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_, t_, a_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[z$95$m, 0.02], N[(N[(N[(z$95$m * y$95$m), $MachinePrecision] * x$95$m), $MachinePrecision] / N[(z$95$m + N[(-0.5 * N[(t * N[(a / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$95$m * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y_m, z_m, t, a] = \mathsf{sort}([x_m, y_m, z_m, t, a])\\
\\
z_s \cdot \left(y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 0.02:\\
\;\;\;\;\frac{\left(z_m \cdot y_m\right) \cdot x_m}{z_m + -0.5 \cdot \left(t \cdot \frac{a}{z_m}\right)}\\
\mathbf{else}:\\
\;\;\;\;y_m \cdot x_m\\
\end{array}\right)\right)
\end{array}
if z < 0.0200000000000000004Initial program 64.0%
associate-*l*62.3%
Simplified62.3%
Taylor expanded in z around inf 26.3%
associate-*l/26.2%
Applied egg-rr26.2%
if 0.0200000000000000004 < z Initial program 48.1%
associate-/l*50.7%
associate-*l/52.0%
*-commutative52.0%
associate-/l*48.1%
Simplified48.1%
Taylor expanded in z around inf 87.5%
Final simplification45.6%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
(FPCore (z_s y_s x_s x_m y_m z_m t a)
:precision binary64
(*
z_s
(*
y_s
(*
x_s
(if (<= z_m 0.052)
(/ (* (* z_m y_m) x_m) (+ z_m (* -0.5 (/ a (/ z_m t)))))
(* y_m x_m))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y_m && y_m < z_m && z_m < t && t < a);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 0.052) {
tmp = ((z_m * y_m) * x_m) / (z_m + (-0.5 * (a / (z_m / t))));
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z_m <= 0.052d0) then
tmp = ((z_m * y_m) * x_m) / (z_m + ((-0.5d0) * (a / (z_m / t))))
else
tmp = y_m * x_m
end if
code = z_s * (y_s * (x_s * tmp))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y_m && y_m < z_m && z_m < t && t < a;
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 0.052) {
tmp = ((z_m * y_m) * x_m) / (z_m + (-0.5 * (a / (z_m / t))));
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y_m, z_m, t, a] = sort([x_m, y_m, z_m, t, a]) def code(z_s, y_s, x_s, x_m, y_m, z_m, t, a): tmp = 0 if z_m <= 0.052: tmp = ((z_m * y_m) * x_m) / (z_m + (-0.5 * (a / (z_m / t)))) else: tmp = y_m * x_m return z_s * (y_s * (x_s * tmp))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) z_m = abs(z) z_s = copysign(1.0, z) x_m, y_m, z_m, t, a = sort([x_m, y_m, z_m, t, a]) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a) tmp = 0.0 if (z_m <= 0.052) tmp = Float64(Float64(Float64(z_m * y_m) * x_m) / Float64(z_m + Float64(-0.5 * Float64(a / Float64(z_m / t))))); else tmp = Float64(y_m * x_m); end return Float64(z_s * Float64(y_s * Float64(x_s * tmp))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y_m, z_m, t, a = num2cell(sort([x_m, y_m, z_m, t, a])){:}
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
tmp = 0.0;
if (z_m <= 0.052)
tmp = ((z_m * y_m) * x_m) / (z_m + (-0.5 * (a / (z_m / t))));
else
tmp = y_m * x_m;
end
tmp_2 = z_s * (y_s * (x_s * tmp));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_, t_, a_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[z$95$m, 0.052], N[(N[(N[(z$95$m * y$95$m), $MachinePrecision] * x$95$m), $MachinePrecision] / N[(z$95$m + N[(-0.5 * N[(a / N[(z$95$m / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$95$m * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y_m, z_m, t, a] = \mathsf{sort}([x_m, y_m, z_m, t, a])\\
\\
z_s \cdot \left(y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 0.052:\\
\;\;\;\;\frac{\left(z_m \cdot y_m\right) \cdot x_m}{z_m + -0.5 \cdot \frac{a}{\frac{z_m}{t}}}\\
\mathbf{else}:\\
\;\;\;\;y_m \cdot x_m\\
\end{array}\right)\right)
\end{array}
if z < 0.0519999999999999976Initial program 64.0%
associate-*l*62.3%
Simplified62.3%
Taylor expanded in z around inf 26.3%
associate-/l*27.3%
Simplified26.3%
if 0.0519999999999999976 < z Initial program 48.1%
associate-/l*50.7%
associate-*l/52.0%
*-commutative52.0%
associate-/l*48.1%
Simplified48.1%
Taylor expanded in z around inf 87.5%
Final simplification45.6%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
(FPCore (z_s y_s x_s x_m y_m z_m t a)
:precision binary64
(*
z_s
(*
y_s
(*
x_s
(if (<= z_m 0.031)
(/ (* z_m y_m) (/ (+ z_m (* -0.5 (/ (* t a) z_m))) x_m))
(* y_m x_m))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y_m && y_m < z_m && z_m < t && t < a);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 0.031) {
tmp = (z_m * y_m) / ((z_m + (-0.5 * ((t * a) / z_m))) / x_m);
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z_m <= 0.031d0) then
tmp = (z_m * y_m) / ((z_m + ((-0.5d0) * ((t * a) / z_m))) / x_m)
else
tmp = y_m * x_m
end if
code = z_s * (y_s * (x_s * tmp))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y_m && y_m < z_m && z_m < t && t < a;
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 0.031) {
tmp = (z_m * y_m) / ((z_m + (-0.5 * ((t * a) / z_m))) / x_m);
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y_m, z_m, t, a] = sort([x_m, y_m, z_m, t, a]) def code(z_s, y_s, x_s, x_m, y_m, z_m, t, a): tmp = 0 if z_m <= 0.031: tmp = (z_m * y_m) / ((z_m + (-0.5 * ((t * a) / z_m))) / x_m) else: tmp = y_m * x_m return z_s * (y_s * (x_s * tmp))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) z_m = abs(z) z_s = copysign(1.0, z) x_m, y_m, z_m, t, a = sort([x_m, y_m, z_m, t, a]) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a) tmp = 0.0 if (z_m <= 0.031) tmp = Float64(Float64(z_m * y_m) / Float64(Float64(z_m + Float64(-0.5 * Float64(Float64(t * a) / z_m))) / x_m)); else tmp = Float64(y_m * x_m); end return Float64(z_s * Float64(y_s * Float64(x_s * tmp))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y_m, z_m, t, a = num2cell(sort([x_m, y_m, z_m, t, a])){:}
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
tmp = 0.0;
if (z_m <= 0.031)
tmp = (z_m * y_m) / ((z_m + (-0.5 * ((t * a) / z_m))) / x_m);
else
tmp = y_m * x_m;
end
tmp_2 = z_s * (y_s * (x_s * tmp));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_, t_, a_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[z$95$m, 0.031], N[(N[(z$95$m * y$95$m), $MachinePrecision] / N[(N[(z$95$m + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision], N[(y$95$m * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y_m, z_m, t, a] = \mathsf{sort}([x_m, y_m, z_m, t, a])\\
\\
z_s \cdot \left(y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 0.031:\\
\;\;\;\;\frac{z_m \cdot y_m}{\frac{z_m + -0.5 \cdot \frac{t \cdot a}{z_m}}{x_m}}\\
\mathbf{else}:\\
\;\;\;\;y_m \cdot x_m\\
\end{array}\right)\right)
\end{array}
if z < 0.031Initial program 64.0%
associate-/l*64.4%
associate-*l/64.8%
*-commutative64.8%
associate-/l*61.7%
Simplified61.7%
associate-*r/60.5%
*-commutative60.5%
associate-*r*62.3%
associate-/l*62.6%
*-commutative62.6%
pow262.6%
Applied egg-rr62.6%
Taylor expanded in z around inf 26.3%
if 0.031 < z Initial program 48.1%
associate-/l*50.7%
associate-*l/52.0%
*-commutative52.0%
associate-/l*48.1%
Simplified48.1%
Taylor expanded in z around inf 87.5%
Final simplification45.6%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) y_m = (fabs.f64 y) y_s = (copysign.f64 1 y) z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function. (FPCore (z_s y_s x_s x_m y_m z_m t a) :precision binary64 (* z_s (* y_s (* x_s (* y_m (/ (* z_m x_m) (+ z_m (* -0.5 (* t (/ a z_m))))))))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y_m && y_m < z_m && z_m < t && t < a);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
return z_s * (y_s * (x_s * (y_m * ((z_m * x_m) / (z_m + (-0.5 * (t * (a / z_m))))))));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
code = z_s * (y_s * (x_s * (y_m * ((z_m * x_m) / (z_m + ((-0.5d0) * (t * (a / z_m))))))))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y_m && y_m < z_m && z_m < t && t < a;
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
return z_s * (y_s * (x_s * (y_m * ((z_m * x_m) / (z_m + (-0.5 * (t * (a / z_m))))))));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y_m, z_m, t, a] = sort([x_m, y_m, z_m, t, a]) def code(z_s, y_s, x_s, x_m, y_m, z_m, t, a): return z_s * (y_s * (x_s * (y_m * ((z_m * x_m) / (z_m + (-0.5 * (t * (a / z_m))))))))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) z_m = abs(z) z_s = copysign(1.0, z) x_m, y_m, z_m, t, a = sort([x_m, y_m, z_m, t, a]) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a) return Float64(z_s * Float64(y_s * Float64(x_s * Float64(y_m * Float64(Float64(z_m * x_m) / Float64(z_m + Float64(-0.5 * Float64(t * Float64(a / z_m))))))))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y_m, z_m, t, a = num2cell(sort([x_m, y_m, z_m, t, a])){:}
function tmp = code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
tmp = z_s * (y_s * (x_s * (y_m * ((z_m * x_m) / (z_m + (-0.5 * (t * (a / z_m))))))));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_, t_, a_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * N[(y$95$m * N[(N[(z$95$m * x$95$m), $MachinePrecision] / N[(z$95$m + N[(-0.5 * N[(t * N[(a / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y_m, z_m, t, a] = \mathsf{sort}([x_m, y_m, z_m, t, a])\\
\\
z_s \cdot \left(y_s \cdot \left(x_s \cdot \left(y_m \cdot \frac{z_m \cdot x_m}{z_m + -0.5 \cdot \left(t \cdot \frac{a}{z_m}\right)}\right)\right)\right)
\end{array}
Initial program 59.0%
associate-/l*60.1%
associate-*l/60.7%
*-commutative60.7%
associate-/l*57.4%
Simplified57.4%
Taylor expanded in z around inf 40.9%
associate-/l*42.9%
Simplified42.9%
associate-/r/42.8%
Applied egg-rr42.8%
Final simplification42.8%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) y_m = (fabs.f64 y) y_s = (copysign.f64 1 y) z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function. (FPCore (z_s y_s x_s x_m y_m z_m t a) :precision binary64 (* z_s (* y_s (* x_s (* y_m (/ (* z_m x_m) (+ z_m (* -0.5 (/ a (/ z_m t))))))))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y_m && y_m < z_m && z_m < t && t < a);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
return z_s * (y_s * (x_s * (y_m * ((z_m * x_m) / (z_m + (-0.5 * (a / (z_m / t))))))));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
code = z_s * (y_s * (x_s * (y_m * ((z_m * x_m) / (z_m + ((-0.5d0) * (a / (z_m / t))))))))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y_m && y_m < z_m && z_m < t && t < a;
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
return z_s * (y_s * (x_s * (y_m * ((z_m * x_m) / (z_m + (-0.5 * (a / (z_m / t))))))));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y_m, z_m, t, a] = sort([x_m, y_m, z_m, t, a]) def code(z_s, y_s, x_s, x_m, y_m, z_m, t, a): return z_s * (y_s * (x_s * (y_m * ((z_m * x_m) / (z_m + (-0.5 * (a / (z_m / t))))))))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) z_m = abs(z) z_s = copysign(1.0, z) x_m, y_m, z_m, t, a = sort([x_m, y_m, z_m, t, a]) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a) return Float64(z_s * Float64(y_s * Float64(x_s * Float64(y_m * Float64(Float64(z_m * x_m) / Float64(z_m + Float64(-0.5 * Float64(a / Float64(z_m / t))))))))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y_m, z_m, t, a = num2cell(sort([x_m, y_m, z_m, t, a])){:}
function tmp = code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
tmp = z_s * (y_s * (x_s * (y_m * ((z_m * x_m) / (z_m + (-0.5 * (a / (z_m / t))))))));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_, t_, a_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * N[(y$95$m * N[(N[(z$95$m * x$95$m), $MachinePrecision] / N[(z$95$m + N[(-0.5 * N[(a / N[(z$95$m / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y_m, z_m, t, a] = \mathsf{sort}([x_m, y_m, z_m, t, a])\\
\\
z_s \cdot \left(y_s \cdot \left(x_s \cdot \left(y_m \cdot \frac{z_m \cdot x_m}{z_m + -0.5 \cdot \frac{a}{\frac{z_m}{t}}}\right)\right)\right)
\end{array}
Initial program 59.0%
associate-/l*60.1%
associate-*l/60.7%
*-commutative60.7%
associate-/l*57.4%
Simplified57.4%
Taylor expanded in z around inf 40.9%
associate-/l*42.9%
Simplified42.9%
Final simplification42.9%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
(FPCore (z_s y_s x_s x_m y_m z_m t a)
:precision binary64
(*
z_s
(*
y_s
(*
x_s
(if (<= z_m 1e-189) (* y_m (/ 1.0 (/ z_m (* z_m x_m)))) (* y_m x_m))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y_m && y_m < z_m && z_m < t && t < a);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 1e-189) {
tmp = y_m * (1.0 / (z_m / (z_m * x_m)));
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z_m <= 1d-189) then
tmp = y_m * (1.0d0 / (z_m / (z_m * x_m)))
else
tmp = y_m * x_m
end if
code = z_s * (y_s * (x_s * tmp))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y_m && y_m < z_m && z_m < t && t < a;
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 1e-189) {
tmp = y_m * (1.0 / (z_m / (z_m * x_m)));
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y_m, z_m, t, a] = sort([x_m, y_m, z_m, t, a]) def code(z_s, y_s, x_s, x_m, y_m, z_m, t, a): tmp = 0 if z_m <= 1e-189: tmp = y_m * (1.0 / (z_m / (z_m * x_m))) else: tmp = y_m * x_m return z_s * (y_s * (x_s * tmp))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) z_m = abs(z) z_s = copysign(1.0, z) x_m, y_m, z_m, t, a = sort([x_m, y_m, z_m, t, a]) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a) tmp = 0.0 if (z_m <= 1e-189) tmp = Float64(y_m * Float64(1.0 / Float64(z_m / Float64(z_m * x_m)))); else tmp = Float64(y_m * x_m); end return Float64(z_s * Float64(y_s * Float64(x_s * tmp))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y_m, z_m, t, a = num2cell(sort([x_m, y_m, z_m, t, a])){:}
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
tmp = 0.0;
if (z_m <= 1e-189)
tmp = y_m * (1.0 / (z_m / (z_m * x_m)));
else
tmp = y_m * x_m;
end
tmp_2 = z_s * (y_s * (x_s * tmp));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_, t_, a_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[z$95$m, 1e-189], N[(y$95$m * N[(1.0 / N[(z$95$m / N[(z$95$m * x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$95$m * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y_m, z_m, t, a] = \mathsf{sort}([x_m, y_m, z_m, t, a])\\
\\
z_s \cdot \left(y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 10^{-189}:\\
\;\;\;\;y_m \cdot \frac{1}{\frac{z_m}{z_m \cdot x_m}}\\
\mathbf{else}:\\
\;\;\;\;y_m \cdot x_m\\
\end{array}\right)\right)
\end{array}
if z < 1.00000000000000007e-189Initial program 60.6%
associate-*l*58.7%
*-commutative58.7%
associate-*l*56.4%
*-commutative56.4%
associate-/l*56.4%
Simplified56.4%
Taylor expanded in z around inf 18.7%
div-inv18.7%
*-commutative18.7%
Applied egg-rr18.7%
if 1.00000000000000007e-189 < z Initial program 56.9%
associate-/l*59.2%
associate-*l/62.3%
*-commutative62.3%
associate-/l*58.6%
Simplified58.6%
Taylor expanded in z around inf 75.0%
Final simplification43.3%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) y_m = (fabs.f64 y) y_s = (copysign.f64 1 y) z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function. (FPCore (z_s y_s x_s x_m y_m z_m t a) :precision binary64 (* z_s (* y_s (* x_s (if (<= z_m 5.6e-190) (/ y_m (/ z_m (* z_m x_m))) (* y_m x_m))))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y_m && y_m < z_m && z_m < t && t < a);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 5.6e-190) {
tmp = y_m / (z_m / (z_m * x_m));
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z_m <= 5.6d-190) then
tmp = y_m / (z_m / (z_m * x_m))
else
tmp = y_m * x_m
end if
code = z_s * (y_s * (x_s * tmp))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y_m && y_m < z_m && z_m < t && t < a;
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
double tmp;
if (z_m <= 5.6e-190) {
tmp = y_m / (z_m / (z_m * x_m));
} else {
tmp = y_m * x_m;
}
return z_s * (y_s * (x_s * tmp));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y_m, z_m, t, a] = sort([x_m, y_m, z_m, t, a]) def code(z_s, y_s, x_s, x_m, y_m, z_m, t, a): tmp = 0 if z_m <= 5.6e-190: tmp = y_m / (z_m / (z_m * x_m)) else: tmp = y_m * x_m return z_s * (y_s * (x_s * tmp))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) z_m = abs(z) z_s = copysign(1.0, z) x_m, y_m, z_m, t, a = sort([x_m, y_m, z_m, t, a]) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a) tmp = 0.0 if (z_m <= 5.6e-190) tmp = Float64(y_m / Float64(z_m / Float64(z_m * x_m))); else tmp = Float64(y_m * x_m); end return Float64(z_s * Float64(y_s * Float64(x_s * tmp))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y_m, z_m, t, a = num2cell(sort([x_m, y_m, z_m, t, a])){:}
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
tmp = 0.0;
if (z_m <= 5.6e-190)
tmp = y_m / (z_m / (z_m * x_m));
else
tmp = y_m * x_m;
end
tmp_2 = z_s * (y_s * (x_s * tmp));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_, t_, a_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[z$95$m, 5.6e-190], N[(y$95$m / N[(z$95$m / N[(z$95$m * x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$95$m * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y_m, z_m, t, a] = \mathsf{sort}([x_m, y_m, z_m, t, a])\\
\\
z_s \cdot \left(y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 5.6 \cdot 10^{-190}:\\
\;\;\;\;\frac{y_m}{\frac{z_m}{z_m \cdot x_m}}\\
\mathbf{else}:\\
\;\;\;\;y_m \cdot x_m\\
\end{array}\right)\right)
\end{array}
if z < 5.60000000000000011e-190Initial program 60.6%
associate-*l*58.7%
*-commutative58.7%
associate-*l*56.4%
*-commutative56.4%
associate-/l*56.4%
Simplified56.4%
Taylor expanded in z around inf 18.7%
if 5.60000000000000011e-190 < z Initial program 56.9%
associate-/l*59.2%
associate-*l/62.3%
*-commutative62.3%
associate-/l*58.6%
Simplified58.6%
Taylor expanded in z around inf 75.0%
Final simplification43.3%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) y_m = (fabs.f64 y) y_s = (copysign.f64 1 y) z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function. (FPCore (z_s y_s x_s x_m y_m z_m t a) :precision binary64 (* z_s (* y_s (* x_s (* y_m x_m)))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y_m && y_m < z_m && z_m < t && t < a);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
return z_s * (y_s * (x_s * (y_m * x_m)));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
code = z_s * (y_s * (x_s * (y_m * x_m)))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y_m && y_m < z_m && z_m < t && t < a;
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
return z_s * (y_s * (x_s * (y_m * x_m)));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y_m, z_m, t, a] = sort([x_m, y_m, z_m, t, a]) def code(z_s, y_s, x_s, x_m, y_m, z_m, t, a): return z_s * (y_s * (x_s * (y_m * x_m)))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) z_m = abs(z) z_s = copysign(1.0, z) x_m, y_m, z_m, t, a = sort([x_m, y_m, z_m, t, a]) function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a) return Float64(z_s * Float64(y_s * Float64(x_s * Float64(y_m * x_m)))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y_m, z_m, t, a = num2cell(sort([x_m, y_m, z_m, t, a])){:}
function tmp = code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
tmp = z_s * (y_s * (x_s * (y_m * x_m)));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_, t_, a_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * N[(y$95$m * x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y_m, z_m, t, a] = \mathsf{sort}([x_m, y_m, z_m, t, a])\\
\\
z_s \cdot \left(y_s \cdot \left(x_s \cdot \left(y_m \cdot x_m\right)\right)\right)
\end{array}
Initial program 59.0%
associate-/l*60.1%
associate-*l/60.7%
*-commutative60.7%
associate-/l*57.4%
Simplified57.4%
Taylor expanded in z around inf 41.7%
Final simplification41.7%
(FPCore (x y z t a)
:precision binary64
(if (< z -3.1921305903852764e+46)
(- (* y x))
(if (< z 5.976268120920894e+90)
(/ (* x z) (/ (sqrt (- (* z z) (* a t))) y))
(* y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z < -3.1921305903852764e+46) {
tmp = -(y * x);
} else if (z < 5.976268120920894e+90) {
tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y);
} else {
tmp = y * x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z < (-3.1921305903852764d+46)) then
tmp = -(y * x)
else if (z < 5.976268120920894d+90) then
tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y)
else
tmp = y * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z < -3.1921305903852764e+46) {
tmp = -(y * x);
} else if (z < 5.976268120920894e+90) {
tmp = (x * z) / (Math.sqrt(((z * z) - (a * t))) / y);
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z < -3.1921305903852764e+46: tmp = -(y * x) elif z < 5.976268120920894e+90: tmp = (x * z) / (math.sqrt(((z * z) - (a * t))) / y) else: tmp = y * x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z < -3.1921305903852764e+46) tmp = Float64(-Float64(y * x)); elseif (z < 5.976268120920894e+90) tmp = Float64(Float64(x * z) / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / y)); else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z < -3.1921305903852764e+46) tmp = -(y * x); elseif (z < 5.976268120920894e+90) tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y); else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Less[z, -3.1921305903852764e+46], (-N[(y * x), $MachinePrecision]), If[Less[z, 5.976268120920894e+90], N[(N[(x * z), $MachinePrecision] / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z < -3.1921305903852764 \cdot 10^{+46}:\\
\;\;\;\;-y \cdot x\\
\mathbf{elif}\;z < 5.976268120920894 \cdot 10^{+90}:\\
\;\;\;\;\frac{x \cdot z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
herbie shell --seed 2024019
(FPCore (x y z t a)
:name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(if (< z -3.1921305903852764e+46) (- (* y x)) (if (< z 5.976268120920894e+90) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x)))
(/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))