
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* y z))))
double code(double x, double y, double z) {
return x * (1.0 - (y * z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * (1.0d0 - (y * z))
end function
public static double code(double x, double y, double z) {
return x * (1.0 - (y * z));
}
def code(x, y, z): return x * (1.0 - (y * z))
function code(x, y, z) return Float64(x * Float64(1.0 - Float64(y * z))) end
function tmp = code(x, y, z) tmp = x * (1.0 - (y * z)); end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - y \cdot z\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* y z))))
double code(double x, double y, double z) {
return x * (1.0 - (y * z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * (1.0d0 - (y * z))
end function
public static double code(double x, double y, double z) {
return x * (1.0 - (y * z));
}
def code(x, y, z): return x * (1.0 - (y * z))
function code(x, y, z) return Float64(x * Float64(1.0 - Float64(y * z))) end
function tmp = code(x, y, z) tmp = x * (1.0 - (y * z)); end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - y \cdot z\right)
\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.22e-116) (- x_m (* y (* x_m z))) (* x_m (- 1.0 (* 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.22e-116) {
tmp = x_m - (y * (x_m * z));
} else {
tmp = x_m * (1.0 - (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.22d-116) then
tmp = x_m - (y * (x_m * z))
else
tmp = x_m * (1.0d0 - (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.22e-116) {
tmp = x_m - (y * (x_m * z));
} else {
tmp = x_m * (1.0 - (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.22e-116: tmp = x_m - (y * (x_m * z)) else: tmp = x_m * (1.0 - (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.22e-116) tmp = Float64(x_m - Float64(y * Float64(x_m * z))); else tmp = Float64(x_m * Float64(1.0 - 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.22e-116) tmp = x_m - (y * (x_m * z)); else tmp = x_m * (1.0 - (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.22e-116], N[(x$95$m - N[(y * N[(x$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(1.0 - 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.22 \cdot 10^{-116}:\\
\;\;\;\;x\_m - y \cdot \left(x\_m \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \left(1 - y \cdot z\right)\\
\end{array}
\end{array}
if x < 2.2200000000000001e-116Initial program 93.8%
Taylor expanded in z around inf 93.7%
Taylor expanded in z around 0 93.8%
mul-1-neg93.8%
associate-*r*93.6%
*-commutative93.6%
associate-*r*95.4%
distribute-rgt-neg-in95.4%
distribute-rgt-neg-in95.4%
Simplified95.4%
add-sqr-sqrt45.5%
sqrt-unprod59.9%
sqr-neg59.9%
sqrt-unprod26.0%
add-sqr-sqrt48.1%
cancel-sign-sub-inv48.1%
add-sqr-sqrt22.8%
sqrt-unprod66.6%
sqr-neg66.6%
sqrt-unprod51.3%
add-sqr-sqrt95.4%
Applied egg-rr95.4%
if 2.2200000000000001e-116 < x Initial program 99.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 (or (<= z -6.8e-55) (not (<= z 2.3e+38))) (* 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 ((z <= -6.8e-55) || !(z <= 2.3e+38)) {
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 ((z <= (-6.8d-55)) .or. (.not. (z <= 2.3d+38))) 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 ((z <= -6.8e-55) || !(z <= 2.3e+38)) {
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 (z <= -6.8e-55) or not (z <= 2.3e+38): 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 ((z <= -6.8e-55) || !(z <= 2.3e+38)) tmp = Float64(z * Float64(x_m * 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 ((z <= -6.8e-55) || ~((z <= 2.3e+38))) 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[Or[LessEqual[z, -6.8e-55], N[Not[LessEqual[z, 2.3e+38]], $MachinePrecision]], 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}\;z \leq -6.8 \cdot 10^{-55} \lor \neg \left(z \leq 2.3 \cdot 10^{+38}\right):\\
\;\;\;\;z \cdot \left(x\_m \cdot \left(-y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if z < -6.79999999999999946e-55 or 2.3000000000000001e38 < z Initial program 92.3%
Taylor expanded in z around inf 90.1%
Taylor expanded in y around inf 66.6%
mul-1-neg66.6%
*-commutative66.6%
distribute-rgt-neg-in66.6%
Simplified66.6%
if -6.79999999999999946e-55 < z < 2.3000000000000001e38Initial program 99.8%
Taylor expanded in y around 0 72.3%
Final simplification69.2%
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 (or (<= z -1.15e-122) (not (<= z 1.35e+38))) (* 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 ((z <= -1.15e-122) || !(z <= 1.35e+38)) {
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 ((z <= (-1.15d-122)) .or. (.not. (z <= 1.35d+38))) 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 ((z <= -1.15e-122) || !(z <= 1.35e+38)) {
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 (z <= -1.15e-122) or not (z <= 1.35e+38): 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 ((z <= -1.15e-122) || !(z <= 1.35e+38)) 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 ((z <= -1.15e-122) || ~((z <= 1.35e+38))) 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[Or[LessEqual[z, -1.15e-122], N[Not[LessEqual[z, 1.35e+38]], $MachinePrecision]], 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}\;z \leq -1.15 \cdot 10^{-122} \lor \neg \left(z \leq 1.35 \cdot 10^{+38}\right):\\
\;\;\;\;x\_m \cdot \left(z \cdot \left(-y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if z < -1.15000000000000003e-122 or 1.34999999999999998e38 < z Initial program 93.1%
Taylor expanded in y around inf 62.7%
mul-1-neg62.7%
distribute-rgt-neg-out62.7%
Simplified62.7%
if -1.15000000000000003e-122 < z < 1.34999999999999998e38Initial program 99.9%
Taylor expanded in y around 0 77.2%
Final simplification68.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.15e-122)
(* y (* z (- x_m)))
(if (<= z 1e+38) x_m (* z (* 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 (z <= -1.15e-122) {
tmp = y * (z * -x_m);
} else if (z <= 1e+38) {
tmp = x_m;
} else {
tmp = z * (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 (z <= (-1.15d-122)) then
tmp = y * (z * -x_m)
else if (z <= 1d+38) then
tmp = x_m
else
tmp = z * (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 (z <= -1.15e-122) {
tmp = y * (z * -x_m);
} else if (z <= 1e+38) {
tmp = x_m;
} else {
tmp = z * (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 z <= -1.15e-122: tmp = y * (z * -x_m) elif z <= 1e+38: tmp = x_m else: tmp = z * (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 (z <= -1.15e-122) tmp = Float64(y * Float64(z * Float64(-x_m))); elseif (z <= 1e+38) tmp = x_m; else tmp = Float64(z * Float64(x_m * Float64(-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 (z <= -1.15e-122) tmp = y * (z * -x_m); elseif (z <= 1e+38) tmp = x_m; else tmp = z * (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[z, -1.15e-122], N[(y * N[(z * (-x$95$m)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+38], x$95$m, N[(z * 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}\;z \leq -1.15 \cdot 10^{-122}:\\
\;\;\;\;y \cdot \left(z \cdot \left(-x\_m\right)\right)\\
\mathbf{elif}\;z \leq 10^{+38}:\\
\;\;\;\;x\_m\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x\_m \cdot \left(-y\right)\right)\\
\end{array}
\end{array}
if z < -1.15000000000000003e-122Initial program 94.7%
Taylor expanded in y around inf 54.1%
mul-1-neg54.1%
*-commutative54.1%
associate-*r*57.2%
distribute-rgt-neg-in57.2%
Simplified57.2%
if -1.15000000000000003e-122 < z < 9.99999999999999977e37Initial program 99.9%
Taylor expanded in y around 0 77.2%
if 9.99999999999999977e37 < z Initial program 91.0%
Taylor expanded in z around inf 86.4%
Taylor expanded in y around inf 76.5%
mul-1-neg76.5%
*-commutative76.5%
distribute-rgt-neg-in76.5%
Simplified76.5%
Final simplification70.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 (<= (* y z) 2e+172) (* x_m (- 1.0 (* y z))) (* z (* 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 ((y * z) <= 2e+172) {
tmp = x_m * (1.0 - (y * z));
} else {
tmp = z * (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 ((y * z) <= 2d+172) then
tmp = x_m * (1.0d0 - (y * z))
else
tmp = z * (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 ((y * z) <= 2e+172) {
tmp = x_m * (1.0 - (y * z));
} else {
tmp = z * (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 (y * z) <= 2e+172: tmp = x_m * (1.0 - (y * z)) else: tmp = z * (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 (Float64(y * z) <= 2e+172) tmp = Float64(x_m * Float64(1.0 - Float64(y * z))); else tmp = Float64(z * Float64(x_m * Float64(-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 ((y * z) <= 2e+172) tmp = x_m * (1.0 - (y * z)); else tmp = z * (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[N[(y * z), $MachinePrecision], 2e+172], N[(x$95$m * N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * 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}\;y \cdot z \leq 2 \cdot 10^{+172}:\\
\;\;\;\;x\_m \cdot \left(1 - y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x\_m \cdot \left(-y\right)\right)\\
\end{array}
\end{array}
if (*.f64 y z) < 2.0000000000000002e172Initial program 98.1%
if 2.0000000000000002e172 < (*.f64 y z) Initial program 78.5%
Taylor expanded in z around inf 96.7%
Taylor expanded in y around inf 96.7%
mul-1-neg96.7%
*-commutative96.7%
distribute-rgt-neg-in96.7%
Simplified96.7%
Final simplification98.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 (<= z 2.8e+40) x_m (/ (* x_m z) 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 (z <= 2.8e+40) {
tmp = x_m;
} else {
tmp = (x_m * z) / 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 (z <= 2.8d+40) then
tmp = x_m
else
tmp = (x_m * z) / 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 (z <= 2.8e+40) {
tmp = x_m;
} else {
tmp = (x_m * z) / 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 z <= 2.8e+40: tmp = x_m else: tmp = (x_m * z) / 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 (z <= 2.8e+40) tmp = x_m; else tmp = Float64(Float64(x_m * z) / 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 (z <= 2.8e+40) tmp = x_m; else tmp = (x_m * z) / 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[z, 2.8e+40], x$95$m, N[(N[(x$95$m * z), $MachinePrecision] / z), $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 2.8 \cdot 10^{+40}:\\
\;\;\;\;x\_m\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m \cdot z}{z}\\
\end{array}
\end{array}
if z < 2.8000000000000001e40Initial program 97.4%
Taylor expanded in y around 0 60.9%
if 2.8000000000000001e40 < z Initial program 91.0%
Taylor expanded in z around inf 86.4%
Taylor expanded in y around 0 12.9%
associate-*r/23.9%
*-commutative23.9%
Applied egg-rr23.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 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 95.7%
Taylor expanded in y around 0 49.9%
herbie shell --seed 2024191
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I"
:precision binary64
(* x (- 1.0 (* y z))))