Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, J

Percentage Accurate: 96.1% → 98.9%
Time: 8.6s
Alternatives: 12
Speedup: 0.5×

Specification

?
\[\begin{array}{l} \\ x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \end{array} \]
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* (- 1.0 y) z))))
double code(double x, double y, double z) {
	return x * (1.0 - ((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 - ((1.0d0 - y) * z))
end function
public static double code(double x, double y, double z) {
	return x * (1.0 - ((1.0 - y) * z));
}
def code(x, y, z):
	return x * (1.0 - ((1.0 - y) * z))
function code(x, y, z)
	return Float64(x * Float64(1.0 - Float64(Float64(1.0 - y) * z)))
end
function tmp = code(x, y, z)
	tmp = x * (1.0 - ((1.0 - y) * z));
end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \left(1 - \left(1 - y\right) \cdot z\right)
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 12 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 96.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \end{array} \]
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* (- 1.0 y) z))))
double code(double x, double y, double z) {
	return x * (1.0 - ((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 - ((1.0d0 - y) * z))
end function
public static double code(double x, double y, double z) {
	return x * (1.0 - ((1.0 - y) * z));
}
def code(x, y, z):
	return x * (1.0 - ((1.0 - y) * z))
function code(x, y, z)
	return Float64(x * Float64(1.0 - Float64(Float64(1.0 - y) * z)))
end
function tmp = code(x, y, z)
	tmp = x * (1.0 - ((1.0 - y) * z));
end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \left(1 - \left(1 - y\right) \cdot z\right)
\end{array}

Alternative 1: 98.9% accurate, 0.2× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_0 := x\_m \cdot \left(1 + z \cdot \left(y + -1\right)\right)\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq -1 \cdot 10^{+226}:\\ \;\;\;\;z \cdot \left(x\_m \cdot \left(y + -1\right)\right)\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+299}:\\ \;\;\;\;x\_m \cdot \left(1 - z\right) + x\_m \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x\_m \cdot z\right) \cdot \left(y + -1\right)\\ \end{array} \end{array} \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
 :precision binary64
 (let* ((t_0 (* x_m (+ 1.0 (* z (+ y -1.0))))))
   (*
    x_s
    (if (<= t_0 -1e+226)
      (* z (* x_m (+ y -1.0)))
      (if (<= t_0 5e+299)
        (+ (* x_m (- 1.0 z)) (* x_m (* y z)))
        (* (* x_m z) (+ y -1.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 = x_m * (1.0 + (z * (y + -1.0)));
	double tmp;
	if (t_0 <= -1e+226) {
		tmp = z * (x_m * (y + -1.0));
	} else if (t_0 <= 5e+299) {
		tmp = (x_m * (1.0 - z)) + (x_m * (y * z));
	} else {
		tmp = (x_m * z) * (y + -1.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 = x_m * (1.0d0 + (z * (y + (-1.0d0))))
    if (t_0 <= (-1d+226)) then
        tmp = z * (x_m * (y + (-1.0d0)))
    else if (t_0 <= 5d+299) then
        tmp = (x_m * (1.0d0 - z)) + (x_m * (y * z))
    else
        tmp = (x_m * z) * (y + (-1.0d0))
    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 = x_m * (1.0 + (z * (y + -1.0)));
	double tmp;
	if (t_0 <= -1e+226) {
		tmp = z * (x_m * (y + -1.0));
	} else if (t_0 <= 5e+299) {
		tmp = (x_m * (1.0 - z)) + (x_m * (y * z));
	} else {
		tmp = (x_m * z) * (y + -1.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 = x_m * (1.0 + (z * (y + -1.0)))
	tmp = 0
	if t_0 <= -1e+226:
		tmp = z * (x_m * (y + -1.0))
	elif t_0 <= 5e+299:
		tmp = (x_m * (1.0 - z)) + (x_m * (y * z))
	else:
		tmp = (x_m * z) * (y + -1.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(x_m * Float64(1.0 + Float64(z * Float64(y + -1.0))))
	tmp = 0.0
	if (t_0 <= -1e+226)
		tmp = Float64(z * Float64(x_m * Float64(y + -1.0)));
	elseif (t_0 <= 5e+299)
		tmp = Float64(Float64(x_m * Float64(1.0 - z)) + Float64(x_m * Float64(y * z)));
	else
		tmp = Float64(Float64(x_m * z) * Float64(y + -1.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 = x_m * (1.0 + (z * (y + -1.0)));
	tmp = 0.0;
	if (t_0 <= -1e+226)
		tmp = z * (x_m * (y + -1.0));
	elseif (t_0 <= 5e+299)
		tmp = (x_m * (1.0 - z)) + (x_m * (y * z));
	else
		tmp = (x_m * z) * (y + -1.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[(x$95$m * N[(1.0 + N[(z * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$0, -1e+226], N[(z * N[(x$95$m * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+299], N[(N[(x$95$m * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + N[(x$95$m * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m * z), $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)

\\
\begin{array}{l}
t_0 := x\_m \cdot \left(1 + z \cdot \left(y + -1\right)\right)\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+226}:\\
\;\;\;\;z \cdot \left(x\_m \cdot \left(y + -1\right)\right)\\

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+299}:\\
\;\;\;\;x\_m \cdot \left(1 - z\right) + x\_m \cdot \left(y \cdot z\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x\_m \cdot z\right) \cdot \left(y + -1\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x (-.f64 1 (*.f64 (-.f64 1 y) z))) < -9.99999999999999961e225

    1. Initial program 86.8%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 78.8%

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z\right) + x \cdot \left(1 - z\right)} \]
    4. Taylor expanded in z around inf 84.3%

      \[\leadsto \color{blue}{z \cdot \left(-1 \cdot x + x \cdot y\right)} \]
    5. Taylor expanded in x around 0 84.4%

      \[\leadsto z \cdot \color{blue}{\left(x \cdot \left(y - 1\right)\right)} \]

    if -9.99999999999999961e225 < (*.f64 x (-.f64 1 (*.f64 (-.f64 1 y) z))) < 5.0000000000000003e299

    1. Initial program 99.8%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 99.9%

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z\right) + x \cdot \left(1 - z\right)} \]

    if 5.0000000000000003e299 < (*.f64 x (-.f64 1 (*.f64 (-.f64 1 y) z)))

    1. Initial program 70.3%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 70.3%

      \[\leadsto x \cdot \color{blue}{\left(\left(1 + y \cdot z\right) - z\right)} \]
    4. Taylor expanded in z around inf 70.3%

      \[\leadsto \color{blue}{x \cdot \left(z \cdot \left(y - 1\right)\right)} \]
    5. Step-by-step derivation
      1. sub-neg70.3%

        \[\leadsto x \cdot \left(z \cdot \color{blue}{\left(y + \left(-1\right)\right)}\right) \]
      2. metadata-eval70.3%

        \[\leadsto x \cdot \left(z \cdot \left(y + \color{blue}{-1}\right)\right) \]
      3. associate-*r*99.9%

        \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(y + -1\right)} \]
    6. Simplified99.9%

      \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(y + -1\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot \left(1 + z \cdot \left(y + -1\right)\right) \leq -1 \cdot 10^{+226}:\\ \;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\ \mathbf{elif}\;x \cdot \left(1 + z \cdot \left(y + -1\right)\right) \leq 5 \cdot 10^{+299}:\\ \;\;\;\;x \cdot \left(1 - z\right) + x \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot z\right) \cdot \left(y + -1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 63.8% accurate, 0.3× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_0 := x\_m \cdot \left(y \cdot z\right)\\ t_1 := x\_m \cdot \left(-z\right)\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{+19}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-96}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-86}:\\ \;\;\;\;x\_m\\ \mathbf{elif}\;z \leq 760000 \lor \neg \left(z \leq 3.8 \cdot 10^{+141}\right) \land z \leq 3.4 \cdot 10^{+177}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
 :precision binary64
 (let* ((t_0 (* x_m (* y z))) (t_1 (* x_m (- z))))
   (*
    x_s
    (if (<= z -1.45e+19)
      t_1
      (if (<= z -3.6e-96)
        t_0
        (if (<= z 2.5e-86)
          x_m
          (if (or (<= z 760000.0) (and (not (<= z 3.8e+141)) (<= z 3.4e+177)))
            t_0
            t_1)))))))
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 = x_m * (y * z);
	double t_1 = x_m * -z;
	double tmp;
	if (z <= -1.45e+19) {
		tmp = t_1;
	} else if (z <= -3.6e-96) {
		tmp = t_0;
	} else if (z <= 2.5e-86) {
		tmp = x_m;
	} else if ((z <= 760000.0) || (!(z <= 3.8e+141) && (z <= 3.4e+177))) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	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) :: t_1
    real(8) :: tmp
    t_0 = x_m * (y * z)
    t_1 = x_m * -z
    if (z <= (-1.45d+19)) then
        tmp = t_1
    else if (z <= (-3.6d-96)) then
        tmp = t_0
    else if (z <= 2.5d-86) then
        tmp = x_m
    else if ((z <= 760000.0d0) .or. (.not. (z <= 3.8d+141)) .and. (z <= 3.4d+177)) then
        tmp = t_0
    else
        tmp = t_1
    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 = x_m * (y * z);
	double t_1 = x_m * -z;
	double tmp;
	if (z <= -1.45e+19) {
		tmp = t_1;
	} else if (z <= -3.6e-96) {
		tmp = t_0;
	} else if (z <= 2.5e-86) {
		tmp = x_m;
	} else if ((z <= 760000.0) || (!(z <= 3.8e+141) && (z <= 3.4e+177))) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	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 = x_m * (y * z)
	t_1 = x_m * -z
	tmp = 0
	if z <= -1.45e+19:
		tmp = t_1
	elif z <= -3.6e-96:
		tmp = t_0
	elif z <= 2.5e-86:
		tmp = x_m
	elif (z <= 760000.0) or (not (z <= 3.8e+141) and (z <= 3.4e+177)):
		tmp = t_0
	else:
		tmp = t_1
	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(x_m * Float64(y * z))
	t_1 = Float64(x_m * Float64(-z))
	tmp = 0.0
	if (z <= -1.45e+19)
		tmp = t_1;
	elseif (z <= -3.6e-96)
		tmp = t_0;
	elseif (z <= 2.5e-86)
		tmp = x_m;
	elseif ((z <= 760000.0) || (!(z <= 3.8e+141) && (z <= 3.4e+177)))
		tmp = t_0;
	else
		tmp = t_1;
	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 = x_m * (y * z);
	t_1 = x_m * -z;
	tmp = 0.0;
	if (z <= -1.45e+19)
		tmp = t_1;
	elseif (z <= -3.6e-96)
		tmp = t_0;
	elseif (z <= 2.5e-86)
		tmp = x_m;
	elseif ((z <= 760000.0) || (~((z <= 3.8e+141)) && (z <= 3.4e+177)))
		tmp = t_0;
	else
		tmp = t_1;
	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[(x$95$m * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$95$m * (-z)), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.45e+19], t$95$1, If[LessEqual[z, -3.6e-96], t$95$0, If[LessEqual[z, 2.5e-86], x$95$m, If[Or[LessEqual[z, 760000.0], And[N[Not[LessEqual[z, 3.8e+141]], $MachinePrecision], LessEqual[z, 3.4e+177]]], t$95$0, t$95$1]]]]), $MachinePrecision]]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)

\\
\begin{array}{l}
t_0 := x\_m \cdot \left(y \cdot z\right)\\
t_1 := x\_m \cdot \left(-z\right)\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -3.6 \cdot 10^{-96}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 2.5 \cdot 10^{-86}:\\
\;\;\;\;x\_m\\

\mathbf{elif}\;z \leq 760000 \lor \neg \left(z \leq 3.8 \cdot 10^{+141}\right) \land z \leq 3.4 \cdot 10^{+177}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.45e19 or 7.6e5 < z < 3.79999999999999976e141 or 3.3999999999999998e177 < z

    1. Initial program 87.2%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 86.4%

      \[\leadsto \color{blue}{x \cdot \left(z \cdot \left(y - 1\right)\right)} \]
    4. Taylor expanded in y around 0 62.3%

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot z\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg62.3%

        \[\leadsto \color{blue}{-x \cdot z} \]
      2. *-commutative62.3%

        \[\leadsto -\color{blue}{z \cdot x} \]
      3. distribute-rgt-neg-in62.3%

        \[\leadsto \color{blue}{z \cdot \left(-x\right)} \]
    6. Simplified62.3%

      \[\leadsto \color{blue}{z \cdot \left(-x\right)} \]

    if -1.45e19 < z < -3.60000000000000008e-96 or 2.4999999999999999e-86 < z < 7.6e5 or 3.79999999999999976e141 < z < 3.3999999999999998e177

    1. Initial program 96.6%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 62.9%

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z\right)} \]
    4. Step-by-step derivation
      1. *-commutative62.9%

        \[\leadsto x \cdot \color{blue}{\left(z \cdot y\right)} \]
    5. Simplified62.9%

      \[\leadsto \color{blue}{x \cdot \left(z \cdot y\right)} \]

    if -3.60000000000000008e-96 < z < 2.4999999999999999e-86

    1. Initial program 99.9%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 83.7%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification69.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{+19}:\\ \;\;\;\;x \cdot \left(-z\right)\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-96}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-86}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 760000 \lor \neg \left(z \leq 3.8 \cdot 10^{+141}\right) \land z \leq 3.4 \cdot 10^{+177}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 98.9% accurate, 0.3× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_0 := x\_m \cdot \left(1 + z \cdot \left(y + -1\right)\right)\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq -1 \cdot 10^{+226}:\\ \;\;\;\;z \cdot \left(x\_m \cdot \left(y + -1\right)\right)\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+299}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(x\_m \cdot z\right) \cdot \left(y + -1\right)\\ \end{array} \end{array} \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
 :precision binary64
 (let* ((t_0 (* x_m (+ 1.0 (* z (+ y -1.0))))))
   (*
    x_s
    (if (<= t_0 -1e+226)
      (* z (* x_m (+ y -1.0)))
      (if (<= t_0 5e+299) t_0 (* (* x_m z) (+ y -1.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 = x_m * (1.0 + (z * (y + -1.0)));
	double tmp;
	if (t_0 <= -1e+226) {
		tmp = z * (x_m * (y + -1.0));
	} else if (t_0 <= 5e+299) {
		tmp = t_0;
	} else {
		tmp = (x_m * z) * (y + -1.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 = x_m * (1.0d0 + (z * (y + (-1.0d0))))
    if (t_0 <= (-1d+226)) then
        tmp = z * (x_m * (y + (-1.0d0)))
    else if (t_0 <= 5d+299) then
        tmp = t_0
    else
        tmp = (x_m * z) * (y + (-1.0d0))
    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 = x_m * (1.0 + (z * (y + -1.0)));
	double tmp;
	if (t_0 <= -1e+226) {
		tmp = z * (x_m * (y + -1.0));
	} else if (t_0 <= 5e+299) {
		tmp = t_0;
	} else {
		tmp = (x_m * z) * (y + -1.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 = x_m * (1.0 + (z * (y + -1.0)))
	tmp = 0
	if t_0 <= -1e+226:
		tmp = z * (x_m * (y + -1.0))
	elif t_0 <= 5e+299:
		tmp = t_0
	else:
		tmp = (x_m * z) * (y + -1.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(x_m * Float64(1.0 + Float64(z * Float64(y + -1.0))))
	tmp = 0.0
	if (t_0 <= -1e+226)
		tmp = Float64(z * Float64(x_m * Float64(y + -1.0)));
	elseif (t_0 <= 5e+299)
		tmp = t_0;
	else
		tmp = Float64(Float64(x_m * z) * Float64(y + -1.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 = x_m * (1.0 + (z * (y + -1.0)));
	tmp = 0.0;
	if (t_0 <= -1e+226)
		tmp = z * (x_m * (y + -1.0));
	elseif (t_0 <= 5e+299)
		tmp = t_0;
	else
		tmp = (x_m * z) * (y + -1.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[(x$95$m * N[(1.0 + N[(z * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$0, -1e+226], N[(z * N[(x$95$m * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+299], t$95$0, N[(N[(x$95$m * z), $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)

\\
\begin{array}{l}
t_0 := x\_m \cdot \left(1 + z \cdot \left(y + -1\right)\right)\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+226}:\\
\;\;\;\;z \cdot \left(x\_m \cdot \left(y + -1\right)\right)\\

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+299}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\left(x\_m \cdot z\right) \cdot \left(y + -1\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x (-.f64 1 (*.f64 (-.f64 1 y) z))) < -9.99999999999999961e225

    1. Initial program 86.8%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 78.8%

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z\right) + x \cdot \left(1 - z\right)} \]
    4. Taylor expanded in z around inf 84.3%

      \[\leadsto \color{blue}{z \cdot \left(-1 \cdot x + x \cdot y\right)} \]
    5. Taylor expanded in x around 0 84.4%

      \[\leadsto z \cdot \color{blue}{\left(x \cdot \left(y - 1\right)\right)} \]

    if -9.99999999999999961e225 < (*.f64 x (-.f64 1 (*.f64 (-.f64 1 y) z))) < 5.0000000000000003e299

    1. Initial program 99.8%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing

    if 5.0000000000000003e299 < (*.f64 x (-.f64 1 (*.f64 (-.f64 1 y) z)))

    1. Initial program 70.3%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 70.3%

      \[\leadsto x \cdot \color{blue}{\left(\left(1 + y \cdot z\right) - z\right)} \]
    4. Taylor expanded in z around inf 70.3%

      \[\leadsto \color{blue}{x \cdot \left(z \cdot \left(y - 1\right)\right)} \]
    5. Step-by-step derivation
      1. sub-neg70.3%

        \[\leadsto x \cdot \left(z \cdot \color{blue}{\left(y + \left(-1\right)\right)}\right) \]
      2. metadata-eval70.3%

        \[\leadsto x \cdot \left(z \cdot \left(y + \color{blue}{-1}\right)\right) \]
      3. associate-*r*99.9%

        \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(y + -1\right)} \]
    6. Simplified99.9%

      \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(y + -1\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot \left(1 + z \cdot \left(y + -1\right)\right) \leq -1 \cdot 10^{+226}:\\ \;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\ \mathbf{elif}\;x \cdot \left(1 + z \cdot \left(y + -1\right)\right) \leq 5 \cdot 10^{+299}:\\ \;\;\;\;x \cdot \left(1 + z \cdot \left(y + -1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot z\right) \cdot \left(y + -1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 98.9% accurate, 0.3× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_0 := x\_m \cdot \left(1 + z \cdot \left(y + -1\right)\right)\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq -1 \cdot 10^{+226}:\\ \;\;\;\;z \cdot \left(x\_m \cdot \left(y + -1\right)\right)\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+299}:\\ \;\;\;\;x\_m \cdot \left(\left(1 + y \cdot z\right) - z\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x\_m \cdot z\right) \cdot \left(y + -1\right)\\ \end{array} \end{array} \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
 :precision binary64
 (let* ((t_0 (* x_m (+ 1.0 (* z (+ y -1.0))))))
   (*
    x_s
    (if (<= t_0 -1e+226)
      (* z (* x_m (+ y -1.0)))
      (if (<= t_0 5e+299)
        (* x_m (- (+ 1.0 (* y z)) z))
        (* (* x_m z) (+ y -1.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 = x_m * (1.0 + (z * (y + -1.0)));
	double tmp;
	if (t_0 <= -1e+226) {
		tmp = z * (x_m * (y + -1.0));
	} else if (t_0 <= 5e+299) {
		tmp = x_m * ((1.0 + (y * z)) - z);
	} else {
		tmp = (x_m * z) * (y + -1.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 = x_m * (1.0d0 + (z * (y + (-1.0d0))))
    if (t_0 <= (-1d+226)) then
        tmp = z * (x_m * (y + (-1.0d0)))
    else if (t_0 <= 5d+299) then
        tmp = x_m * ((1.0d0 + (y * z)) - z)
    else
        tmp = (x_m * z) * (y + (-1.0d0))
    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 = x_m * (1.0 + (z * (y + -1.0)));
	double tmp;
	if (t_0 <= -1e+226) {
		tmp = z * (x_m * (y + -1.0));
	} else if (t_0 <= 5e+299) {
		tmp = x_m * ((1.0 + (y * z)) - z);
	} else {
		tmp = (x_m * z) * (y + -1.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 = x_m * (1.0 + (z * (y + -1.0)))
	tmp = 0
	if t_0 <= -1e+226:
		tmp = z * (x_m * (y + -1.0))
	elif t_0 <= 5e+299:
		tmp = x_m * ((1.0 + (y * z)) - z)
	else:
		tmp = (x_m * z) * (y + -1.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(x_m * Float64(1.0 + Float64(z * Float64(y + -1.0))))
	tmp = 0.0
	if (t_0 <= -1e+226)
		tmp = Float64(z * Float64(x_m * Float64(y + -1.0)));
	elseif (t_0 <= 5e+299)
		tmp = Float64(x_m * Float64(Float64(1.0 + Float64(y * z)) - z));
	else
		tmp = Float64(Float64(x_m * z) * Float64(y + -1.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 = x_m * (1.0 + (z * (y + -1.0)));
	tmp = 0.0;
	if (t_0 <= -1e+226)
		tmp = z * (x_m * (y + -1.0));
	elseif (t_0 <= 5e+299)
		tmp = x_m * ((1.0 + (y * z)) - z);
	else
		tmp = (x_m * z) * (y + -1.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[(x$95$m * N[(1.0 + N[(z * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$0, -1e+226], N[(z * N[(x$95$m * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+299], N[(x$95$m * N[(N[(1.0 + N[(y * z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m * z), $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)

\\
\begin{array}{l}
t_0 := x\_m \cdot \left(1 + z \cdot \left(y + -1\right)\right)\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+226}:\\
\;\;\;\;z \cdot \left(x\_m \cdot \left(y + -1\right)\right)\\

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+299}:\\
\;\;\;\;x\_m \cdot \left(\left(1 + y \cdot z\right) - z\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x\_m \cdot z\right) \cdot \left(y + -1\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x (-.f64 1 (*.f64 (-.f64 1 y) z))) < -9.99999999999999961e225

    1. Initial program 86.8%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 78.8%

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z\right) + x \cdot \left(1 - z\right)} \]
    4. Taylor expanded in z around inf 84.3%

      \[\leadsto \color{blue}{z \cdot \left(-1 \cdot x + x \cdot y\right)} \]
    5. Taylor expanded in x around 0 84.4%

      \[\leadsto z \cdot \color{blue}{\left(x \cdot \left(y - 1\right)\right)} \]

    if -9.99999999999999961e225 < (*.f64 x (-.f64 1 (*.f64 (-.f64 1 y) z))) < 5.0000000000000003e299

    1. Initial program 99.8%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 99.9%

      \[\leadsto x \cdot \color{blue}{\left(\left(1 + y \cdot z\right) - z\right)} \]

    if 5.0000000000000003e299 < (*.f64 x (-.f64 1 (*.f64 (-.f64 1 y) z)))

    1. Initial program 70.3%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 70.3%

      \[\leadsto x \cdot \color{blue}{\left(\left(1 + y \cdot z\right) - z\right)} \]
    4. Taylor expanded in z around inf 70.3%

      \[\leadsto \color{blue}{x \cdot \left(z \cdot \left(y - 1\right)\right)} \]
    5. Step-by-step derivation
      1. sub-neg70.3%

        \[\leadsto x \cdot \left(z \cdot \color{blue}{\left(y + \left(-1\right)\right)}\right) \]
      2. metadata-eval70.3%

        \[\leadsto x \cdot \left(z \cdot \left(y + \color{blue}{-1}\right)\right) \]
      3. associate-*r*99.9%

        \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(y + -1\right)} \]
    6. Simplified99.9%

      \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(y + -1\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot \left(1 + z \cdot \left(y + -1\right)\right) \leq -1 \cdot 10^{+226}:\\ \;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\ \mathbf{elif}\;x \cdot \left(1 + z \cdot \left(y + -1\right)\right) \leq 5 \cdot 10^{+299}:\\ \;\;\;\;x \cdot \left(\left(1 + y \cdot z\right) - z\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot z\right) \cdot \left(y + -1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 85.3% accurate, 0.4× speedup?

\[\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 -7.4 \cdot 10^{+95} \lor \neg \left(y \leq -3.2 \cdot 10^{+49}\right) \land \left(y \leq -3.1 \cdot 10^{+31} \lor \neg \left(y \leq 5.5 \cdot 10^{+36}\right)\right):\\ \;\;\;\;z \cdot \left(x\_m \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot \left(1 - z\right)\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
 :precision binary64
 (*
  x_s
  (if (or (<= y -7.4e+95)
          (and (not (<= y -3.2e+49))
               (or (<= y -3.1e+31) (not (<= y 5.5e+36)))))
    (* z (* x_m y))
    (* x_m (- 1.0 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 ((y <= -7.4e+95) || (!(y <= -3.2e+49) && ((y <= -3.1e+31) || !(y <= 5.5e+36)))) {
		tmp = z * (x_m * y);
	} else {
		tmp = x_m * (1.0 - 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 ((y <= (-7.4d+95)) .or. (.not. (y <= (-3.2d+49))) .and. (y <= (-3.1d+31)) .or. (.not. (y <= 5.5d+36))) then
        tmp = z * (x_m * y)
    else
        tmp = x_m * (1.0d0 - 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 ((y <= -7.4e+95) || (!(y <= -3.2e+49) && ((y <= -3.1e+31) || !(y <= 5.5e+36)))) {
		tmp = z * (x_m * y);
	} else {
		tmp = x_m * (1.0 - 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 (y <= -7.4e+95) or (not (y <= -3.2e+49) and ((y <= -3.1e+31) or not (y <= 5.5e+36))):
		tmp = z * (x_m * y)
	else:
		tmp = x_m * (1.0 - 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 ((y <= -7.4e+95) || (!(y <= -3.2e+49) && ((y <= -3.1e+31) || !(y <= 5.5e+36))))
		tmp = Float64(z * Float64(x_m * y));
	else
		tmp = Float64(x_m * Float64(1.0 - 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 ((y <= -7.4e+95) || (~((y <= -3.2e+49)) && ((y <= -3.1e+31) || ~((y <= 5.5e+36)))))
		tmp = z * (x_m * y);
	else
		tmp = x_m * (1.0 - 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[Or[LessEqual[y, -7.4e+95], And[N[Not[LessEqual[y, -3.2e+49]], $MachinePrecision], Or[LessEqual[y, -3.1e+31], N[Not[LessEqual[y, 5.5e+36]], $MachinePrecision]]]], N[(z * N[(x$95$m * y), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(1.0 - z), $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 \leq -7.4 \cdot 10^{+95} \lor \neg \left(y \leq -3.2 \cdot 10^{+49}\right) \land \left(y \leq -3.1 \cdot 10^{+31} \lor \neg \left(y \leq 5.5 \cdot 10^{+36}\right)\right):\\
\;\;\;\;z \cdot \left(x\_m \cdot y\right)\\

\mathbf{else}:\\
\;\;\;\;x\_m \cdot \left(1 - z\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.4000000000000003e95 or -3.20000000000000014e49 < y < -3.1000000000000002e31 or 5.5000000000000002e36 < y

    1. Initial program 85.4%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 79.2%

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z\right) + x \cdot \left(1 - z\right)} \]
    4. Taylor expanded in z around inf 76.1%

      \[\leadsto \color{blue}{z \cdot \left(-1 \cdot x + x \cdot y\right)} \]
    5. Taylor expanded in y around inf 76.1%

      \[\leadsto z \cdot \color{blue}{\left(x \cdot y\right)} \]

    if -7.4000000000000003e95 < y < -3.20000000000000014e49 or -3.1000000000000002e31 < y < 5.5000000000000002e36

    1. Initial program 100.0%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 95.5%

      \[\leadsto \color{blue}{x \cdot \left(1 - z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification87.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.4 \cdot 10^{+95} \lor \neg \left(y \leq -3.2 \cdot 10^{+49}\right) \land \left(y \leq -3.1 \cdot 10^{+31} \lor \neg \left(y \leq 5.5 \cdot 10^{+36}\right)\right):\\ \;\;\;\;z \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 85.6% accurate, 0.4× speedup?

\[\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 -4.4 \cdot 10^{+95} \lor \neg \left(y \leq -1.75 \cdot 10^{+51} \lor \neg \left(y \leq -2.8 \cdot 10^{+30}\right) \land y \leq 7 \cdot 10^{+36}\right):\\ \;\;\;\;y \cdot \left(x\_m \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot \left(1 - z\right)\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
 :precision binary64
 (*
  x_s
  (if (or (<= y -4.4e+95)
          (not (or (<= y -1.75e+51) (and (not (<= y -2.8e+30)) (<= y 7e+36)))))
    (* y (* x_m z))
    (* x_m (- 1.0 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 ((y <= -4.4e+95) || !((y <= -1.75e+51) || (!(y <= -2.8e+30) && (y <= 7e+36)))) {
		tmp = y * (x_m * z);
	} else {
		tmp = x_m * (1.0 - 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 ((y <= (-4.4d+95)) .or. (.not. (y <= (-1.75d+51)) .or. (.not. (y <= (-2.8d+30))) .and. (y <= 7d+36))) then
        tmp = y * (x_m * z)
    else
        tmp = x_m * (1.0d0 - 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 ((y <= -4.4e+95) || !((y <= -1.75e+51) || (!(y <= -2.8e+30) && (y <= 7e+36)))) {
		tmp = y * (x_m * z);
	} else {
		tmp = x_m * (1.0 - 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 (y <= -4.4e+95) or not ((y <= -1.75e+51) or (not (y <= -2.8e+30) and (y <= 7e+36))):
		tmp = y * (x_m * z)
	else:
		tmp = x_m * (1.0 - 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 ((y <= -4.4e+95) || !((y <= -1.75e+51) || (!(y <= -2.8e+30) && (y <= 7e+36))))
		tmp = Float64(y * Float64(x_m * z));
	else
		tmp = Float64(x_m * Float64(1.0 - 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 ((y <= -4.4e+95) || ~(((y <= -1.75e+51) || (~((y <= -2.8e+30)) && (y <= 7e+36)))))
		tmp = y * (x_m * z);
	else
		tmp = x_m * (1.0 - 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[Or[LessEqual[y, -4.4e+95], N[Not[Or[LessEqual[y, -1.75e+51], And[N[Not[LessEqual[y, -2.8e+30]], $MachinePrecision], LessEqual[y, 7e+36]]]], $MachinePrecision]], N[(y * N[(x$95$m * z), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(1.0 - z), $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 \leq -4.4 \cdot 10^{+95} \lor \neg \left(y \leq -1.75 \cdot 10^{+51} \lor \neg \left(y \leq -2.8 \cdot 10^{+30}\right) \land y \leq 7 \cdot 10^{+36}\right):\\
\;\;\;\;y \cdot \left(x\_m \cdot z\right)\\

\mathbf{else}:\\
\;\;\;\;x\_m \cdot \left(1 - z\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.3999999999999998e95 or -1.75e51 < y < -2.79999999999999983e30 or 6.9999999999999996e36 < y

    1. Initial program 85.4%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 85.4%

      \[\leadsto x \cdot \left(1 - \color{blue}{-1 \cdot \left(y \cdot z\right)}\right) \]
    4. Step-by-step derivation
      1. mul-1-neg85.4%

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(-y \cdot z\right)}\right) \]
      2. distribute-lft-neg-out85.4%

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(-y\right) \cdot z}\right) \]
      3. *-commutative85.4%

        \[\leadsto x \cdot \left(1 - \color{blue}{z \cdot \left(-y\right)}\right) \]
    5. Simplified85.4%

      \[\leadsto x \cdot \left(1 - \color{blue}{z \cdot \left(-y\right)}\right) \]
    6. Taylor expanded in z around inf 66.8%

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z\right)} \]
    7. Step-by-step derivation
      1. *-commutative66.8%

        \[\leadsto x \cdot \color{blue}{\left(z \cdot y\right)} \]
      2. associate-*r*76.9%

        \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot y} \]
    8. Simplified76.9%

      \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot y} \]

    if -4.3999999999999998e95 < y < -1.75e51 or -2.79999999999999983e30 < y < 6.9999999999999996e36

    1. Initial program 100.0%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 95.5%

      \[\leadsto \color{blue}{x \cdot \left(1 - z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification87.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.4 \cdot 10^{+95} \lor \neg \left(y \leq -1.75 \cdot 10^{+51} \lor \neg \left(y \leq -2.8 \cdot 10^{+30}\right) \land y \leq 7 \cdot 10^{+36}\right):\\ \;\;\;\;y \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 85.7% accurate, 0.5× speedup?

\[\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.2 \cdot 10^{-65} \lor \neg \left(z \leq 1.2 \cdot 10^{-49}\right):\\ \;\;\;\;z \cdot \left(x\_m \cdot \left(y + -1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot \left(1 - z\right)\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
 :precision binary64
 (*
  x_s
  (if (or (<= z -6.2e-65) (not (<= z 1.2e-49)))
    (* z (* x_m (+ y -1.0)))
    (* x_m (- 1.0 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 <= -6.2e-65) || !(z <= 1.2e-49)) {
		tmp = z * (x_m * (y + -1.0));
	} else {
		tmp = x_m * (1.0 - 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 <= (-6.2d-65)) .or. (.not. (z <= 1.2d-49))) then
        tmp = z * (x_m * (y + (-1.0d0)))
    else
        tmp = x_m * (1.0d0 - 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 <= -6.2e-65) || !(z <= 1.2e-49)) {
		tmp = z * (x_m * (y + -1.0));
	} else {
		tmp = x_m * (1.0 - 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 <= -6.2e-65) or not (z <= 1.2e-49):
		tmp = z * (x_m * (y + -1.0))
	else:
		tmp = x_m * (1.0 - 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 <= -6.2e-65) || !(z <= 1.2e-49))
		tmp = Float64(z * Float64(x_m * Float64(y + -1.0)));
	else
		tmp = Float64(x_m * Float64(1.0 - 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 <= -6.2e-65) || ~((z <= 1.2e-49)))
		tmp = z * (x_m * (y + -1.0));
	else
		tmp = x_m * (1.0 - 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[Or[LessEqual[z, -6.2e-65], N[Not[LessEqual[z, 1.2e-49]], $MachinePrecision]], N[(z * N[(x$95$m * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(1.0 - z), $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 -6.2 \cdot 10^{-65} \lor \neg \left(z \leq 1.2 \cdot 10^{-49}\right):\\
\;\;\;\;z \cdot \left(x\_m \cdot \left(y + -1\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x\_m \cdot \left(1 - z\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.20000000000000032e-65 or 1.19999999999999996e-49 < z

    1. Initial program 89.6%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 83.2%

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z\right) + x \cdot \left(1 - z\right)} \]
    4. Taylor expanded in z around inf 92.2%

      \[\leadsto \color{blue}{z \cdot \left(-1 \cdot x + x \cdot y\right)} \]
    5. Taylor expanded in x around 0 92.2%

      \[\leadsto z \cdot \color{blue}{\left(x \cdot \left(y - 1\right)\right)} \]

    if -6.20000000000000032e-65 < z < 1.19999999999999996e-49

    1. Initial program 99.9%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 79.2%

      \[\leadsto \color{blue}{x \cdot \left(1 - z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification87.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.2 \cdot 10^{-65} \lor \neg \left(z \leq 1.2 \cdot 10^{-49}\right):\\ \;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 85.1% accurate, 0.5× speedup?

\[\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 -8.6 \cdot 10^{-99} \lor \neg \left(z \leq 1.7 \cdot 10^{-45}\right):\\ \;\;\;\;\left(x\_m \cdot z\right) \cdot \left(y + -1\right)\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot \left(1 - z\right)\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
 :precision binary64
 (*
  x_s
  (if (or (<= z -8.6e-99) (not (<= z 1.7e-45)))
    (* (* x_m z) (+ y -1.0))
    (* x_m (- 1.0 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 <= -8.6e-99) || !(z <= 1.7e-45)) {
		tmp = (x_m * z) * (y + -1.0);
	} else {
		tmp = x_m * (1.0 - 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 <= (-8.6d-99)) .or. (.not. (z <= 1.7d-45))) then
        tmp = (x_m * z) * (y + (-1.0d0))
    else
        tmp = x_m * (1.0d0 - 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 <= -8.6e-99) || !(z <= 1.7e-45)) {
		tmp = (x_m * z) * (y + -1.0);
	} else {
		tmp = x_m * (1.0 - 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 <= -8.6e-99) or not (z <= 1.7e-45):
		tmp = (x_m * z) * (y + -1.0)
	else:
		tmp = x_m * (1.0 - 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 <= -8.6e-99) || !(z <= 1.7e-45))
		tmp = Float64(Float64(x_m * z) * Float64(y + -1.0));
	else
		tmp = Float64(x_m * Float64(1.0 - 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 <= -8.6e-99) || ~((z <= 1.7e-45)))
		tmp = (x_m * z) * (y + -1.0);
	else
		tmp = x_m * (1.0 - 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[Or[LessEqual[z, -8.6e-99], N[Not[LessEqual[z, 1.7e-45]], $MachinePrecision]], N[(N[(x$95$m * z), $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(1.0 - z), $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 -8.6 \cdot 10^{-99} \lor \neg \left(z \leq 1.7 \cdot 10^{-45}\right):\\
\;\;\;\;\left(x\_m \cdot z\right) \cdot \left(y + -1\right)\\

\mathbf{else}:\\
\;\;\;\;x\_m \cdot \left(1 - z\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.5999999999999998e-99 or 1.70000000000000002e-45 < z

    1. Initial program 90.1%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 90.1%

      \[\leadsto x \cdot \color{blue}{\left(\left(1 + y \cdot z\right) - z\right)} \]
    4. Taylor expanded in z around inf 81.1%

      \[\leadsto \color{blue}{x \cdot \left(z \cdot \left(y - 1\right)\right)} \]
    5. Step-by-step derivation
      1. sub-neg81.1%

        \[\leadsto x \cdot \left(z \cdot \color{blue}{\left(y + \left(-1\right)\right)}\right) \]
      2. metadata-eval81.1%

        \[\leadsto x \cdot \left(z \cdot \left(y + \color{blue}{-1}\right)\right) \]
      3. associate-*r*90.8%

        \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(y + -1\right)} \]
    6. Simplified90.8%

      \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(y + -1\right)} \]

    if -8.5999999999999998e-99 < z < 1.70000000000000002e-45

    1. Initial program 99.9%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 81.6%

      \[\leadsto \color{blue}{x \cdot \left(1 - z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification87.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.6 \cdot 10^{-99} \lor \neg \left(z \leq 1.7 \cdot 10^{-45}\right):\\ \;\;\;\;\left(x \cdot z\right) \cdot \left(y + -1\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 98.9% accurate, 0.5× speedup?

\[\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 -3200:\\ \;\;\;\;\left(x\_m \cdot z\right) \cdot \left(y + -1\right)\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;x\_m + x\_m \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x\_m \cdot \left(y + -1\right)\right)\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
 :precision binary64
 (*
  x_s
  (if (<= z -3200.0)
    (* (* x_m z) (+ y -1.0))
    (if (<= z 1.0) (+ x_m (* x_m (* y z))) (* z (* x_m (+ y -1.0)))))))
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 <= -3200.0) {
		tmp = (x_m * z) * (y + -1.0);
	} else if (z <= 1.0) {
		tmp = x_m + (x_m * (y * z));
	} else {
		tmp = z * (x_m * (y + -1.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) :: tmp
    if (z <= (-3200.0d0)) then
        tmp = (x_m * z) * (y + (-1.0d0))
    else if (z <= 1.0d0) then
        tmp = x_m + (x_m * (y * z))
    else
        tmp = z * (x_m * (y + (-1.0d0)))
    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 <= -3200.0) {
		tmp = (x_m * z) * (y + -1.0);
	} else if (z <= 1.0) {
		tmp = x_m + (x_m * (y * z));
	} else {
		tmp = z * (x_m * (y + -1.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):
	tmp = 0
	if z <= -3200.0:
		tmp = (x_m * z) * (y + -1.0)
	elif z <= 1.0:
		tmp = x_m + (x_m * (y * z))
	else:
		tmp = z * (x_m * (y + -1.0))
	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 <= -3200.0)
		tmp = Float64(Float64(x_m * z) * Float64(y + -1.0));
	elseif (z <= 1.0)
		tmp = Float64(x_m + Float64(x_m * Float64(y * z)));
	else
		tmp = Float64(z * Float64(x_m * Float64(y + -1.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)
	tmp = 0.0;
	if (z <= -3200.0)
		tmp = (x_m * z) * (y + -1.0);
	elseif (z <= 1.0)
		tmp = x_m + (x_m * (y * z));
	else
		tmp = z * (x_m * (y + -1.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_] := N[(x$95$s * If[LessEqual[z, -3200.0], N[(N[(x$95$m * z), $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(x$95$m + N[(x$95$m * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(x$95$m * N[(y + -1.0), $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}\;z \leq -3200:\\
\;\;\;\;\left(x\_m \cdot z\right) \cdot \left(y + -1\right)\\

\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x\_m + x\_m \cdot \left(y \cdot z\right)\\

\mathbf{else}:\\
\;\;\;\;z \cdot \left(x\_m \cdot \left(y + -1\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3200

    1. Initial program 87.2%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 87.2%

      \[\leadsto x \cdot \color{blue}{\left(\left(1 + y \cdot z\right) - z\right)} \]
    4. Taylor expanded in z around inf 86.1%

      \[\leadsto \color{blue}{x \cdot \left(z \cdot \left(y - 1\right)\right)} \]
    5. Step-by-step derivation
      1. sub-neg86.1%

        \[\leadsto x \cdot \left(z \cdot \color{blue}{\left(y + \left(-1\right)\right)}\right) \]
      2. metadata-eval86.1%

        \[\leadsto x \cdot \left(z \cdot \left(y + \color{blue}{-1}\right)\right) \]
      3. associate-*r*98.8%

        \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(y + -1\right)} \]
    6. Simplified98.8%

      \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(y + -1\right)} \]

    if -3200 < z < 1

    1. Initial program 99.9%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 98.3%

      \[\leadsto x \cdot \left(1 - \color{blue}{-1 \cdot \left(y \cdot z\right)}\right) \]
    4. Step-by-step derivation
      1. mul-1-neg98.3%

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(-y \cdot z\right)}\right) \]
      2. distribute-lft-neg-out98.3%

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(-y\right) \cdot z}\right) \]
      3. *-commutative98.3%

        \[\leadsto x \cdot \left(1 - \color{blue}{z \cdot \left(-y\right)}\right) \]
    5. Simplified98.3%

      \[\leadsto x \cdot \left(1 - \color{blue}{z \cdot \left(-y\right)}\right) \]
    6. Step-by-step derivation
      1. flip--94.6%

        \[\leadsto x \cdot \color{blue}{\frac{1 \cdot 1 - \left(z \cdot \left(-y\right)\right) \cdot \left(z \cdot \left(-y\right)\right)}{1 + z \cdot \left(-y\right)}} \]
      2. flip--98.3%

        \[\leadsto x \cdot \color{blue}{\left(1 - z \cdot \left(-y\right)\right)} \]
      3. *-commutative98.3%

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(-y\right) \cdot z}\right) \]
      4. cancel-sign-sub98.3%

        \[\leadsto x \cdot \color{blue}{\left(1 + y \cdot z\right)} \]
      5. *-commutative98.3%

        \[\leadsto x \cdot \left(1 + \color{blue}{z \cdot y}\right) \]
      6. distribute-rgt-in98.3%

        \[\leadsto \color{blue}{1 \cdot x + \left(z \cdot y\right) \cdot x} \]
      7. *-un-lft-identity98.3%

        \[\leadsto \color{blue}{x} + \left(z \cdot y\right) \cdot x \]
      8. *-commutative98.3%

        \[\leadsto x + \color{blue}{x \cdot \left(z \cdot y\right)} \]
    7. Applied egg-rr98.3%

      \[\leadsto \color{blue}{x + x \cdot \left(z \cdot y\right)} \]

    if 1 < z

    1. Initial program 87.9%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 81.0%

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z\right) + x \cdot \left(1 - z\right)} \]
    4. Taylor expanded in z around inf 97.8%

      \[\leadsto \color{blue}{z \cdot \left(-1 \cdot x + x \cdot y\right)} \]
    5. Taylor expanded in x around 0 97.8%

      \[\leadsto z \cdot \color{blue}{\left(x \cdot \left(y - 1\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification98.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3200:\\ \;\;\;\;\left(x \cdot z\right) \cdot \left(y + -1\right)\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;x + x \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 82.7% accurate, 0.6× speedup?

\[\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 -6.5 \cdot 10^{+159} \lor \neg \left(y \leq 5.1 \cdot 10^{+36}\right):\\ \;\;\;\;x\_m \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot \left(1 - z\right)\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
 :precision binary64
 (*
  x_s
  (if (or (<= y -6.5e+159) (not (<= y 5.1e+36)))
    (* x_m (* y z))
    (* x_m (- 1.0 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 ((y <= -6.5e+159) || !(y <= 5.1e+36)) {
		tmp = x_m * (y * z);
	} else {
		tmp = x_m * (1.0 - 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 ((y <= (-6.5d+159)) .or. (.not. (y <= 5.1d+36))) then
        tmp = x_m * (y * z)
    else
        tmp = x_m * (1.0d0 - 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 ((y <= -6.5e+159) || !(y <= 5.1e+36)) {
		tmp = x_m * (y * z);
	} else {
		tmp = x_m * (1.0 - 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 (y <= -6.5e+159) or not (y <= 5.1e+36):
		tmp = x_m * (y * z)
	else:
		tmp = x_m * (1.0 - 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 ((y <= -6.5e+159) || !(y <= 5.1e+36))
		tmp = Float64(x_m * Float64(y * z));
	else
		tmp = Float64(x_m * Float64(1.0 - 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 ((y <= -6.5e+159) || ~((y <= 5.1e+36)))
		tmp = x_m * (y * z);
	else
		tmp = x_m * (1.0 - 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[Or[LessEqual[y, -6.5e+159], N[Not[LessEqual[y, 5.1e+36]], $MachinePrecision]], N[(x$95$m * N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(1.0 - z), $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 \leq -6.5 \cdot 10^{+159} \lor \neg \left(y \leq 5.1 \cdot 10^{+36}\right):\\
\;\;\;\;x\_m \cdot \left(y \cdot z\right)\\

\mathbf{else}:\\
\;\;\;\;x\_m \cdot \left(1 - z\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.5000000000000001e159 or 5.09999999999999973e36 < y

    1. Initial program 87.7%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 70.2%

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z\right)} \]
    4. Step-by-step derivation
      1. *-commutative70.2%

        \[\leadsto x \cdot \color{blue}{\left(z \cdot y\right)} \]
    5. Simplified70.2%

      \[\leadsto \color{blue}{x \cdot \left(z \cdot y\right)} \]

    if -6.5000000000000001e159 < y < 5.09999999999999973e36

    1. Initial program 96.6%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 87.3%

      \[\leadsto \color{blue}{x \cdot \left(1 - z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification81.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.5 \cdot 10^{+159} \lor \neg \left(y \leq 5.1 \cdot 10^{+36}\right):\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 65.7% accurate, 0.6× speedup?

\[\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 -3200 \lor \neg \left(z \leq 1\right):\\ \;\;\;\;x\_m \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x\_m\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
 :precision binary64
 (* x_s (if (or (<= z -3200.0) (not (<= z 1.0))) (* x_m (- 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 ((z <= -3200.0) || !(z <= 1.0)) {
		tmp = x_m * -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 ((z <= (-3200.0d0)) .or. (.not. (z <= 1.0d0))) then
        tmp = x_m * -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 ((z <= -3200.0) || !(z <= 1.0)) {
		tmp = x_m * -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 (z <= -3200.0) or not (z <= 1.0):
		tmp = x_m * -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 ((z <= -3200.0) || !(z <= 1.0))
		tmp = Float64(x_m * 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)
	tmp = 0.0;
	if ((z <= -3200.0) || ~((z <= 1.0)))
		tmp = x_m * -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[Or[LessEqual[z, -3200.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x$95$m * (-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}\;z \leq -3200 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x\_m \cdot \left(-z\right)\\

\mathbf{else}:\\
\;\;\;\;x\_m\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3200 or 1 < z

    1. Initial program 87.6%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 86.0%

      \[\leadsto \color{blue}{x \cdot \left(z \cdot \left(y - 1\right)\right)} \]
    4. Taylor expanded in y around 0 55.7%

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot z\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg55.7%

        \[\leadsto \color{blue}{-x \cdot z} \]
      2. *-commutative55.7%

        \[\leadsto -\color{blue}{z \cdot x} \]
      3. distribute-rgt-neg-in55.7%

        \[\leadsto \color{blue}{z \cdot \left(-x\right)} \]
    6. Simplified55.7%

      \[\leadsto \color{blue}{z \cdot \left(-x\right)} \]

    if -3200 < z < 1

    1. Initial program 99.9%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 69.5%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3200 \lor \neg \left(z \leq 1\right):\\ \;\;\;\;x \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 39.3% accurate, 9.0× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ x_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot x\_m \end{array} \]
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 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}
Derivation
  1. Initial program 93.6%

    \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
  2. Add Preprocessing
  3. Taylor expanded in z around 0 35.5%

    \[\leadsto \color{blue}{x} \]
  4. Final simplification35.5%

    \[\leadsto x \]
  5. Add Preprocessing

Developer target: 99.7% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(1 - \left(1 - y\right) \cdot z\right)\\ t_1 := x + \left(1 - y\right) \cdot \left(\left(-z\right) \cdot x\right)\\ \mathbf{if}\;t\_0 < -1.618195973607049 \cdot 10^{+50}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 < 3.892237649663903 \cdot 10^{+134}:\\ \;\;\;\;\left(x \cdot y\right) \cdot z - \left(x \cdot z - x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (- 1.0 (* (- 1.0 y) z))))
        (t_1 (+ x (* (- 1.0 y) (* (- z) x)))))
   (if (< t_0 -1.618195973607049e+50)
     t_1
     (if (< t_0 3.892237649663903e+134) (- (* (* x y) z) (- (* x z) x)) t_1))))
double code(double x, double y, double z) {
	double t_0 = x * (1.0 - ((1.0 - y) * z));
	double t_1 = x + ((1.0 - y) * (-z * x));
	double tmp;
	if (t_0 < -1.618195973607049e+50) {
		tmp = t_1;
	} else if (t_0 < 3.892237649663903e+134) {
		tmp = ((x * y) * z) - ((x * z) - x);
	} else {
		tmp = t_1;
	}
	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) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = x * (1.0d0 - ((1.0d0 - y) * z))
    t_1 = x + ((1.0d0 - y) * (-z * x))
    if (t_0 < (-1.618195973607049d+50)) then
        tmp = t_1
    else if (t_0 < 3.892237649663903d+134) then
        tmp = ((x * y) * z) - ((x * z) - x)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x * (1.0 - ((1.0 - y) * z));
	double t_1 = x + ((1.0 - y) * (-z * x));
	double tmp;
	if (t_0 < -1.618195973607049e+50) {
		tmp = t_1;
	} else if (t_0 < 3.892237649663903e+134) {
		tmp = ((x * y) * z) - ((x * z) - x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * (1.0 - ((1.0 - y) * z))
	t_1 = x + ((1.0 - y) * (-z * x))
	tmp = 0
	if t_0 < -1.618195973607049e+50:
		tmp = t_1
	elif t_0 < 3.892237649663903e+134:
		tmp = ((x * y) * z) - ((x * z) - x)
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(x * Float64(1.0 - Float64(Float64(1.0 - y) * z)))
	t_1 = Float64(x + Float64(Float64(1.0 - y) * Float64(Float64(-z) * x)))
	tmp = 0.0
	if (t_0 < -1.618195973607049e+50)
		tmp = t_1;
	elseif (t_0 < 3.892237649663903e+134)
		tmp = Float64(Float64(Float64(x * y) * z) - Float64(Float64(x * z) - x));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * (1.0 - ((1.0 - y) * z));
	t_1 = x + ((1.0 - y) * (-z * x));
	tmp = 0.0;
	if (t_0 < -1.618195973607049e+50)
		tmp = t_1;
	elseif (t_0 < 3.892237649663903e+134)
		tmp = ((x * y) * z) - ((x * z) - x);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(1.0 - N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(N[(1.0 - y), $MachinePrecision] * N[((-z) * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$0, -1.618195973607049e+50], t$95$1, If[Less[t$95$0, 3.892237649663903e+134], N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] - N[(N[(x * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \left(1 - \left(1 - y\right) \cdot z\right)\\
t_1 := x + \left(1 - y\right) \cdot \left(\left(-z\right) \cdot x\right)\\
\mathbf{if}\;t\_0 < -1.618195973607049 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 < 3.892237649663903 \cdot 10^{+134}:\\
\;\;\;\;\left(x \cdot y\right) \cdot z - \left(x \cdot z - x\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024044 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, J"
  :precision binary64

  :herbie-target
  (if (< (* x (- 1.0 (* (- 1.0 y) z))) -1.618195973607049e+50) (+ x (* (- 1.0 y) (* (- z) x))) (if (< (* x (- 1.0 (* (- 1.0 y) z))) 3.892237649663903e+134) (- (* (* x y) z) (- (* x z) x)) (+ x (* (- 1.0 y) (* (- z) x)))))

  (* x (- 1.0 (* (- 1.0 y) z))))