
(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 6 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
(let* ((t_0 (* z (* x_m (- y)))))
(*
x_s
(if (<= (* y z) -50000000000000.0)
t_0
(if (<= (* y z) 5e-7)
x_m
(if (<= (* y z) 2e+172) (* x_m (* y (- z))) t_0))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double t_0 = z * (x_m * -y);
double tmp;
if ((y * z) <= -50000000000000.0) {
tmp = t_0;
} else if ((y * z) <= 5e-7) {
tmp = x_m;
} else if ((y * z) <= 2e+172) {
tmp = x_m * (y * -z);
} else {
tmp = t_0;
}
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) :: t_0
real(8) :: tmp
t_0 = z * (x_m * -y)
if ((y * z) <= (-50000000000000.0d0)) then
tmp = t_0
else if ((y * z) <= 5d-7) then
tmp = x_m
else if ((y * z) <= 2d+172) then
tmp = x_m * (y * -z)
else
tmp = t_0
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 t_0 = z * (x_m * -y);
double tmp;
if ((y * z) <= -50000000000000.0) {
tmp = t_0;
} else if ((y * z) <= 5e-7) {
tmp = x_m;
} else if ((y * z) <= 2e+172) {
tmp = x_m * (y * -z);
} else {
tmp = t_0;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): t_0 = z * (x_m * -y) tmp = 0 if (y * z) <= -50000000000000.0: tmp = t_0 elif (y * z) <= 5e-7: tmp = x_m elif (y * z) <= 2e+172: tmp = x_m * (y * -z) else: tmp = t_0 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z) t_0 = Float64(z * Float64(x_m * Float64(-y))) tmp = 0.0 if (Float64(y * z) <= -50000000000000.0) tmp = t_0; elseif (Float64(y * z) <= 5e-7) tmp = x_m; elseif (Float64(y * z) <= 2e+172) tmp = Float64(x_m * Float64(y * Float64(-z))); else tmp = t_0; 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) t_0 = z * (x_m * -y); tmp = 0.0; if ((y * z) <= -50000000000000.0) tmp = t_0; elseif ((y * z) <= 5e-7) tmp = x_m; elseif ((y * z) <= 2e+172) tmp = x_m * (y * -z); else tmp = t_0; 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_] := Block[{t$95$0 = N[(z * N[(x$95$m * (-y)), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[N[(y * z), $MachinePrecision], -50000000000000.0], t$95$0, If[LessEqual[N[(y * z), $MachinePrecision], 5e-7], x$95$m, If[LessEqual[N[(y * z), $MachinePrecision], 2e+172], N[(x$95$m * N[(y * (-z)), $MachinePrecision]), $MachinePrecision], t$95$0]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_0 := z \cdot \left(x\_m \cdot \left(-y\right)\right)\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \cdot z \leq -50000000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \cdot z \leq 5 \cdot 10^{-7}:\\
\;\;\;\;x\_m\\
\mathbf{elif}\;y \cdot z \leq 2 \cdot 10^{+172}:\\
\;\;\;\;x\_m \cdot \left(y \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
\end{array}
if (*.f64 y z) < -5e13 or 2.0000000000000002e172 < (*.f64 y z) Initial program 88.2%
Taylor expanded in z around inf 94.6%
Taylor expanded in y around inf 94.6%
mul-1-neg94.6%
*-commutative94.6%
distribute-rgt-neg-in94.6%
Simplified94.6%
if -5e13 < (*.f64 y z) < 4.99999999999999977e-7Initial program 100.0%
Taylor expanded in y around 0 97.8%
if 4.99999999999999977e-7 < (*.f64 y z) < 2.0000000000000002e172Initial program 99.5%
Taylor expanded in y around inf 98.3%
mul-1-neg98.3%
distribute-rgt-neg-out98.3%
Simplified98.3%
Final simplification96.8%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z)
:precision binary64
(let* ((t_0 (- 1.0 (* y z))))
(*
x_s
(if (or (<= t_0 -100000000.0) (not (<= t_0 2.0)))
(* x_m (* y (- z)))
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 t_0 = 1.0 - (y * z);
double tmp;
if ((t_0 <= -100000000.0) || !(t_0 <= 2.0)) {
tmp = x_m * (y * -z);
} 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) :: t_0
real(8) :: tmp
t_0 = 1.0d0 - (y * z)
if ((t_0 <= (-100000000.0d0)) .or. (.not. (t_0 <= 2.0d0))) then
tmp = x_m * (y * -z)
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 t_0 = 1.0 - (y * z);
double tmp;
if ((t_0 <= -100000000.0) || !(t_0 <= 2.0)) {
tmp = x_m * (y * -z);
} 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): t_0 = 1.0 - (y * z) tmp = 0 if (t_0 <= -100000000.0) or not (t_0 <= 2.0): tmp = x_m * (y * -z) 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) t_0 = Float64(1.0 - Float64(y * z)) tmp = 0.0 if ((t_0 <= -100000000.0) || !(t_0 <= 2.0)) tmp = Float64(x_m * Float64(y * Float64(-z))); 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) t_0 = 1.0 - (y * z); tmp = 0.0; if ((t_0 <= -100000000.0) || ~((t_0 <= 2.0))) tmp = x_m * (y * -z); 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_] := Block[{t$95$0 = N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[Or[LessEqual[t$95$0, -100000000.0], N[Not[LessEqual[t$95$0, 2.0]], $MachinePrecision]], N[(x$95$m * N[(y * (-z)), $MachinePrecision]), $MachinePrecision], x$95$m]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_0 := 1 - y \cdot z\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -100000000 \lor \neg \left(t\_0 \leq 2\right):\\
\;\;\;\;x\_m \cdot \left(y \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (*.f64 y z)) < -1e8 or 2 < (-.f64 #s(literal 1 binary64) (*.f64 y z)) Initial program 91.7%
Taylor expanded in y around inf 90.6%
mul-1-neg90.6%
distribute-rgt-neg-out90.6%
Simplified90.6%
if -1e8 < (-.f64 #s(literal 1 binary64) (*.f64 y z)) < 2Initial program 100.0%
Taylor expanded in y around 0 98.5%
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 (<= (* 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 (<= (* y z) -2e+17) (/ (* x_m z) z) 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 * z) <= -2e+17) {
tmp = (x_m * z) / z;
} 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 * z) <= (-2d+17)) then
tmp = (x_m * z) / z
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 * z) <= -2e+17) {
tmp = (x_m * z) / z;
} 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 * z) <= -2e+17: tmp = (x_m * z) / z 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 (Float64(y * z) <= -2e+17) tmp = Float64(Float64(x_m * z) / z); 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 * z) <= -2e+17) tmp = (x_m * z) / z; 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[N[(y * z), $MachinePrecision], -2e+17], N[(N[(x$95$m * z), $MachinePrecision] / z), $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 \cdot z \leq -2 \cdot 10^{+17}:\\
\;\;\;\;\frac{x\_m \cdot z}{z}\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if (*.f64 y z) < -2e17Initial program 93.2%
Taylor expanded in z around inf 95.0%
Taylor expanded in y around 0 8.7%
associate-*r/21.7%
*-commutative21.7%
Applied egg-rr21.7%
if -2e17 < (*.f64 y z) Initial program 96.5%
Taylor expanded in y around 0 62.8%
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))))