
(FPCore (x y z) :precision binary64 (/ (* x (- y z)) y))
double code(double x, double y, double z) {
return (x * (y - z)) / y;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * (y - z)) / y
end function
public static double code(double x, double y, double z) {
return (x * (y - z)) / y;
}
def code(x, y, z): return (x * (y - z)) / y
function code(x, y, z) return Float64(Float64(x * Float64(y - z)) / y) end
function tmp = code(x, y, z) tmp = (x * (y - z)) / y; end
code[x_, y_, z_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* x (- y z)) y))
double code(double x, double y, double z) {
return (x * (y - z)) / y;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * (y - z)) / y
end function
public static double code(double x, double y, double z) {
return (x * (y - z)) / y;
}
def code(x, y, z): return (x * (y - z)) / y
function code(x, y, z) return Float64(Float64(x * Float64(y - z)) / y) end
function tmp = code(x, y, z) tmp = (x * (y - z)) / y; end
code[x_, y_, z_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{y}
\end{array}
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z) :precision binary64 (* x_s (if (<= x_m 2.15e+88) (- x_m (/ (* x_m z) y)) (- x_m (/ x_m (/ y z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if (x_m <= 2.15e+88) {
tmp = x_m - ((x_m * z) / y);
} else {
tmp = x_m - (x_m / (y / z));
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x_m <= 2.15d+88) then
tmp = x_m - ((x_m * z) / y)
else
tmp = x_m - (x_m / (y / z))
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if (x_m <= 2.15e+88) {
tmp = x_m - ((x_m * z) / y);
} else {
tmp = x_m - (x_m / (y / z));
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if x_m <= 2.15e+88: tmp = x_m - ((x_m * z) / y) else: tmp = x_m - (x_m / (y / z)) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if (x_m <= 2.15e+88) tmp = Float64(x_m - Float64(Float64(x_m * z) / y)); else tmp = Float64(x_m - Float64(x_m / Float64(y / z))); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if (x_m <= 2.15e+88) tmp = x_m - ((x_m * z) / y); else tmp = x_m - (x_m / (y / z)); end tmp_2 = 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]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[x$95$m, 2.15e+88], N[(x$95$m - N[(N[(x$95$m * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x$95$m - N[(x$95$m / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 2.15 \cdot 10^{+88}:\\
\;\;\;\;x\_m - \frac{x\_m \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;x\_m - \frac{x\_m}{\frac{y}{z}}\\
\end{array}
\end{array}
if x < 2.14999999999999987e88Initial program 91.0%
remove-double-neg91.0%
distribute-frac-neg291.0%
distribute-frac-neg91.0%
distribute-rgt-neg-in91.0%
associate-/l*90.7%
distribute-frac-neg90.7%
distribute-frac-neg290.7%
remove-double-neg90.7%
div-sub90.7%
*-inverses90.7%
Simplified90.7%
Taylor expanded in z around 0 96.1%
associate-*r/96.1%
associate-*r*96.1%
mul-1-neg96.1%
Simplified96.1%
if 2.14999999999999987e88 < x Initial program 69.2%
remove-double-neg69.2%
distribute-frac-neg269.2%
distribute-frac-neg69.2%
distribute-rgt-neg-in69.2%
associate-/l*99.9%
distribute-frac-neg99.9%
distribute-frac-neg299.9%
remove-double-neg99.9%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
Taylor expanded in z around 0 85.5%
associate-*r/85.5%
associate-*r*85.5%
mul-1-neg85.5%
Simplified85.5%
frac-2neg85.5%
div-inv85.5%
add-sqr-sqrt40.8%
sqrt-unprod51.2%
sqr-neg51.2%
sqrt-unprod19.1%
add-sqr-sqrt36.5%
cancel-sign-sub-inv36.5%
div-inv36.5%
associate-/l*47.9%
add-sqr-sqrt0.0%
sqrt-unprod61.0%
sqr-neg61.0%
sqrt-unprod99.8%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Final simplification96.9%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z)
:precision binary64
(*
x_s
(if (<= y -82000000000000.0)
x_m
(if (<= y 1.8e+63) (/ (* x_m (- z)) y) x_m))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if (y <= -82000000000000.0) {
tmp = x_m;
} else if (y <= 1.8e+63) {
tmp = (x_m * -z) / y;
} else {
tmp = x_m;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-82000000000000.0d0)) then
tmp = x_m
else if (y <= 1.8d+63) then
tmp = (x_m * -z) / y
else
tmp = x_m
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if (y <= -82000000000000.0) {
tmp = x_m;
} else if (y <= 1.8e+63) {
tmp = (x_m * -z) / y;
} else {
tmp = x_m;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if y <= -82000000000000.0: tmp = x_m elif y <= 1.8e+63: tmp = (x_m * -z) / y else: tmp = x_m return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if (y <= -82000000000000.0) tmp = x_m; elseif (y <= 1.8e+63) tmp = Float64(Float64(x_m * Float64(-z)) / y); else tmp = x_m; end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if (y <= -82000000000000.0) tmp = x_m; elseif (y <= 1.8e+63) tmp = (x_m * -z) / y; else tmp = x_m; end tmp_2 = 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]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[y, -82000000000000.0], x$95$m, If[LessEqual[y, 1.8e+63], N[(N[(x$95$m * (-z)), $MachinePrecision] / y), $MachinePrecision], x$95$m]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -82000000000000:\\
\;\;\;\;x\_m\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+63}:\\
\;\;\;\;\frac{x\_m \cdot \left(-z\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if y < -8.2e13 or 1.79999999999999999e63 < y Initial program 75.2%
remove-double-neg75.2%
distribute-frac-neg275.2%
distribute-frac-neg75.2%
distribute-rgt-neg-in75.2%
associate-/l*99.9%
distribute-frac-neg99.9%
distribute-frac-neg299.9%
remove-double-neg99.9%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
Taylor expanded in z around 0 81.3%
if -8.2e13 < y < 1.79999999999999999e63Initial program 95.2%
remove-double-neg95.2%
distribute-frac-neg295.2%
distribute-frac-neg95.2%
distribute-rgt-neg-in95.2%
associate-/l*86.9%
distribute-frac-neg86.9%
distribute-frac-neg286.9%
remove-double-neg86.9%
div-sub86.9%
*-inverses86.9%
Simplified86.9%
Taylor expanded in z around inf 74.6%
associate-*r/74.6%
associate-*r*74.6%
mul-1-neg74.6%
Simplified74.6%
Final simplification77.5%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z) :precision binary64 (* x_s (if (<= y -2.6e+18) x_m (if (<= y 2.4e+62) (/ z (/ y (- x_m))) x_m))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if (y <= -2.6e+18) {
tmp = x_m;
} else if (y <= 2.4e+62) {
tmp = z / (y / -x_m);
} else {
tmp = x_m;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-2.6d+18)) then
tmp = x_m
else if (y <= 2.4d+62) then
tmp = z / (y / -x_m)
else
tmp = x_m
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if (y <= -2.6e+18) {
tmp = x_m;
} else if (y <= 2.4e+62) {
tmp = z / (y / -x_m);
} else {
tmp = x_m;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if y <= -2.6e+18: tmp = x_m elif y <= 2.4e+62: tmp = z / (y / -x_m) else: tmp = x_m return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if (y <= -2.6e+18) tmp = x_m; elseif (y <= 2.4e+62) tmp = Float64(z / Float64(y / Float64(-x_m))); else tmp = x_m; end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if (y <= -2.6e+18) tmp = x_m; elseif (y <= 2.4e+62) tmp = z / (y / -x_m); else tmp = x_m; end tmp_2 = 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]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[y, -2.6e+18], x$95$m, If[LessEqual[y, 2.4e+62], N[(z / N[(y / (-x$95$m)), $MachinePrecision]), $MachinePrecision], x$95$m]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+18}:\\
\;\;\;\;x\_m\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+62}:\\
\;\;\;\;\frac{z}{\frac{y}{-x\_m}}\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if y < -2.6e18 or 2.4e62 < y Initial program 75.2%
remove-double-neg75.2%
distribute-frac-neg275.2%
distribute-frac-neg75.2%
distribute-rgt-neg-in75.2%
associate-/l*99.9%
distribute-frac-neg99.9%
distribute-frac-neg299.9%
remove-double-neg99.9%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
Taylor expanded in z around 0 81.3%
if -2.6e18 < y < 2.4e62Initial program 95.2%
remove-double-neg95.2%
distribute-frac-neg295.2%
distribute-frac-neg95.2%
distribute-rgt-neg-in95.2%
associate-/l*86.9%
distribute-frac-neg86.9%
distribute-frac-neg286.9%
remove-double-neg86.9%
div-sub86.9%
*-inverses86.9%
Simplified86.9%
Taylor expanded in z around inf 74.6%
mul-1-neg74.6%
distribute-frac-neg274.6%
*-commutative74.6%
associate-/l*72.0%
Simplified72.0%
clear-num72.0%
un-div-inv72.6%
add-sqr-sqrt33.5%
sqrt-unprod24.7%
sqr-neg24.7%
sqrt-unprod0.9%
add-sqr-sqrt1.7%
Applied egg-rr1.7%
add-sqr-sqrt0.9%
sqrt-unprod24.7%
sqr-neg24.7%
sqrt-unprod33.5%
add-sqr-sqrt72.6%
distribute-neg-frac72.6%
neg-sub065.6%
Applied egg-rr65.6%
neg-sub072.6%
distribute-neg-frac72.6%
Simplified72.6%
Final simplification76.4%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z) :precision binary64 (* x_s (if (<= y -2.65e+17) x_m (if (<= y 2e+62) (* z (/ (- x_m) y)) x_m))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if (y <= -2.65e+17) {
tmp = x_m;
} else if (y <= 2e+62) {
tmp = z * (-x_m / y);
} else {
tmp = x_m;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-2.65d+17)) then
tmp = x_m
else if (y <= 2d+62) then
tmp = z * (-x_m / y)
else
tmp = x_m
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if (y <= -2.65e+17) {
tmp = x_m;
} else if (y <= 2e+62) {
tmp = z * (-x_m / y);
} else {
tmp = x_m;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if y <= -2.65e+17: tmp = x_m elif y <= 2e+62: tmp = z * (-x_m / y) else: tmp = x_m return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if (y <= -2.65e+17) tmp = x_m; elseif (y <= 2e+62) tmp = Float64(z * Float64(Float64(-x_m) / y)); else tmp = x_m; end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if (y <= -2.65e+17) tmp = x_m; elseif (y <= 2e+62) tmp = z * (-x_m / y); else tmp = x_m; end tmp_2 = 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]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[y, -2.65e+17], x$95$m, If[LessEqual[y, 2e+62], N[(z * N[((-x$95$m) / y), $MachinePrecision]), $MachinePrecision], x$95$m]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.65 \cdot 10^{+17}:\\
\;\;\;\;x\_m\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+62}:\\
\;\;\;\;z \cdot \frac{-x\_m}{y}\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if y < -2.65e17 or 2.00000000000000007e62 < y Initial program 75.2%
remove-double-neg75.2%
distribute-frac-neg275.2%
distribute-frac-neg75.2%
distribute-rgt-neg-in75.2%
associate-/l*99.9%
distribute-frac-neg99.9%
distribute-frac-neg299.9%
remove-double-neg99.9%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
Taylor expanded in z around 0 81.3%
if -2.65e17 < y < 2.00000000000000007e62Initial program 95.2%
remove-double-neg95.2%
distribute-frac-neg295.2%
distribute-frac-neg95.2%
distribute-rgt-neg-in95.2%
associate-/l*86.9%
distribute-frac-neg86.9%
distribute-frac-neg286.9%
remove-double-neg86.9%
div-sub86.9%
*-inverses86.9%
Simplified86.9%
Taylor expanded in z around inf 74.6%
mul-1-neg74.6%
distribute-frac-neg274.6%
*-commutative74.6%
associate-/l*72.0%
Simplified72.0%
Final simplification76.1%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z) :precision binary64 (* x_s (if (<= y -2.65e+15) x_m (if (<= y 3e+63) (* x_m (/ z (- y))) x_m))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if (y <= -2.65e+15) {
tmp = x_m;
} else if (y <= 3e+63) {
tmp = x_m * (z / -y);
} else {
tmp = x_m;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-2.65d+15)) then
tmp = x_m
else if (y <= 3d+63) then
tmp = x_m * (z / -y)
else
tmp = x_m
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if (y <= -2.65e+15) {
tmp = x_m;
} else if (y <= 3e+63) {
tmp = x_m * (z / -y);
} else {
tmp = x_m;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if y <= -2.65e+15: tmp = x_m elif y <= 3e+63: tmp = x_m * (z / -y) else: tmp = x_m return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if (y <= -2.65e+15) tmp = x_m; elseif (y <= 3e+63) tmp = Float64(x_m * Float64(z / Float64(-y))); else tmp = x_m; end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if (y <= -2.65e+15) tmp = x_m; elseif (y <= 3e+63) tmp = x_m * (z / -y); else tmp = x_m; end tmp_2 = 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]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[y, -2.65e+15], x$95$m, If[LessEqual[y, 3e+63], N[(x$95$m * N[(z / (-y)), $MachinePrecision]), $MachinePrecision], x$95$m]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.65 \cdot 10^{+15}:\\
\;\;\;\;x\_m\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+63}:\\
\;\;\;\;x\_m \cdot \frac{z}{-y}\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if y < -2.65e15 or 2.99999999999999999e63 < y Initial program 75.2%
remove-double-neg75.2%
distribute-frac-neg275.2%
distribute-frac-neg75.2%
distribute-rgt-neg-in75.2%
associate-/l*99.9%
distribute-frac-neg99.9%
distribute-frac-neg299.9%
remove-double-neg99.9%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
Taylor expanded in z around 0 81.3%
if -2.65e15 < y < 2.99999999999999999e63Initial program 95.2%
remove-double-neg95.2%
distribute-frac-neg295.2%
distribute-frac-neg95.2%
distribute-rgt-neg-in95.2%
associate-/l*86.9%
distribute-frac-neg86.9%
distribute-frac-neg286.9%
remove-double-neg86.9%
div-sub86.9%
*-inverses86.9%
Simplified86.9%
Taylor expanded in z around inf 74.6%
mul-1-neg74.6%
distribute-frac-neg274.6%
associate-*r/65.0%
Simplified65.0%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z) :precision binary64 (* x_s (if (<= x_m 2e-59) (/ (* x_m (- y z)) y) (- x_m (/ x_m (/ y z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if (x_m <= 2e-59) {
tmp = (x_m * (y - z)) / y;
} else {
tmp = x_m - (x_m / (y / z));
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x_m <= 2d-59) then
tmp = (x_m * (y - z)) / y
else
tmp = x_m - (x_m / (y / z))
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if (x_m <= 2e-59) {
tmp = (x_m * (y - z)) / y;
} else {
tmp = x_m - (x_m / (y / z));
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if x_m <= 2e-59: tmp = (x_m * (y - z)) / y else: tmp = x_m - (x_m / (y / z)) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if (x_m <= 2e-59) tmp = Float64(Float64(x_m * Float64(y - z)) / y); else tmp = Float64(x_m - Float64(x_m / Float64(y / z))); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if (x_m <= 2e-59) tmp = (x_m * (y - z)) / y; else tmp = x_m - (x_m / (y / z)); end tmp_2 = 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]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[x$95$m, 2e-59], N[(N[(x$95$m * N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x$95$m - N[(x$95$m / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 2 \cdot 10^{-59}:\\
\;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;x\_m - \frac{x\_m}{\frac{y}{z}}\\
\end{array}
\end{array}
if x < 2.0000000000000001e-59Initial program 90.5%
if 2.0000000000000001e-59 < x Initial program 78.3%
remove-double-neg78.3%
distribute-frac-neg278.3%
distribute-frac-neg78.3%
distribute-rgt-neg-in78.3%
associate-/l*99.9%
distribute-frac-neg99.9%
distribute-frac-neg299.9%
remove-double-neg99.9%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
Taylor expanded in z around 0 90.9%
associate-*r/90.9%
associate-*r*90.9%
mul-1-neg90.9%
Simplified90.9%
frac-2neg90.9%
div-inv90.8%
add-sqr-sqrt42.3%
sqrt-unprod56.4%
sqr-neg56.4%
sqrt-unprod20.5%
add-sqr-sqrt40.8%
cancel-sign-sub-inv40.8%
div-inv40.8%
associate-/l*47.9%
add-sqr-sqrt0.0%
sqrt-unprod75.5%
sqr-neg75.5%
sqrt-unprod99.8%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z) :precision binary64 (* x_s (if (<= z 1.35e+97) (- x_m (/ x_m (/ y z))) (/ z (/ y (- x_m))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if (z <= 1.35e+97) {
tmp = x_m - (x_m / (y / z));
} else {
tmp = z / (y / -x_m);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= 1.35d+97) then
tmp = x_m - (x_m / (y / z))
else
tmp = z / (y / -x_m)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if (z <= 1.35e+97) {
tmp = x_m - (x_m / (y / z));
} else {
tmp = z / (y / -x_m);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if z <= 1.35e+97: tmp = x_m - (x_m / (y / z)) else: tmp = z / (y / -x_m) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if (z <= 1.35e+97) tmp = Float64(x_m - Float64(x_m / Float64(y / z))); else tmp = Float64(z / Float64(y / Float64(-x_m))); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if (z <= 1.35e+97) tmp = x_m - (x_m / (y / z)); else tmp = z / (y / -x_m); end tmp_2 = 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]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[z, 1.35e+97], N[(x$95$m - N[(x$95$m / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / N[(y / (-x$95$m)), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 1.35 \cdot 10^{+97}:\\
\;\;\;\;x\_m - \frac{x\_m}{\frac{y}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{y}{-x\_m}}\\
\end{array}
\end{array}
if z < 1.34999999999999997e97Initial program 85.8%
remove-double-neg85.8%
distribute-frac-neg285.8%
distribute-frac-neg85.8%
distribute-rgt-neg-in85.8%
associate-/l*95.5%
distribute-frac-neg95.5%
distribute-frac-neg295.5%
remove-double-neg95.5%
div-sub95.5%
*-inverses95.5%
Simplified95.5%
Taylor expanded in z around 0 94.7%
associate-*r/94.7%
associate-*r*94.7%
mul-1-neg94.7%
Simplified94.7%
frac-2neg94.7%
div-inv94.6%
add-sqr-sqrt43.3%
sqrt-unprod61.4%
sqr-neg61.4%
sqrt-unprod27.3%
add-sqr-sqrt52.2%
cancel-sign-sub-inv52.2%
div-inv52.2%
associate-/l*54.4%
add-sqr-sqrt25.1%
sqrt-unprod55.1%
sqr-neg55.1%
sqrt-unprod48.4%
add-sqr-sqrt95.5%
Applied egg-rr95.5%
clear-num95.5%
un-div-inv95.6%
Applied egg-rr95.6%
if 1.34999999999999997e97 < z Initial program 90.6%
remove-double-neg90.6%
distribute-frac-neg290.6%
distribute-frac-neg90.6%
distribute-rgt-neg-in90.6%
associate-/l*77.1%
distribute-frac-neg77.1%
distribute-frac-neg277.1%
remove-double-neg77.1%
div-sub77.1%
*-inverses77.1%
Simplified77.1%
Taylor expanded in z around inf 86.0%
mul-1-neg86.0%
distribute-frac-neg286.0%
*-commutative86.0%
associate-/l*88.4%
Simplified88.4%
clear-num88.3%
un-div-inv88.4%
add-sqr-sqrt44.3%
sqrt-unprod37.5%
sqr-neg37.5%
sqrt-unprod0.5%
add-sqr-sqrt1.0%
Applied egg-rr1.0%
add-sqr-sqrt0.5%
sqrt-unprod37.5%
sqr-neg37.5%
sqrt-unprod44.3%
add-sqr-sqrt88.4%
distribute-neg-frac88.4%
neg-sub086.0%
Applied egg-rr86.0%
neg-sub088.4%
distribute-neg-frac88.4%
Simplified88.4%
Final simplification94.5%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z) :precision binary64 (* x_s (if (<= z 1.35e+97) (- x_m (* x_m (/ z y))) (/ z (/ y (- x_m))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if (z <= 1.35e+97) {
tmp = x_m - (x_m * (z / y));
} else {
tmp = z / (y / -x_m);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= 1.35d+97) then
tmp = x_m - (x_m * (z / y))
else
tmp = z / (y / -x_m)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if (z <= 1.35e+97) {
tmp = x_m - (x_m * (z / y));
} else {
tmp = z / (y / -x_m);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if z <= 1.35e+97: tmp = x_m - (x_m * (z / y)) else: tmp = z / (y / -x_m) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if (z <= 1.35e+97) tmp = Float64(x_m - Float64(x_m * Float64(z / y))); else tmp = Float64(z / Float64(y / Float64(-x_m))); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if (z <= 1.35e+97) tmp = x_m - (x_m * (z / y)); else tmp = z / (y / -x_m); end tmp_2 = 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]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[z, 1.35e+97], N[(x$95$m - N[(x$95$m * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / N[(y / (-x$95$m)), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 1.35 \cdot 10^{+97}:\\
\;\;\;\;x\_m - x\_m \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{y}{-x\_m}}\\
\end{array}
\end{array}
if z < 1.34999999999999997e97Initial program 85.8%
remove-double-neg85.8%
distribute-frac-neg285.8%
distribute-frac-neg85.8%
distribute-rgt-neg-in85.8%
associate-/l*95.5%
distribute-frac-neg95.5%
distribute-frac-neg295.5%
remove-double-neg95.5%
div-sub95.5%
*-inverses95.5%
Simplified95.5%
Taylor expanded in z around 0 94.7%
associate-*r/94.7%
associate-*r*94.7%
mul-1-neg94.7%
Simplified94.7%
frac-2neg94.7%
div-inv94.6%
add-sqr-sqrt43.3%
sqrt-unprod61.4%
sqr-neg61.4%
sqrt-unprod27.3%
add-sqr-sqrt52.2%
cancel-sign-sub-inv52.2%
div-inv52.2%
associate-/l*54.4%
add-sqr-sqrt25.1%
sqrt-unprod55.1%
sqr-neg55.1%
sqrt-unprod48.4%
add-sqr-sqrt95.5%
Applied egg-rr95.5%
if 1.34999999999999997e97 < z Initial program 90.6%
remove-double-neg90.6%
distribute-frac-neg290.6%
distribute-frac-neg90.6%
distribute-rgt-neg-in90.6%
associate-/l*77.1%
distribute-frac-neg77.1%
distribute-frac-neg277.1%
remove-double-neg77.1%
div-sub77.1%
*-inverses77.1%
Simplified77.1%
Taylor expanded in z around inf 86.0%
mul-1-neg86.0%
distribute-frac-neg286.0%
*-commutative86.0%
associate-/l*88.4%
Simplified88.4%
clear-num88.3%
un-div-inv88.4%
add-sqr-sqrt44.3%
sqrt-unprod37.5%
sqr-neg37.5%
sqrt-unprod0.5%
add-sqr-sqrt1.0%
Applied egg-rr1.0%
add-sqr-sqrt0.5%
sqrt-unprod37.5%
sqr-neg37.5%
sqrt-unprod44.3%
add-sqr-sqrt88.4%
distribute-neg-frac88.4%
neg-sub086.0%
Applied egg-rr86.0%
neg-sub088.4%
distribute-neg-frac88.4%
Simplified88.4%
Final simplification94.4%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z) :precision binary64 (* x_s (if (<= z 1.25e+97) (* x_m (- 1.0 (/ z y))) (/ z (/ y (- x_m))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if (z <= 1.25e+97) {
tmp = x_m * (1.0 - (z / y));
} else {
tmp = z / (y / -x_m);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= 1.25d+97) then
tmp = x_m * (1.0d0 - (z / y))
else
tmp = z / (y / -x_m)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if (z <= 1.25e+97) {
tmp = x_m * (1.0 - (z / y));
} else {
tmp = z / (y / -x_m);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if z <= 1.25e+97: tmp = x_m * (1.0 - (z / y)) else: tmp = z / (y / -x_m) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if (z <= 1.25e+97) tmp = Float64(x_m * Float64(1.0 - Float64(z / y))); else tmp = Float64(z / Float64(y / Float64(-x_m))); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if (z <= 1.25e+97) tmp = x_m * (1.0 - (z / y)); else tmp = z / (y / -x_m); end tmp_2 = 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]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[z, 1.25e+97], N[(x$95$m * N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / N[(y / (-x$95$m)), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 1.25 \cdot 10^{+97}:\\
\;\;\;\;x\_m \cdot \left(1 - \frac{z}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{y}{-x\_m}}\\
\end{array}
\end{array}
if z < 1.25e97Initial program 85.8%
remove-double-neg85.8%
distribute-frac-neg285.8%
distribute-frac-neg85.8%
distribute-rgt-neg-in85.8%
associate-/l*95.5%
distribute-frac-neg95.5%
distribute-frac-neg295.5%
remove-double-neg95.5%
div-sub95.5%
*-inverses95.5%
Simplified95.5%
if 1.25e97 < z Initial program 90.6%
remove-double-neg90.6%
distribute-frac-neg290.6%
distribute-frac-neg90.6%
distribute-rgt-neg-in90.6%
associate-/l*77.1%
distribute-frac-neg77.1%
distribute-frac-neg277.1%
remove-double-neg77.1%
div-sub77.1%
*-inverses77.1%
Simplified77.1%
Taylor expanded in z around inf 86.0%
mul-1-neg86.0%
distribute-frac-neg286.0%
*-commutative86.0%
associate-/l*88.4%
Simplified88.4%
clear-num88.3%
un-div-inv88.4%
add-sqr-sqrt44.3%
sqrt-unprod37.5%
sqr-neg37.5%
sqrt-unprod0.5%
add-sqr-sqrt1.0%
Applied egg-rr1.0%
add-sqr-sqrt0.5%
sqrt-unprod37.5%
sqr-neg37.5%
sqrt-unprod44.3%
add-sqr-sqrt88.4%
distribute-neg-frac88.4%
neg-sub086.0%
Applied egg-rr86.0%
neg-sub088.4%
distribute-neg-frac88.4%
Simplified88.4%
Final simplification94.4%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z) :precision binary64 (* x_s (if (<= x_m 1.3e+124) x_m (* y (/ x_m y)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if (x_m <= 1.3e+124) {
tmp = x_m;
} else {
tmp = y * (x_m / y);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x_m <= 1.3d+124) then
tmp = x_m
else
tmp = y * (x_m / y)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if (x_m <= 1.3e+124) {
tmp = x_m;
} else {
tmp = y * (x_m / y);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if x_m <= 1.3e+124: tmp = x_m else: tmp = y * (x_m / y) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if (x_m <= 1.3e+124) tmp = x_m; else tmp = Float64(y * Float64(x_m / y)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if (x_m <= 1.3e+124) tmp = x_m; else tmp = y * (x_m / y); end tmp_2 = 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]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[x$95$m, 1.3e+124], x$95$m, N[(y * N[(x$95$m / y), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 1.3 \cdot 10^{+124}:\\
\;\;\;\;x\_m\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x\_m}{y}\\
\end{array}
\end{array}
if x < 1.3e124Initial program 90.9%
remove-double-neg90.9%
distribute-frac-neg290.9%
distribute-frac-neg90.9%
distribute-rgt-neg-in90.9%
associate-/l*91.1%
distribute-frac-neg91.1%
distribute-frac-neg291.1%
remove-double-neg91.1%
div-sub91.1%
*-inverses91.1%
Simplified91.1%
Taylor expanded in z around 0 48.9%
if 1.3e124 < x Initial program 65.0%
Taylor expanded in y around inf 19.9%
*-commutative19.9%
associate-/l*57.4%
Applied egg-rr57.4%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z) :precision binary64 (* x_s x_m))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
return x_s * x_m;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x_s * x_m
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
return x_s * x_m;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): return x_s * x_m
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z) return Float64(x_s * x_m) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m, y, z) tmp = x_s * 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]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * x$95$m), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot x\_m
\end{array}
Initial program 86.5%
remove-double-neg86.5%
distribute-frac-neg286.5%
distribute-frac-neg86.5%
distribute-rgt-neg-in86.5%
associate-/l*92.6%
distribute-frac-neg92.6%
distribute-frac-neg292.6%
remove-double-neg92.6%
div-sub92.6%
*-inverses92.6%
Simplified92.6%
Taylor expanded in z around 0 48.9%
(FPCore (x y z) :precision binary64 (if (< z -2.060202331921739e+104) (- x (/ (* z x) y)) (if (< z 1.6939766013828526e+213) (/ x (/ y (- y z))) (* (- y z) (/ x y)))))
double code(double x, double y, double z) {
double tmp;
if (z < -2.060202331921739e+104) {
tmp = x - ((z * x) / y);
} else if (z < 1.6939766013828526e+213) {
tmp = x / (y / (y - z));
} else {
tmp = (y - z) * (x / y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z < (-2.060202331921739d+104)) then
tmp = x - ((z * x) / y)
else if (z < 1.6939766013828526d+213) then
tmp = x / (y / (y - z))
else
tmp = (y - z) * (x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z < -2.060202331921739e+104) {
tmp = x - ((z * x) / y);
} else if (z < 1.6939766013828526e+213) {
tmp = x / (y / (y - z));
} else {
tmp = (y - z) * (x / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z < -2.060202331921739e+104: tmp = x - ((z * x) / y) elif z < 1.6939766013828526e+213: tmp = x / (y / (y - z)) else: tmp = (y - z) * (x / y) return tmp
function code(x, y, z) tmp = 0.0 if (z < -2.060202331921739e+104) tmp = Float64(x - Float64(Float64(z * x) / y)); elseif (z < 1.6939766013828526e+213) tmp = Float64(x / Float64(y / Float64(y - z))); else tmp = Float64(Float64(y - z) * Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z < -2.060202331921739e+104) tmp = x - ((z * x) / y); elseif (z < 1.6939766013828526e+213) tmp = x / (y / (y - z)); else tmp = (y - z) * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Less[z, -2.060202331921739e+104], N[(x - N[(N[(z * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[Less[z, 1.6939766013828526e+213], N[(x / N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z < -2.060202331921739 \cdot 10^{+104}:\\
\;\;\;\;x - \frac{z \cdot x}{y}\\
\mathbf{elif}\;z < 1.6939766013828526 \cdot 10^{+213}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{y}\\
\end{array}
\end{array}
herbie shell --seed 2024172
(FPCore (x y z)
:name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"
:precision binary64
:alt
(! :herbie-platform default (if (< z -206020233192173900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- x (/ (* z x) y)) (if (< z 1693976601382852600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ x (/ y (- y z))) (* (- y z) (/ x y)))))
(/ (* x (- y z)) y))