
(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 12 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)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function.
(FPCore (z_s x_s x_m y z_m t a)
:precision binary64
(*
z_s
(*
x_s
(if (<= z_m 3.3e+75)
(* (* z_m (/ y (sqrt (- (pow z_m 2.0) (* t a))))) x_m)
(* y x_m)))))x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y && y < z_m && z_m < t && t < a);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
double tmp;
if (z_m <= 3.3e+75) {
tmp = (z_m * (y / sqrt((pow(z_m, 2.0) - (t * a))))) * x_m;
} else {
tmp = y * x_m;
}
return z_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, x_s, x_m, y, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z_m <= 3.3d+75) then
tmp = (z_m * (y / sqrt(((z_m ** 2.0d0) - (t * a))))) * x_m
else
tmp = y * x_m
end if
code = z_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y && y < z_m && z_m < t && t < a;
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
double tmp;
if (z_m <= 3.3e+75) {
tmp = (z_m * (y / Math.sqrt((Math.pow(z_m, 2.0) - (t * a))))) * x_m;
} else {
tmp = y * x_m;
}
return z_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y, z_m, t, a] = sort([x_m, y, z_m, t, a]) def code(z_s, x_s, x_m, y, z_m, t, a): tmp = 0 if z_m <= 3.3e+75: tmp = (z_m * (y / math.sqrt((math.pow(z_m, 2.0) - (t * a))))) * x_m else: tmp = y * x_m return z_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) x_m, y, z_m, t, a = sort([x_m, y, z_m, t, a]) function code(z_s, x_s, x_m, y, z_m, t, a) tmp = 0.0 if (z_m <= 3.3e+75) tmp = Float64(Float64(z_m * Float64(y / sqrt(Float64((z_m ^ 2.0) - Float64(t * a))))) * x_m); else tmp = Float64(y * x_m); end return Float64(z_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y, z_m, t, a = num2cell(sort([x_m, y, z_m, t, a])){:}
function tmp_2 = code(z_s, x_s, x_m, y, z_m, t, a)
tmp = 0.0;
if (z_m <= 3.3e+75)
tmp = (z_m * (y / sqrt(((z_m ^ 2.0) - (t * a))))) * x_m;
else
tmp = y * x_m;
end
tmp_2 = z_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]
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, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_, a_] := N[(z$95$s * N[(x$95$s * If[LessEqual[z$95$m, 3.3e+75], N[(N[(z$95$m * N[(y / N[Sqrt[N[(N[Power[z$95$m, 2.0], $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision], N[(y * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y, z_m, t, a] = \mathsf{sort}([x_m, y, z_m, t, a])\\
\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 3.3 \cdot 10^{+75}:\\
\;\;\;\;\left(z\_m \cdot \frac{y}{\sqrt{{z\_m}^{2} - t \cdot a}}\right) \cdot x\_m\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\_m\\
\end{array}\right)
\end{array}
if z < 3.29999999999999998e75Initial program 64.7%
associate-*l*64.8%
*-commutative64.8%
associate-*l*64.4%
*-commutative64.4%
associate-/l*65.0%
Simplified65.0%
associate-/r/64.0%
*-commutative64.0%
associate-*r*64.5%
pow264.5%
Applied egg-rr64.5%
if 3.29999999999999998e75 < z Initial program 43.8%
associate-/l*49.0%
associate-*l/49.1%
*-commutative49.1%
associate-/l*44.0%
Simplified44.0%
Taylor expanded in z around inf 100.0%
Final simplification72.6%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function.
(FPCore (z_s x_s x_m y z_m t a)
:precision binary64
(*
z_s
(*
x_s
(if (<= z_m 5.1e-102)
(/ (* x_m (* z_m y)) (sqrt (* t (- a))))
(if (<= z_m 2.9e+76)
(* y (/ (* z_m x_m) (sqrt (- (* z_m z_m) (* t a)))))
(* y x_m))))))x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y && y < z_m && z_m < t && t < a);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
double tmp;
if (z_m <= 5.1e-102) {
tmp = (x_m * (z_m * y)) / sqrt((t * -a));
} else if (z_m <= 2.9e+76) {
tmp = y * ((z_m * x_m) / sqrt(((z_m * z_m) - (t * a))));
} else {
tmp = y * x_m;
}
return z_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, x_s, x_m, y, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z_m <= 5.1d-102) then
tmp = (x_m * (z_m * y)) / sqrt((t * -a))
else if (z_m <= 2.9d+76) then
tmp = y * ((z_m * x_m) / sqrt(((z_m * z_m) - (t * a))))
else
tmp = y * x_m
end if
code = z_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y && y < z_m && z_m < t && t < a;
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
double tmp;
if (z_m <= 5.1e-102) {
tmp = (x_m * (z_m * y)) / Math.sqrt((t * -a));
} else if (z_m <= 2.9e+76) {
tmp = y * ((z_m * x_m) / Math.sqrt(((z_m * z_m) - (t * a))));
} else {
tmp = y * x_m;
}
return z_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y, z_m, t, a] = sort([x_m, y, z_m, t, a]) def code(z_s, x_s, x_m, y, z_m, t, a): tmp = 0 if z_m <= 5.1e-102: tmp = (x_m * (z_m * y)) / math.sqrt((t * -a)) elif z_m <= 2.9e+76: tmp = y * ((z_m * x_m) / math.sqrt(((z_m * z_m) - (t * a)))) else: tmp = y * x_m return z_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) x_m, y, z_m, t, a = sort([x_m, y, z_m, t, a]) function code(z_s, x_s, x_m, y, z_m, t, a) tmp = 0.0 if (z_m <= 5.1e-102) tmp = Float64(Float64(x_m * Float64(z_m * y)) / sqrt(Float64(t * Float64(-a)))); elseif (z_m <= 2.9e+76) tmp = Float64(y * Float64(Float64(z_m * x_m) / sqrt(Float64(Float64(z_m * z_m) - Float64(t * a))))); else tmp = Float64(y * x_m); end return Float64(z_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y, z_m, t, a = num2cell(sort([x_m, y, z_m, t, a])){:}
function tmp_2 = code(z_s, x_s, x_m, y, z_m, t, a)
tmp = 0.0;
if (z_m <= 5.1e-102)
tmp = (x_m * (z_m * y)) / sqrt((t * -a));
elseif (z_m <= 2.9e+76)
tmp = y * ((z_m * x_m) / sqrt(((z_m * z_m) - (t * a))));
else
tmp = y * x_m;
end
tmp_2 = z_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]
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, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_, a_] := N[(z$95$s * N[(x$95$s * If[LessEqual[z$95$m, 5.1e-102], N[(N[(x$95$m * N[(z$95$m * y), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[z$95$m, 2.9e+76], N[(y * 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 * x$95$m), $MachinePrecision]]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y, z_m, t, a] = \mathsf{sort}([x_m, y, z_m, t, a])\\
\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 5.1 \cdot 10^{-102}:\\
\;\;\;\;\frac{x\_m \cdot \left(z\_m \cdot y\right)}{\sqrt{t \cdot \left(-a\right)}}\\
\mathbf{elif}\;z\_m \leq 2.9 \cdot 10^{+76}:\\
\;\;\;\;y \cdot \frac{z\_m \cdot x\_m}{\sqrt{z\_m \cdot z\_m - t \cdot a}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\_m\\
\end{array}\right)
\end{array}
if z < 5.09999999999999999e-102Initial program 60.8%
associate-*l*60.4%
Simplified60.4%
Taylor expanded in z around 0 43.5%
mul-1-neg44.3%
*-commutative44.3%
distribute-rgt-neg-in44.3%
Simplified43.5%
if 5.09999999999999999e-102 < z < 2.9000000000000002e76Initial program 81.6%
associate-/l*84.1%
associate-*l/89.3%
*-commutative89.3%
associate-/l*84.3%
Simplified84.3%
if 2.9000000000000002e76 < z Initial program 43.8%
associate-/l*49.0%
associate-*l/49.1%
*-commutative49.1%
associate-/l*44.0%
Simplified44.0%
Taylor expanded in z around inf 100.0%
Final simplification62.2%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function.
(FPCore (z_s x_s x_m y z_m t a)
:precision binary64
(*
z_s
(*
x_s
(if (<= z_m 2.45e+35)
(/ (* x_m (* z_m y)) (sqrt (- (* z_m z_m) (* t a))))
(* y x_m)))))x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y && y < z_m && z_m < t && t < a);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
double tmp;
if (z_m <= 2.45e+35) {
tmp = (x_m * (z_m * y)) / sqrt(((z_m * z_m) - (t * a)));
} else {
tmp = y * x_m;
}
return z_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, x_s, x_m, y, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z_m <= 2.45d+35) then
tmp = (x_m * (z_m * y)) / sqrt(((z_m * z_m) - (t * a)))
else
tmp = y * x_m
end if
code = z_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y && y < z_m && z_m < t && t < a;
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
double tmp;
if (z_m <= 2.45e+35) {
tmp = (x_m * (z_m * y)) / Math.sqrt(((z_m * z_m) - (t * a)));
} else {
tmp = y * x_m;
}
return z_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y, z_m, t, a] = sort([x_m, y, z_m, t, a]) def code(z_s, x_s, x_m, y, z_m, t, a): tmp = 0 if z_m <= 2.45e+35: tmp = (x_m * (z_m * y)) / math.sqrt(((z_m * z_m) - (t * a))) else: tmp = y * x_m return z_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) x_m, y, z_m, t, a = sort([x_m, y, z_m, t, a]) function code(z_s, x_s, x_m, y, z_m, t, a) tmp = 0.0 if (z_m <= 2.45e+35) tmp = Float64(Float64(x_m * Float64(z_m * y)) / sqrt(Float64(Float64(z_m * z_m) - Float64(t * a)))); else tmp = Float64(y * x_m); end return Float64(z_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y, z_m, t, a = num2cell(sort([x_m, y, z_m, t, a])){:}
function tmp_2 = code(z_s, x_s, x_m, y, z_m, t, a)
tmp = 0.0;
if (z_m <= 2.45e+35)
tmp = (x_m * (z_m * y)) / sqrt(((z_m * z_m) - (t * a)));
else
tmp = y * x_m;
end
tmp_2 = z_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]
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, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_, a_] := N[(z$95$s * N[(x$95$s * If[LessEqual[z$95$m, 2.45e+35], N[(N[(x$95$m * N[(z$95$m * y), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[(z$95$m * z$95$m), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(y * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y, z_m, t, a] = \mathsf{sort}([x_m, y, z_m, t, a])\\
\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 2.45 \cdot 10^{+35}:\\
\;\;\;\;\frac{x\_m \cdot \left(z\_m \cdot y\right)}{\sqrt{z\_m \cdot z\_m - t \cdot a}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\_m\\
\end{array}\right)
\end{array}
if z < 2.45000000000000013e35Initial program 63.5%
associate-*l*63.6%
Simplified63.6%
if 2.45000000000000013e35 < z Initial program 50.7%
associate-/l*56.3%
associate-*l/56.4%
*-commutative56.4%
associate-/l*50.8%
Simplified50.8%
Taylor expanded in z around inf 97.2%
Final simplification72.8%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function. (FPCore (z_s x_s x_m y z_m t a) :precision binary64 (* z_s (* x_s (if (<= z_m 0.0085) (* y (/ (* z_m x_m) (sqrt (* t (- a))))) (* y x_m)))))
x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y && y < z_m && z_m < t && t < a);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
double tmp;
if (z_m <= 0.0085) {
tmp = y * ((z_m * x_m) / sqrt((t * -a)));
} else {
tmp = y * x_m;
}
return z_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, x_s, x_m, y, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
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 = y * ((z_m * x_m) / sqrt((t * -a)))
else
tmp = y * x_m
end if
code = z_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y && y < z_m && z_m < t && t < a;
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
double tmp;
if (z_m <= 0.0085) {
tmp = y * ((z_m * x_m) / Math.sqrt((t * -a)));
} else {
tmp = y * x_m;
}
return z_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y, z_m, t, a] = sort([x_m, y, z_m, t, a]) def code(z_s, x_s, x_m, y, z_m, t, a): tmp = 0 if z_m <= 0.0085: tmp = y * ((z_m * x_m) / math.sqrt((t * -a))) else: tmp = y * x_m return z_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) x_m, y, z_m, t, a = sort([x_m, y, z_m, t, a]) function code(z_s, x_s, x_m, y, z_m, t, a) tmp = 0.0 if (z_m <= 0.0085) tmp = Float64(y * Float64(Float64(z_m * x_m) / sqrt(Float64(t * Float64(-a))))); else tmp = Float64(y * x_m); end return Float64(z_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y, z_m, t, a = num2cell(sort([x_m, y, z_m, t, a])){:}
function tmp_2 = code(z_s, x_s, x_m, y, z_m, t, a)
tmp = 0.0;
if (z_m <= 0.0085)
tmp = y * ((z_m * x_m) / sqrt((t * -a)));
else
tmp = y * x_m;
end
tmp_2 = z_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]
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, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_, a_] := N[(z$95$s * N[(x$95$s * If[LessEqual[z$95$m, 0.0085], N[(y * N[(N[(z$95$m * x$95$m), $MachinePrecision] / N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y, z_m, t, a] = \mathsf{sort}([x_m, y, z_m, t, a])\\
\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 0.0085:\\
\;\;\;\;y \cdot \frac{z\_m \cdot x\_m}{\sqrt{t \cdot \left(-a\right)}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\_m\\
\end{array}\right)
\end{array}
if z < 0.0085000000000000006Initial program 63.0%
associate-/l*63.8%
associate-*l/65.9%
*-commutative65.9%
associate-/l*63.4%
Simplified63.4%
Taylor expanded in z around 0 45.1%
mul-1-neg45.1%
*-commutative45.1%
distribute-rgt-neg-in45.1%
Simplified45.1%
if 0.0085000000000000006 < z Initial program 52.7%
associate-/l*57.9%
associate-*l/58.1%
*-commutative58.1%
associate-/l*52.8%
Simplified52.8%
Taylor expanded in z around inf 94.9%
Final simplification59.7%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function. (FPCore (z_s x_s x_m y z_m t a) :precision binary64 (* z_s (* x_s (if (<= z_m 0.0085) (/ (* x_m (* z_m y)) (sqrt (* t (- a)))) (* y x_m)))))
x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y && y < z_m && z_m < t && t < a);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
double tmp;
if (z_m <= 0.0085) {
tmp = (x_m * (z_m * y)) / sqrt((t * -a));
} else {
tmp = y * x_m;
}
return z_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, x_s, x_m, y, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
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 = (x_m * (z_m * y)) / sqrt((t * -a))
else
tmp = y * x_m
end if
code = z_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y && y < z_m && z_m < t && t < a;
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
double tmp;
if (z_m <= 0.0085) {
tmp = (x_m * (z_m * y)) / Math.sqrt((t * -a));
} else {
tmp = y * x_m;
}
return z_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y, z_m, t, a] = sort([x_m, y, z_m, t, a]) def code(z_s, x_s, x_m, y, z_m, t, a): tmp = 0 if z_m <= 0.0085: tmp = (x_m * (z_m * y)) / math.sqrt((t * -a)) else: tmp = y * x_m return z_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) x_m, y, z_m, t, a = sort([x_m, y, z_m, t, a]) function code(z_s, x_s, x_m, y, z_m, t, a) tmp = 0.0 if (z_m <= 0.0085) tmp = Float64(Float64(x_m * Float64(z_m * y)) / sqrt(Float64(t * Float64(-a)))); else tmp = Float64(y * x_m); end return Float64(z_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y, z_m, t, a = num2cell(sort([x_m, y, z_m, t, a])){:}
function tmp_2 = code(z_s, x_s, x_m, y, z_m, t, a)
tmp = 0.0;
if (z_m <= 0.0085)
tmp = (x_m * (z_m * y)) / sqrt((t * -a));
else
tmp = y * x_m;
end
tmp_2 = z_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]
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, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_, a_] := N[(z$95$s * N[(x$95$s * If[LessEqual[z$95$m, 0.0085], N[(N[(x$95$m * N[(z$95$m * y), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(y * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y, z_m, t, a] = \mathsf{sort}([x_m, y, z_m, t, a])\\
\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 0.0085:\\
\;\;\;\;\frac{x\_m \cdot \left(z\_m \cdot y\right)}{\sqrt{t \cdot \left(-a\right)}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\_m\\
\end{array}\right)
\end{array}
if z < 0.0085000000000000006Initial program 63.0%
associate-*l*63.2%
Simplified63.2%
Taylor expanded in z around 0 43.9%
mul-1-neg45.1%
*-commutative45.1%
distribute-rgt-neg-in45.1%
Simplified43.9%
if 0.0085000000000000006 < z Initial program 52.7%
associate-/l*57.9%
associate-*l/58.1%
*-commutative58.1%
associate-/l*52.8%
Simplified52.8%
Taylor expanded in z around inf 94.9%
Final simplification58.8%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function.
(FPCore (z_s x_s x_m y z_m t a)
:precision binary64
(*
z_s
(*
x_s
(if (<= (* y x_m) 2e-64)
(* y (/ (* z_m x_m) (+ z_m (* -0.5 (* a (/ t z_m))))))
(* y x_m)))))x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y && y < z_m && z_m < t && t < a);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
double tmp;
if ((y * x_m) <= 2e-64) {
tmp = y * ((z_m * x_m) / (z_m + (-0.5 * (a * (t / z_m)))));
} else {
tmp = y * x_m;
}
return z_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, x_s, x_m, y, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y * x_m) <= 2d-64) then
tmp = y * ((z_m * x_m) / (z_m + ((-0.5d0) * (a * (t / z_m)))))
else
tmp = y * x_m
end if
code = z_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y && y < z_m && z_m < t && t < a;
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
double tmp;
if ((y * x_m) <= 2e-64) {
tmp = y * ((z_m * x_m) / (z_m + (-0.5 * (a * (t / z_m)))));
} else {
tmp = y * x_m;
}
return z_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y, z_m, t, a] = sort([x_m, y, z_m, t, a]) def code(z_s, x_s, x_m, y, z_m, t, a): tmp = 0 if (y * x_m) <= 2e-64: tmp = y * ((z_m * x_m) / (z_m + (-0.5 * (a * (t / z_m))))) else: tmp = y * x_m return z_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) x_m, y, z_m, t, a = sort([x_m, y, z_m, t, a]) function code(z_s, x_s, x_m, y, z_m, t, a) tmp = 0.0 if (Float64(y * x_m) <= 2e-64) tmp = Float64(y * Float64(Float64(z_m * x_m) / Float64(z_m + Float64(-0.5 * Float64(a * Float64(t / z_m)))))); else tmp = Float64(y * x_m); end return Float64(z_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y, z_m, t, a = num2cell(sort([x_m, y, z_m, t, a])){:}
function tmp_2 = code(z_s, x_s, x_m, y, z_m, t, a)
tmp = 0.0;
if ((y * x_m) <= 2e-64)
tmp = y * ((z_m * x_m) / (z_m + (-0.5 * (a * (t / z_m)))));
else
tmp = y * x_m;
end
tmp_2 = z_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]
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, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_, a_] := N[(z$95$s * N[(x$95$s * If[LessEqual[N[(y * x$95$m), $MachinePrecision], 2e-64], N[(y * N[(N[(z$95$m * x$95$m), $MachinePrecision] / N[(z$95$m + N[(-0.5 * N[(a * N[(t / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y, z_m, t, a] = \mathsf{sort}([x_m, y, z_m, t, a])\\
\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \cdot x\_m \leq 2 \cdot 10^{-64}:\\
\;\;\;\;y \cdot \frac{z\_m \cdot x\_m}{z\_m + -0.5 \cdot \left(a \cdot \frac{t}{z\_m}\right)}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\_m\\
\end{array}\right)
\end{array}
if (*.f64 x y) < 1.99999999999999993e-64Initial program 66.4%
associate-/l*68.3%
associate-*l/68.8%
*-commutative68.8%
associate-/l*64.7%
Simplified64.7%
Taylor expanded in z around inf 49.7%
associate-/l*50.3%
Simplified50.3%
clear-num50.3%
associate-/r/50.3%
clear-num50.3%
Applied egg-rr50.3%
if 1.99999999999999993e-64 < (*.f64 x y) Initial program 45.0%
associate-/l*47.7%
associate-*l/51.5%
*-commutative51.5%
associate-/l*50.0%
Simplified50.0%
Taylor expanded in z around inf 27.4%
Final simplification43.4%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function.
(FPCore (z_s x_s x_m y z_m t a)
:precision binary64
(*
z_s
(*
x_s
(if (<= z_m 9500000.0)
(/ (* x_m (* z_m y)) (+ z_m (* -0.5 (/ (* t a) z_m))))
(* y x_m)))))x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y && y < z_m && z_m < t && t < a);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
double tmp;
if (z_m <= 9500000.0) {
tmp = (x_m * (z_m * y)) / (z_m + (-0.5 * ((t * a) / z_m)));
} else {
tmp = y * x_m;
}
return z_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, x_s, x_m, y, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z_m <= 9500000.0d0) then
tmp = (x_m * (z_m * y)) / (z_m + ((-0.5d0) * ((t * a) / z_m)))
else
tmp = y * x_m
end if
code = z_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y && y < z_m && z_m < t && t < a;
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
double tmp;
if (z_m <= 9500000.0) {
tmp = (x_m * (z_m * y)) / (z_m + (-0.5 * ((t * a) / z_m)));
} else {
tmp = y * x_m;
}
return z_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y, z_m, t, a] = sort([x_m, y, z_m, t, a]) def code(z_s, x_s, x_m, y, z_m, t, a): tmp = 0 if z_m <= 9500000.0: tmp = (x_m * (z_m * y)) / (z_m + (-0.5 * ((t * a) / z_m))) else: tmp = y * x_m return z_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) x_m, y, z_m, t, a = sort([x_m, y, z_m, t, a]) function code(z_s, x_s, x_m, y, z_m, t, a) tmp = 0.0 if (z_m <= 9500000.0) tmp = Float64(Float64(x_m * Float64(z_m * y)) / Float64(z_m + Float64(-0.5 * Float64(Float64(t * a) / z_m)))); else tmp = Float64(y * x_m); end return Float64(z_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y, z_m, t, a = num2cell(sort([x_m, y, z_m, t, a])){:}
function tmp_2 = code(z_s, x_s, x_m, y, z_m, t, a)
tmp = 0.0;
if (z_m <= 9500000.0)
tmp = (x_m * (z_m * y)) / (z_m + (-0.5 * ((t * a) / z_m)));
else
tmp = y * x_m;
end
tmp_2 = z_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]
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, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_, a_] := N[(z$95$s * N[(x$95$s * If[LessEqual[z$95$m, 9500000.0], N[(N[(x$95$m * N[(z$95$m * y), $MachinePrecision]), $MachinePrecision] / N[(z$95$m + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y, z_m, t, a] = \mathsf{sort}([x_m, y, z_m, t, a])\\
\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 9500000:\\
\;\;\;\;\frac{x\_m \cdot \left(z\_m \cdot y\right)}{z\_m + -0.5 \cdot \frac{t \cdot a}{z\_m}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\_m\\
\end{array}\right)
\end{array}
if z < 9.5e6Initial program 63.0%
associate-*l*63.2%
Simplified63.2%
Taylor expanded in z around inf 26.9%
if 9.5e6 < z Initial program 52.7%
associate-/l*57.9%
associate-*l/58.1%
*-commutative58.1%
associate-/l*52.8%
Simplified52.8%
Taylor expanded in z around inf 94.9%
Final simplification46.8%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function.
(FPCore (z_s x_s x_m y z_m t a)
:precision binary64
(*
z_s
(*
x_s
(if (<= z_m 15200000.0)
(/ (* z_m (* y x_m)) (+ z_m (* -0.5 (/ (* t a) z_m))))
(* y x_m)))))x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y && y < z_m && z_m < t && t < a);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
double tmp;
if (z_m <= 15200000.0) {
tmp = (z_m * (y * x_m)) / (z_m + (-0.5 * ((t * a) / z_m)));
} else {
tmp = y * x_m;
}
return z_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, x_s, x_m, y, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z_m <= 15200000.0d0) then
tmp = (z_m * (y * x_m)) / (z_m + ((-0.5d0) * ((t * a) / z_m)))
else
tmp = y * x_m
end if
code = z_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y && y < z_m && z_m < t && t < a;
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
double tmp;
if (z_m <= 15200000.0) {
tmp = (z_m * (y * x_m)) / (z_m + (-0.5 * ((t * a) / z_m)));
} else {
tmp = y * x_m;
}
return z_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y, z_m, t, a] = sort([x_m, y, z_m, t, a]) def code(z_s, x_s, x_m, y, z_m, t, a): tmp = 0 if z_m <= 15200000.0: tmp = (z_m * (y * x_m)) / (z_m + (-0.5 * ((t * a) / z_m))) else: tmp = y * x_m return z_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) x_m, y, z_m, t, a = sort([x_m, y, z_m, t, a]) function code(z_s, x_s, x_m, y, z_m, t, a) tmp = 0.0 if (z_m <= 15200000.0) tmp = Float64(Float64(z_m * Float64(y * x_m)) / Float64(z_m + Float64(-0.5 * Float64(Float64(t * a) / z_m)))); else tmp = Float64(y * x_m); end return Float64(z_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y, z_m, t, a = num2cell(sort([x_m, y, z_m, t, a])){:}
function tmp_2 = code(z_s, x_s, x_m, y, z_m, t, a)
tmp = 0.0;
if (z_m <= 15200000.0)
tmp = (z_m * (y * x_m)) / (z_m + (-0.5 * ((t * a) / z_m)));
else
tmp = y * x_m;
end
tmp_2 = z_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]
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, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_, a_] := N[(z$95$s * N[(x$95$s * If[LessEqual[z$95$m, 15200000.0], N[(N[(z$95$m * N[(y * x$95$m), $MachinePrecision]), $MachinePrecision] / N[(z$95$m + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y, z_m, t, a] = \mathsf{sort}([x_m, y, z_m, t, a])\\
\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 15200000:\\
\;\;\;\;\frac{z\_m \cdot \left(y \cdot x\_m\right)}{z\_m + -0.5 \cdot \frac{t \cdot a}{z\_m}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\_m\\
\end{array}\right)
\end{array}
if z < 1.52e7Initial program 63.0%
Taylor expanded in z around inf 27.4%
if 1.52e7 < z Initial program 52.7%
associate-/l*57.9%
associate-*l/58.1%
*-commutative58.1%
associate-/l*52.8%
Simplified52.8%
Taylor expanded in z around inf 94.9%
Final simplification47.2%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function. (FPCore (z_s x_s x_m y z_m t a) :precision binary64 (* z_s (* x_s (if (<= z_m 8.2e-105) (/ y (* z_m (/ 1.0 (* z_m x_m)))) (* y x_m)))))
x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y && y < z_m && z_m < t && t < a);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
double tmp;
if (z_m <= 8.2e-105) {
tmp = y / (z_m * (1.0 / (z_m * x_m)));
} else {
tmp = y * x_m;
}
return z_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, x_s, x_m, y, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z_m <= 8.2d-105) then
tmp = y / (z_m * (1.0d0 / (z_m * x_m)))
else
tmp = y * x_m
end if
code = z_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y && y < z_m && z_m < t && t < a;
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
double tmp;
if (z_m <= 8.2e-105) {
tmp = y / (z_m * (1.0 / (z_m * x_m)));
} else {
tmp = y * x_m;
}
return z_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y, z_m, t, a] = sort([x_m, y, z_m, t, a]) def code(z_s, x_s, x_m, y, z_m, t, a): tmp = 0 if z_m <= 8.2e-105: tmp = y / (z_m * (1.0 / (z_m * x_m))) else: tmp = y * x_m return z_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) x_m, y, z_m, t, a = sort([x_m, y, z_m, t, a]) function code(z_s, x_s, x_m, y, z_m, t, a) tmp = 0.0 if (z_m <= 8.2e-105) tmp = Float64(y / Float64(z_m * Float64(1.0 / Float64(z_m * x_m)))); else tmp = Float64(y * x_m); end return Float64(z_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y, z_m, t, a = num2cell(sort([x_m, y, z_m, t, a])){:}
function tmp_2 = code(z_s, x_s, x_m, y, z_m, t, a)
tmp = 0.0;
if (z_m <= 8.2e-105)
tmp = y / (z_m * (1.0 / (z_m * x_m)));
else
tmp = y * x_m;
end
tmp_2 = z_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]
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, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_, a_] := N[(z$95$s * N[(x$95$s * If[LessEqual[z$95$m, 8.2e-105], N[(y / N[(z$95$m * N[(1.0 / N[(z$95$m * x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y, z_m, t, a] = \mathsf{sort}([x_m, y, z_m, t, a])\\
\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 8.2 \cdot 10^{-105}:\\
\;\;\;\;\frac{y}{z\_m \cdot \frac{1}{z\_m \cdot x\_m}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\_m\\
\end{array}\right)
\end{array}
if z < 8.20000000000000061e-105Initial program 60.6%
associate-*l*60.2%
*-commutative60.2%
associate-*l*60.3%
*-commutative60.3%
associate-/l*60.4%
Simplified60.4%
Taylor expanded in z around inf 20.8%
div-inv20.8%
*-commutative20.8%
Applied egg-rr20.8%
if 8.20000000000000061e-105 < z Initial program 59.0%
associate-/l*63.1%
associate-*l/65.1%
*-commutative65.1%
associate-/l*60.1%
Simplified60.1%
Taylor expanded in z around inf 85.4%
Final simplification45.0%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function. (FPCore (z_s x_s x_m y z_m t a) :precision binary64 (* z_s (* x_s (if (<= z_m 1.15e-108) (* y (/ (* z_m x_m) z_m)) (* y x_m)))))
x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y && y < z_m && z_m < t && t < a);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
double tmp;
if (z_m <= 1.15e-108) {
tmp = y * ((z_m * x_m) / z_m);
} else {
tmp = y * x_m;
}
return z_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, x_s, x_m, y, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z_m <= 1.15d-108) then
tmp = y * ((z_m * x_m) / z_m)
else
tmp = y * x_m
end if
code = z_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y && y < z_m && z_m < t && t < a;
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
double tmp;
if (z_m <= 1.15e-108) {
tmp = y * ((z_m * x_m) / z_m);
} else {
tmp = y * x_m;
}
return z_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y, z_m, t, a] = sort([x_m, y, z_m, t, a]) def code(z_s, x_s, x_m, y, z_m, t, a): tmp = 0 if z_m <= 1.15e-108: tmp = y * ((z_m * x_m) / z_m) else: tmp = y * x_m return z_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) x_m, y, z_m, t, a = sort([x_m, y, z_m, t, a]) function code(z_s, x_s, x_m, y, z_m, t, a) tmp = 0.0 if (z_m <= 1.15e-108) tmp = Float64(y * Float64(Float64(z_m * x_m) / z_m)); else tmp = Float64(y * x_m); end return Float64(z_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y, z_m, t, a = num2cell(sort([x_m, y, z_m, t, a])){:}
function tmp_2 = code(z_s, x_s, x_m, y, z_m, t, a)
tmp = 0.0;
if (z_m <= 1.15e-108)
tmp = y * ((z_m * x_m) / z_m);
else
tmp = y * x_m;
end
tmp_2 = z_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]
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, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_, a_] := N[(z$95$s * N[(x$95$s * If[LessEqual[z$95$m, 1.15e-108], N[(y * N[(N[(z$95$m * x$95$m), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(y * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y, z_m, t, a] = \mathsf{sort}([x_m, y, z_m, t, a])\\
\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 1.15 \cdot 10^{-108}:\\
\;\;\;\;y \cdot \frac{z\_m \cdot x\_m}{z\_m}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\_m\\
\end{array}\right)
\end{array}
if z < 1.14999999999999998e-108Initial program 60.6%
associate-/l*61.5%
associate-*l/62.7%
*-commutative62.7%
associate-/l*60.4%
Simplified60.4%
Taylor expanded in z around inf 20.8%
if 1.14999999999999998e-108 < z Initial program 59.0%
associate-/l*63.1%
associate-*l/65.1%
*-commutative65.1%
associate-/l*60.1%
Simplified60.1%
Taylor expanded in z around inf 85.4%
Final simplification45.0%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function. (FPCore (z_s x_s x_m y z_m t a) :precision binary64 (* z_s (* x_s (/ y (* z_m (/ (/ 1.0 z_m) x_m))))))
x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y && y < z_m && z_m < t && t < a);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
return z_s * (x_s * (y / (z_m * ((1.0 / z_m) / x_m))));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, x_s, x_m, y, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
code = z_s * (x_s * (y / (z_m * ((1.0d0 / z_m) / x_m))))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y && y < z_m && z_m < t && t < a;
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
return z_s * (x_s * (y / (z_m * ((1.0 / z_m) / x_m))));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y, z_m, t, a] = sort([x_m, y, z_m, t, a]) def code(z_s, x_s, x_m, y, z_m, t, a): return z_s * (x_s * (y / (z_m * ((1.0 / z_m) / x_m))))
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) x_m, y, z_m, t, a = sort([x_m, y, z_m, t, a]) function code(z_s, x_s, x_m, y, z_m, t, a) return Float64(z_s * Float64(x_s * Float64(y / Float64(z_m * Float64(Float64(1.0 / z_m) / x_m))))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y, z_m, t, a = num2cell(sort([x_m, y, z_m, t, a])){:}
function tmp = code(z_s, x_s, x_m, y, z_m, t, a)
tmp = z_s * (x_s * (y / (z_m * ((1.0 / z_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]
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, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_, a_] := N[(z$95$s * N[(x$95$s * N[(y / N[(z$95$m * N[(N[(1.0 / z$95$m), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y, z_m, t, a] = \mathsf{sort}([x_m, y, z_m, t, a])\\
\\
z\_s \cdot \left(x\_s \cdot \frac{y}{z\_m \cdot \frac{\frac{1}{z\_m}}{x\_m}}\right)
\end{array}
Initial program 60.0%
associate-*l*58.9%
*-commutative58.9%
associate-*l*59.4%
*-commutative59.4%
associate-/l*60.2%
Simplified60.2%
Taylor expanded in z around inf 41.2%
div-inv41.2%
*-commutative41.2%
Applied egg-rr41.2%
*-un-lft-identity41.2%
associate-/r*41.3%
Applied egg-rr41.3%
Final simplification41.3%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function. (FPCore (z_s x_s x_m y z_m t a) :precision binary64 (* z_s (* x_s (* y x_m))))
x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
assert(x_m < y && y < z_m && z_m < t && t < a);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
return z_s * (x_s * (y * x_m));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
NOTE: x_m, y, z_m, t, and a should be sorted in increasing order before calling this function.
real(8) function code(z_s, x_s, x_m, y, z_m, t, a)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8), intent (in) :: a
code = z_s * (x_s * (y * x_m))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
assert x_m < y && y < z_m && z_m < t && t < a;
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t, double a) {
return z_s * (x_s * (y * x_m));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) [x_m, y, z_m, t, a] = sort([x_m, y, z_m, t, a]) def code(z_s, x_s, x_m, y, z_m, t, a): return z_s * (x_s * (y * x_m))
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) x_m, y, z_m, t, a = sort([x_m, y, z_m, t, a]) function code(z_s, x_s, x_m, y, z_m, t, a) return Float64(z_s * Float64(x_s * Float64(y * x_m))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
z_m = abs(z);
z_s = sign(z) * abs(1.0);
x_m, y, z_m, t, a = num2cell(sort([x_m, y, z_m, t, a])){:}
function tmp = code(z_s, x_s, x_m, y, z_m, t, a)
tmp = z_s * (x_s * (y * 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]
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, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_, a_] := N[(z$95$s * N[(x$95$s * N[(y * x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y, z_m, t, a] = \mathsf{sort}([x_m, y, z_m, t, a])\\
\\
z\_s \cdot \left(x\_s \cdot \left(y \cdot x\_m\right)\right)
\end{array}
Initial program 60.0%
associate-/l*62.1%
associate-*l/63.6%
*-commutative63.6%
associate-/l*60.3%
Simplified60.3%
Taylor expanded in z around inf 41.5%
Final simplification41.5%
(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 2024031
(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)))))