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

Percentage Accurate: 96.5% → 98.1%
Time: 6.9s
Alternatives: 13
Speedup: 0.8×

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 13 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.5% 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.1% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y + -1, x \cdot z, x\right) \end{array} \]
(FPCore (x y z) :precision binary64 (fma (+ y -1.0) (* x z) x))
double code(double x, double y, double z) {
	return fma((y + -1.0), (x * z), x);
}
function code(x, y, z)
	return fma(Float64(y + -1.0), Float64(x * z), x)
end
code[x_, y_, z_] := N[(N[(y + -1.0), $MachinePrecision] * N[(x * z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(y + -1, x \cdot z, x\right)
\end{array}
Derivation
  1. Initial program 96.6%

    \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
  2. Step-by-step derivation
    1. distribute-rgt-out--96.6%

      \[\leadsto \color{blue}{1 \cdot x - \left(\left(1 - y\right) \cdot z\right) \cdot x} \]
    2. *-lft-identity96.6%

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

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

      \[\leadsto \color{blue}{\left(-\left(1 - y\right) \cdot z\right) \cdot x + x} \]
    5. distribute-lft-neg-in96.6%

      \[\leadsto \color{blue}{\left(\left(-\left(1 - y\right)\right) \cdot z\right)} \cdot x + x \]
    6. associate-*l*98.6%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-\left(1 - y\right), z \cdot x, x\right)} \]
    8. neg-sub098.6%

      \[\leadsto \mathsf{fma}\left(\color{blue}{0 - \left(1 - y\right)}, z \cdot x, x\right) \]
    9. associate--r-98.6%

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(0 - 1\right) + y}, z \cdot x, x\right) \]
    10. metadata-eval98.6%

      \[\leadsto \mathsf{fma}\left(\color{blue}{-1} + y, z \cdot x, x\right) \]
    11. +-commutative98.6%

      \[\leadsto \mathsf{fma}\left(\color{blue}{y + -1}, z \cdot x, x\right) \]
    12. *-commutative98.6%

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(y + -1, x \cdot z, x\right)} \]
  4. Final simplification98.6%

    \[\leadsto \mathsf{fma}\left(y + -1, x \cdot z, x\right) \]

Alternative 2: 65.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(x \cdot z\right)\\ t_1 := x \cdot \left(-z\right)\\ \mathbf{if}\;z \leq -1.3 \cdot 10^{+270}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -3.7 \cdot 10^{+71}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-16}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 3.75 \cdot 10^{-103}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-65}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-11}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{+85}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (* x z))) (t_1 (* x (- z))))
   (if (<= z -1.3e+270)
     t_0
     (if (<= z -3.7e+71)
       t_1
       (if (<= z -1.02e-16)
         t_0
         (if (<= z 3.75e-103)
           x
           (if (<= z 9e-65)
             t_0
             (if (<= z 1.6e-11) x (if (<= z 1.95e+85) t_0 t_1)))))))))
double code(double x, double y, double z) {
	double t_0 = y * (x * z);
	double t_1 = x * -z;
	double tmp;
	if (z <= -1.3e+270) {
		tmp = t_0;
	} else if (z <= -3.7e+71) {
		tmp = t_1;
	} else if (z <= -1.02e-16) {
		tmp = t_0;
	} else if (z <= 3.75e-103) {
		tmp = x;
	} else if (z <= 9e-65) {
		tmp = t_0;
	} else if (z <= 1.6e-11) {
		tmp = x;
	} else if (z <= 1.95e+85) {
		tmp = t_0;
	} 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 = y * (x * z)
    t_1 = x * -z
    if (z <= (-1.3d+270)) then
        tmp = t_0
    else if (z <= (-3.7d+71)) then
        tmp = t_1
    else if (z <= (-1.02d-16)) then
        tmp = t_0
    else if (z <= 3.75d-103) then
        tmp = x
    else if (z <= 9d-65) then
        tmp = t_0
    else if (z <= 1.6d-11) then
        tmp = x
    else if (z <= 1.95d+85) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = y * (x * z);
	double t_1 = x * -z;
	double tmp;
	if (z <= -1.3e+270) {
		tmp = t_0;
	} else if (z <= -3.7e+71) {
		tmp = t_1;
	} else if (z <= -1.02e-16) {
		tmp = t_0;
	} else if (z <= 3.75e-103) {
		tmp = x;
	} else if (z <= 9e-65) {
		tmp = t_0;
	} else if (z <= 1.6e-11) {
		tmp = x;
	} else if (z <= 1.95e+85) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * (x * z)
	t_1 = x * -z
	tmp = 0
	if z <= -1.3e+270:
		tmp = t_0
	elif z <= -3.7e+71:
		tmp = t_1
	elif z <= -1.02e-16:
		tmp = t_0
	elif z <= 3.75e-103:
		tmp = x
	elif z <= 9e-65:
		tmp = t_0
	elif z <= 1.6e-11:
		tmp = x
	elif z <= 1.95e+85:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(y * Float64(x * z))
	t_1 = Float64(x * Float64(-z))
	tmp = 0.0
	if (z <= -1.3e+270)
		tmp = t_0;
	elseif (z <= -3.7e+71)
		tmp = t_1;
	elseif (z <= -1.02e-16)
		tmp = t_0;
	elseif (z <= 3.75e-103)
		tmp = x;
	elseif (z <= 9e-65)
		tmp = t_0;
	elseif (z <= 1.6e-11)
		tmp = x;
	elseif (z <= 1.95e+85)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * (x * z);
	t_1 = x * -z;
	tmp = 0.0;
	if (z <= -1.3e+270)
		tmp = t_0;
	elseif (z <= -3.7e+71)
		tmp = t_1;
	elseif (z <= -1.02e-16)
		tmp = t_0;
	elseif (z <= 3.75e-103)
		tmp = x;
	elseif (z <= 9e-65)
		tmp = t_0;
	elseif (z <= 1.6e-11)
		tmp = x;
	elseif (z <= 1.95e+85)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * (-z)), $MachinePrecision]}, If[LessEqual[z, -1.3e+270], t$95$0, If[LessEqual[z, -3.7e+71], t$95$1, If[LessEqual[z, -1.02e-16], t$95$0, If[LessEqual[z, 3.75e-103], x, If[LessEqual[z, 9e-65], t$95$0, If[LessEqual[z, 1.6e-11], x, If[LessEqual[z, 1.95e+85], t$95$0, t$95$1]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y \cdot \left(x \cdot z\right)\\
t_1 := x \cdot \left(-z\right)\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{+270}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -3.7 \cdot 10^{+71}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -1.02 \cdot 10^{-16}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq 3.75 \cdot 10^{-103}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 9 \cdot 10^{-65}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq 1.6 \cdot 10^{-11}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.95 \cdot 10^{+85}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.30000000000000006e270 or -3.7e71 < z < -1.0200000000000001e-16 or 3.75e-103 < z < 8.9999999999999995e-65 or 1.59999999999999997e-11 < z < 1.95000000000000017e85

    1. Initial program 96.6%

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

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

    if -1.30000000000000006e270 < z < -3.7e71 or 1.95000000000000017e85 < z

    1. Initial program 91.7%

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

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

        \[\leadsto z \cdot \color{blue}{\left(x \cdot \left(y - 1\right)\right)} \]
      2. sub-neg99.9%

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

        \[\leadsto z \cdot \left(x \cdot \left(y + \color{blue}{-1}\right)\right) \]
      4. distribute-rgt-in99.9%

        \[\leadsto z \cdot \color{blue}{\left(y \cdot x + -1 \cdot x\right)} \]
      5. neg-mul-199.9%

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

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

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

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

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

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

    if -1.0200000000000001e-16 < z < 3.75e-103 or 8.9999999999999995e-65 < z < 1.59999999999999997e-11

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+270}:\\ \;\;\;\;y \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -3.7 \cdot 10^{+71}:\\ \;\;\;\;x \cdot \left(-z\right)\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-16}:\\ \;\;\;\;y \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq 3.75 \cdot 10^{-103}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-65}:\\ \;\;\;\;y \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-11}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{+85}:\\ \;\;\;\;y \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-z\right)\\ \end{array} \]

Alternative 3: 65.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(x \cdot z\right)\\ t_1 := z \cdot \left(y \cdot x\right)\\ t_2 := x \cdot \left(-z\right)\\ \mathbf{if}\;z \leq -9 \cdot 10^{+273}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -7 \cdot 10^{+75}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-26}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 3.75 \cdot 10^{-103}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-65}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-12}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+86}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (* x z))) (t_1 (* z (* y x))) (t_2 (* x (- z))))
   (if (<= z -9e+273)
     t_1
     (if (<= z -7e+75)
       t_2
       (if (<= z -9.2e-26)
         t_0
         (if (<= z 3.75e-103)
           x
           (if (<= z 9e-65)
             t_0
             (if (<= z 2.5e-12) x (if (<= z 3e+86) t_1 t_2)))))))))
double code(double x, double y, double z) {
	double t_0 = y * (x * z);
	double t_1 = z * (y * x);
	double t_2 = x * -z;
	double tmp;
	if (z <= -9e+273) {
		tmp = t_1;
	} else if (z <= -7e+75) {
		tmp = t_2;
	} else if (z <= -9.2e-26) {
		tmp = t_0;
	} else if (z <= 3.75e-103) {
		tmp = x;
	} else if (z <= 9e-65) {
		tmp = t_0;
	} else if (z <= 2.5e-12) {
		tmp = x;
	} else if (z <= 3e+86) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_0 = y * (x * z)
    t_1 = z * (y * x)
    t_2 = x * -z
    if (z <= (-9d+273)) then
        tmp = t_1
    else if (z <= (-7d+75)) then
        tmp = t_2
    else if (z <= (-9.2d-26)) then
        tmp = t_0
    else if (z <= 3.75d-103) then
        tmp = x
    else if (z <= 9d-65) then
        tmp = t_0
    else if (z <= 2.5d-12) then
        tmp = x
    else if (z <= 3d+86) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = y * (x * z);
	double t_1 = z * (y * x);
	double t_2 = x * -z;
	double tmp;
	if (z <= -9e+273) {
		tmp = t_1;
	} else if (z <= -7e+75) {
		tmp = t_2;
	} else if (z <= -9.2e-26) {
		tmp = t_0;
	} else if (z <= 3.75e-103) {
		tmp = x;
	} else if (z <= 9e-65) {
		tmp = t_0;
	} else if (z <= 2.5e-12) {
		tmp = x;
	} else if (z <= 3e+86) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * (x * z)
	t_1 = z * (y * x)
	t_2 = x * -z
	tmp = 0
	if z <= -9e+273:
		tmp = t_1
	elif z <= -7e+75:
		tmp = t_2
	elif z <= -9.2e-26:
		tmp = t_0
	elif z <= 3.75e-103:
		tmp = x
	elif z <= 9e-65:
		tmp = t_0
	elif z <= 2.5e-12:
		tmp = x
	elif z <= 3e+86:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z)
	t_0 = Float64(y * Float64(x * z))
	t_1 = Float64(z * Float64(y * x))
	t_2 = Float64(x * Float64(-z))
	tmp = 0.0
	if (z <= -9e+273)
		tmp = t_1;
	elseif (z <= -7e+75)
		tmp = t_2;
	elseif (z <= -9.2e-26)
		tmp = t_0;
	elseif (z <= 3.75e-103)
		tmp = x;
	elseif (z <= 9e-65)
		tmp = t_0;
	elseif (z <= 2.5e-12)
		tmp = x;
	elseif (z <= 3e+86)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * (x * z);
	t_1 = z * (y * x);
	t_2 = x * -z;
	tmp = 0.0;
	if (z <= -9e+273)
		tmp = t_1;
	elseif (z <= -7e+75)
		tmp = t_2;
	elseif (z <= -9.2e-26)
		tmp = t_0;
	elseif (z <= 3.75e-103)
		tmp = x;
	elseif (z <= 9e-65)
		tmp = t_0;
	elseif (z <= 2.5e-12)
		tmp = x;
	elseif (z <= 3e+86)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * (-z)), $MachinePrecision]}, If[LessEqual[z, -9e+273], t$95$1, If[LessEqual[z, -7e+75], t$95$2, If[LessEqual[z, -9.2e-26], t$95$0, If[LessEqual[z, 3.75e-103], x, If[LessEqual[z, 9e-65], t$95$0, If[LessEqual[z, 2.5e-12], x, If[LessEqual[z, 3e+86], t$95$1, t$95$2]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y \cdot \left(x \cdot z\right)\\
t_1 := z \cdot \left(y \cdot x\right)\\
t_2 := x \cdot \left(-z\right)\\
\mathbf{if}\;z \leq -9 \cdot 10^{+273}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -7 \cdot 10^{+75}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq -9.2 \cdot 10^{-26}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq 3.75 \cdot 10^{-103}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 9 \cdot 10^{-65}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;z \leq 3 \cdot 10^{+86}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.99999999999999987e273 or 2.49999999999999985e-12 < z < 2.99999999999999977e86

    1. Initial program 94.8%

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

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

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

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

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

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

    if -8.99999999999999987e273 < z < -6.9999999999999997e75 or 2.99999999999999977e86 < z

    1. Initial program 91.7%

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

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

        \[\leadsto z \cdot \color{blue}{\left(x \cdot \left(y - 1\right)\right)} \]
      2. sub-neg99.9%

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

        \[\leadsto z \cdot \left(x \cdot \left(y + \color{blue}{-1}\right)\right) \]
      4. distribute-rgt-in99.9%

        \[\leadsto z \cdot \color{blue}{\left(y \cdot x + -1 \cdot x\right)} \]
      5. neg-mul-199.9%

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

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

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

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

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

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

    if -6.9999999999999997e75 < z < -9.20000000000000035e-26 or 3.75e-103 < z < 8.9999999999999995e-65

    1. Initial program 99.8%

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

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

    if -9.20000000000000035e-26 < z < 3.75e-103 or 8.9999999999999995e-65 < z < 2.49999999999999985e-12

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{+273}:\\ \;\;\;\;z \cdot \left(y \cdot x\right)\\ \mathbf{elif}\;z \leq -7 \cdot 10^{+75}:\\ \;\;\;\;x \cdot \left(-z\right)\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-26}:\\ \;\;\;\;y \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq 3.75 \cdot 10^{-103}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-65}:\\ \;\;\;\;y \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-12}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+86}:\\ \;\;\;\;z \cdot \left(y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-z\right)\\ \end{array} \]

Alternative 4: 64.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(y \cdot z\right)\\ t_1 := x \cdot \left(-z\right)\\ \mathbf{if}\;z \leq -6 \cdot 10^{+272}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3.75 \cdot 10^{-103}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-65}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-11}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+84}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (* y z))) (t_1 (* x (- z))))
   (if (<= z -6e+272)
     t_0
     (if (<= z -1.0)
       t_1
       (if (<= z 3.75e-103)
         x
         (if (<= z 9e-65)
           t_0
           (if (<= z 2.9e-11) x (if (<= z 6e+84) t_0 t_1))))))))
double code(double x, double y, double z) {
	double t_0 = x * (y * z);
	double t_1 = x * -z;
	double tmp;
	if (z <= -6e+272) {
		tmp = t_0;
	} else if (z <= -1.0) {
		tmp = t_1;
	} else if (z <= 3.75e-103) {
		tmp = x;
	} else if (z <= 9e-65) {
		tmp = t_0;
	} else if (z <= 2.9e-11) {
		tmp = x;
	} else if (z <= 6e+84) {
		tmp = t_0;
	} 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 * (y * z)
    t_1 = x * -z
    if (z <= (-6d+272)) then
        tmp = t_0
    else if (z <= (-1.0d0)) then
        tmp = t_1
    else if (z <= 3.75d-103) then
        tmp = x
    else if (z <= 9d-65) then
        tmp = t_0
    else if (z <= 2.9d-11) then
        tmp = x
    else if (z <= 6d+84) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x * (y * z);
	double t_1 = x * -z;
	double tmp;
	if (z <= -6e+272) {
		tmp = t_0;
	} else if (z <= -1.0) {
		tmp = t_1;
	} else if (z <= 3.75e-103) {
		tmp = x;
	} else if (z <= 9e-65) {
		tmp = t_0;
	} else if (z <= 2.9e-11) {
		tmp = x;
	} else if (z <= 6e+84) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * (y * z)
	t_1 = x * -z
	tmp = 0
	if z <= -6e+272:
		tmp = t_0
	elif z <= -1.0:
		tmp = t_1
	elif z <= 3.75e-103:
		tmp = x
	elif z <= 9e-65:
		tmp = t_0
	elif z <= 2.9e-11:
		tmp = x
	elif z <= 6e+84:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(x * Float64(y * z))
	t_1 = Float64(x * Float64(-z))
	tmp = 0.0
	if (z <= -6e+272)
		tmp = t_0;
	elseif (z <= -1.0)
		tmp = t_1;
	elseif (z <= 3.75e-103)
		tmp = x;
	elseif (z <= 9e-65)
		tmp = t_0;
	elseif (z <= 2.9e-11)
		tmp = x;
	elseif (z <= 6e+84)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * (y * z);
	t_1 = x * -z;
	tmp = 0.0;
	if (z <= -6e+272)
		tmp = t_0;
	elseif (z <= -1.0)
		tmp = t_1;
	elseif (z <= 3.75e-103)
		tmp = x;
	elseif (z <= 9e-65)
		tmp = t_0;
	elseif (z <= 2.9e-11)
		tmp = x;
	elseif (z <= 6e+84)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * (-z)), $MachinePrecision]}, If[LessEqual[z, -6e+272], t$95$0, If[LessEqual[z, -1.0], t$95$1, If[LessEqual[z, 3.75e-103], x, If[LessEqual[z, 9e-65], t$95$0, If[LessEqual[z, 2.9e-11], x, If[LessEqual[z, 6e+84], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \left(y \cdot z\right)\\
t_1 := x \cdot \left(-z\right)\\
\mathbf{if}\;z \leq -6 \cdot 10^{+272}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -1:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 3.75 \cdot 10^{-103}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 9 \cdot 10^{-65}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq 2.9 \cdot 10^{-11}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 6 \cdot 10^{+84}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.0000000000000004e272 or 3.75e-103 < z < 8.9999999999999995e-65 or 2.9e-11 < z < 5.99999999999999992e84

    1. Initial program 95.7%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Step-by-step derivation
      1. distribute-rgt-out--95.8%

        \[\leadsto \color{blue}{1 \cdot x - \left(\left(1 - y\right) \cdot z\right) \cdot x} \]
      2. *-lft-identity95.8%

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

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

        \[\leadsto \color{blue}{\left(-\left(1 - y\right) \cdot z\right) \cdot x + x} \]
      5. distribute-lft-neg-in95.8%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-\left(1 - y\right), z \cdot x, x\right)} \]
      8. neg-sub099.9%

        \[\leadsto \mathsf{fma}\left(\color{blue}{0 - \left(1 - y\right)}, z \cdot x, x\right) \]
      9. associate--r-99.9%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(0 - 1\right) + y}, z \cdot x, x\right) \]
      10. metadata-eval99.9%

        \[\leadsto \mathsf{fma}\left(\color{blue}{-1} + y, z \cdot x, x\right) \]
      11. +-commutative99.9%

        \[\leadsto \mathsf{fma}\left(\color{blue}{y + -1}, z \cdot x, x\right) \]
      12. *-commutative99.9%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y + -1, x \cdot z, x\right)} \]
    4. Step-by-step derivation
      1. fma-udef99.9%

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

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

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

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

        \[\leadsto \frac{\left(\left(\left(y + -1\right) \cdot x\right) \cdot z\right) \cdot \left(\left(\left(y + -1\right) \cdot x\right) \cdot z\right) - x \cdot x}{\color{blue}{\left(\left(y + -1\right) \cdot x\right) \cdot z} - x} \]
    5. Applied egg-rr35.7%

      \[\leadsto \color{blue}{\frac{\left(\left(\left(y + -1\right) \cdot x\right) \cdot z\right) \cdot \left(\left(\left(y + -1\right) \cdot x\right) \cdot z\right) - x \cdot x}{\left(\left(y + -1\right) \cdot x\right) \cdot z - x}} \]
    6. Step-by-step derivation
      1. difference-of-squares36.1%

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(y + -1\right) \cdot x, z, x\right)} \cdot \left(\left(\left(y + -1\right) \cdot x\right) \cdot z - x\right)}{\left(\left(y + -1\right) \cdot x\right) \cdot z - x} \]
      3. associate-/l*58.5%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\left(y + -1\right) \cdot x, z, x\right)}{\frac{\left(\left(y + -1\right) \cdot x\right) \cdot z - x}{\left(\left(y + -1\right) \cdot x\right) \cdot z - x}}} \]
      4. fma-def58.5%

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

        \[\leadsto \frac{\left(\left(y + \color{blue}{\left(-1\right)}\right) \cdot x\right) \cdot z + x}{\frac{\left(\left(y + -1\right) \cdot x\right) \cdot z - x}{\left(\left(y + -1\right) \cdot x\right) \cdot z - x}} \]
      6. sub-neg58.5%

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

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

        \[\leadsto \frac{\color{blue}{\left(z \cdot \left(y - 1\right)\right) \cdot x} + x}{\frac{\left(\left(y + -1\right) \cdot x\right) \cdot z - x}{\left(\left(y + -1\right) \cdot x\right) \cdot z - x}} \]
      9. distribute-lft1-in54.4%

        \[\leadsto \frac{\color{blue}{\left(z \cdot \left(y - 1\right) + 1\right) \cdot x}}{\frac{\left(\left(y + -1\right) \cdot x\right) \cdot z - x}{\left(\left(y + -1\right) \cdot x\right) \cdot z - x}} \]
      10. +-commutative54.4%

        \[\leadsto \frac{\color{blue}{\left(1 + z \cdot \left(y - 1\right)\right)} \cdot x}{\frac{\left(\left(y + -1\right) \cdot x\right) \cdot z - x}{\left(\left(y + -1\right) \cdot x\right) \cdot z - x}} \]
      11. *-inverses95.7%

        \[\leadsto \frac{\left(1 + z \cdot \left(y - 1\right)\right) \cdot x}{\color{blue}{1}} \]
      12. associate-/l*95.6%

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(z, y + -1, 1\right)}{\frac{1}{x}}} \]
    8. Taylor expanded in y around inf 70.2%

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

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

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

        \[\leadsto \color{blue}{x \cdot \left(z \cdot y\right)} \]
    10. Simplified66.0%

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

    if -6.0000000000000004e272 < z < -1 or 5.99999999999999992e84 < z

    1. Initial program 92.7%

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

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

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

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

        \[\leadsto z \cdot \left(x \cdot \left(y + \color{blue}{-1}\right)\right) \]
      4. distribute-rgt-in99.2%

        \[\leadsto z \cdot \color{blue}{\left(y \cdot x + -1 \cdot x\right)} \]
      5. neg-mul-199.2%

        \[\leadsto z \cdot \left(y \cdot x + \color{blue}{\left(-x\right)}\right) \]
      6. unsub-neg99.2%

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

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

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

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

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

    if -1 < z < 3.75e-103 or 8.9999999999999995e-65 < z < 2.9e-11

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6 \cdot 10^{+272}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1:\\ \;\;\;\;x \cdot \left(-z\right)\\ \mathbf{elif}\;z \leq 3.75 \cdot 10^{-103}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-65}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-11}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+84}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-z\right)\\ \end{array} \]

Alternative 5: 95.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -160000000 \lor \neg \left(y \leq 1.95 \cdot 10^{-5}\right):\\ \;\;\;\;x + z \cdot \left(y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x - x \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -160000000.0) (not (<= y 1.95e-5)))
   (+ x (* z (* y x)))
   (- x (* x z))))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -160000000.0) || !(y <= 1.95e-5)) {
		tmp = x + (z * (y * x));
	} else {
		tmp = x - (x * z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((y <= (-160000000.0d0)) .or. (.not. (y <= 1.95d-5))) then
        tmp = x + (z * (y * x))
    else
        tmp = x - (x * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -160000000.0) || !(y <= 1.95e-5)) {
		tmp = x + (z * (y * x));
	} else {
		tmp = x - (x * z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -160000000.0) or not (y <= 1.95e-5):
		tmp = x + (z * (y * x))
	else:
		tmp = x - (x * z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -160000000.0) || !(y <= 1.95e-5))
		tmp = Float64(x + Float64(z * Float64(y * x)));
	else
		tmp = Float64(x - Float64(x * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -160000000.0) || ~((y <= 1.95e-5)))
		tmp = x + (z * (y * x));
	else
		tmp = x - (x * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -160000000.0], N[Not[LessEqual[y, 1.95e-5]], $MachinePrecision]], N[(x + N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -160000000 \lor \neg \left(y \leq 1.95 \cdot 10^{-5}\right):\\
\;\;\;\;x + z \cdot \left(y \cdot x\right)\\

\mathbf{else}:\\
\;\;\;\;x - x \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.6e8 or 1.95e-5 < y

    1. Initial program 92.3%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Step-by-step derivation
      1. sub-neg92.3%

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{z \cdot \left(x \cdot y\right)} \]
    6. Simplified89.0%

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

    if -1.6e8 < y < 1.95e-5

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{x \cdot \left(1 - z\right)} \]
      2. distribute-rgt-out--99.2%

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

        \[\leadsto \color{blue}{x} - z \cdot x \]
    4. Simplified99.2%

      \[\leadsto \color{blue}{x - z \cdot x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification94.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -160000000 \lor \neg \left(y \leq 1.95 \cdot 10^{-5}\right):\\ \;\;\;\;x + z \cdot \left(y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x - x \cdot z\\ \end{array} \]

Alternative 6: 97.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -160000000 \lor \neg \left(y \leq 1.95 \cdot 10^{-5}\right):\\ \;\;\;\;x + y \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x - x \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -160000000.0) (not (<= y 1.95e-5)))
   (+ x (* y (* x z)))
   (- x (* x z))))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -160000000.0) || !(y <= 1.95e-5)) {
		tmp = x + (y * (x * z));
	} else {
		tmp = x - (x * z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((y <= (-160000000.0d0)) .or. (.not. (y <= 1.95d-5))) then
        tmp = x + (y * (x * z))
    else
        tmp = x - (x * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -160000000.0) || !(y <= 1.95e-5)) {
		tmp = x + (y * (x * z));
	} else {
		tmp = x - (x * z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -160000000.0) or not (y <= 1.95e-5):
		tmp = x + (y * (x * z))
	else:
		tmp = x - (x * z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -160000000.0) || !(y <= 1.95e-5))
		tmp = Float64(x + Float64(y * Float64(x * z)));
	else
		tmp = Float64(x - Float64(x * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -160000000.0) || ~((y <= 1.95e-5)))
		tmp = x + (y * (x * z));
	else
		tmp = x - (x * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -160000000.0], N[Not[LessEqual[y, 1.95e-5]], $MachinePrecision]], N[(x + N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -160000000 \lor \neg \left(y \leq 1.95 \cdot 10^{-5}\right):\\
\;\;\;\;x + y \cdot \left(x \cdot z\right)\\

\mathbf{else}:\\
\;\;\;\;x - x \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.6e8 or 1.95e-5 < y

    1. Initial program 92.3%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Step-by-step derivation
      1. sub-neg92.3%

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

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

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

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

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

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

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

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

    if -1.6e8 < y < 1.95e-5

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{x \cdot \left(1 - z\right)} \]
      2. distribute-rgt-out--99.2%

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

        \[\leadsto \color{blue}{x} - z \cdot x \]
    4. Simplified99.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -160000000 \lor \neg \left(y \leq 1.95 \cdot 10^{-5}\right):\\ \;\;\;\;x + y \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x - x \cdot z\\ \end{array} \]

Alternative 7: 98.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+112}:\\ \;\;\;\;z \cdot \left(y \cdot x - x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 + z \cdot \left(y + -1\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -2.6e+112) (* z (- (* y x) x)) (* x (+ 1.0 (* z (+ y -1.0))))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -2.6e+112) {
		tmp = z * ((y * x) - x);
	} else {
		tmp = x * (1.0 + (z * (y + -1.0)));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (z <= (-2.6d+112)) then
        tmp = z * ((y * x) - x)
    else
        tmp = x * (1.0d0 + (z * (y + (-1.0d0))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -2.6e+112) {
		tmp = z * ((y * x) - x);
	} else {
		tmp = x * (1.0 + (z * (y + -1.0)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -2.6e+112:
		tmp = z * ((y * x) - x)
	else:
		tmp = x * (1.0 + (z * (y + -1.0)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -2.6e+112)
		tmp = Float64(z * Float64(Float64(y * x) - x));
	else
		tmp = Float64(x * Float64(1.0 + Float64(z * Float64(y + -1.0))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -2.6e+112)
		tmp = z * ((y * x) - x);
	else
		tmp = x * (1.0 + (z * (y + -1.0)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -2.6e+112], N[(z * N[(N[(y * x), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 + N[(z * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+112}:\\
\;\;\;\;z \cdot \left(y \cdot x - x\right)\\

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


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

    1. Initial program 87.2%

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

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

        \[\leadsto z \cdot \color{blue}{\left(x \cdot \left(y - 1\right)\right)} \]
      2. sub-neg99.9%

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

        \[\leadsto z \cdot \left(x \cdot \left(y + \color{blue}{-1}\right)\right) \]
      4. distribute-rgt-in99.9%

        \[\leadsto z \cdot \color{blue}{\left(y \cdot x + -1 \cdot x\right)} \]
      5. neg-mul-199.9%

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

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

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

    if -2.6000000000000001e112 < z

    1. Initial program 98.2%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+112}:\\ \;\;\;\;z \cdot \left(y \cdot x - x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 + z \cdot \left(y + -1\right)\right)\\ \end{array} \]

Alternative 8: 97.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 4 \cdot 10^{+116}:\\ \;\;\;\;x - z \cdot \left(x \cdot \left(1 - y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 + z \cdot \left(y + -1\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x 4e+116) (- x (* z (* x (- 1.0 y)))) (* x (+ 1.0 (* z (+ y -1.0))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= 4e+116) {
		tmp = x - (z * (x * (1.0 - y)));
	} else {
		tmp = x * (1.0 + (z * (y + -1.0)));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= 4d+116) then
        tmp = x - (z * (x * (1.0d0 - y)))
    else
        tmp = x * (1.0d0 + (z * (y + (-1.0d0))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= 4e+116) {
		tmp = x - (z * (x * (1.0 - y)));
	} else {
		tmp = x * (1.0 + (z * (y + -1.0)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= 4e+116:
		tmp = x - (z * (x * (1.0 - y)))
	else:
		tmp = x * (1.0 + (z * (y + -1.0)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= 4e+116)
		tmp = Float64(x - Float64(z * Float64(x * Float64(1.0 - y))));
	else
		tmp = Float64(x * Float64(1.0 + Float64(z * Float64(y + -1.0))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= 4e+116)
		tmp = x - (z * (x * (1.0 - y)));
	else
		tmp = x * (1.0 + (z * (y + -1.0)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, 4e+116], N[(x - N[(z * N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 + N[(z * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 4 \cdot 10^{+116}:\\
\;\;\;\;x - z \cdot \left(x \cdot \left(1 - y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 4.00000000000000006e116

    1. Initial program 95.8%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Step-by-step derivation
      1. distribute-rgt-out--95.8%

        \[\leadsto \color{blue}{1 \cdot x - \left(\left(1 - y\right) \cdot z\right) \cdot x} \]
      2. *-lft-identity95.8%

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

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

        \[\leadsto \color{blue}{\left(-\left(1 - y\right) \cdot z\right) \cdot x + x} \]
      5. distribute-lft-neg-in95.8%

        \[\leadsto \color{blue}{\left(\left(-\left(1 - y\right)\right) \cdot z\right)} \cdot x + x \]
      6. associate-*l*98.2%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-\left(1 - y\right), z \cdot x, x\right)} \]
      8. neg-sub098.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{0 - \left(1 - y\right)}, z \cdot x, x\right) \]
      9. associate--r-98.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(0 - 1\right) + y}, z \cdot x, x\right) \]
      10. metadata-eval98.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{-1} + y, z \cdot x, x\right) \]
      11. +-commutative98.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{y + -1}, z \cdot x, x\right) \]
      12. *-commutative98.2%

        \[\leadsto \mathsf{fma}\left(y + -1, \color{blue}{x \cdot z}, x\right) \]
    3. Simplified98.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y + -1, x \cdot z, x\right)} \]
    4. Step-by-step derivation
      1. fma-udef98.2%

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

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

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

    if 4.00000000000000006e116 < x

    1. Initial program 100.0%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 4 \cdot 10^{+116}:\\ \;\;\;\;x - z \cdot \left(x \cdot \left(1 - y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 + z \cdot \left(y + -1\right)\right)\\ \end{array} \]

Alternative 9: 97.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2.2 \cdot 10^{+116}:\\ \;\;\;\;x - z \cdot \left(x \cdot \left(1 - y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x - x \cdot \left(z \cdot \left(1 - y\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x 2.2e+116) (- x (* z (* x (- 1.0 y)))) (- x (* x (* z (- 1.0 y))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= 2.2e+116) {
		tmp = x - (z * (x * (1.0 - y)));
	} else {
		tmp = x - (x * (z * (1.0 - y)));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= 2.2d+116) then
        tmp = x - (z * (x * (1.0d0 - y)))
    else
        tmp = x - (x * (z * (1.0d0 - y)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= 2.2e+116) {
		tmp = x - (z * (x * (1.0 - y)));
	} else {
		tmp = x - (x * (z * (1.0 - y)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= 2.2e+116:
		tmp = x - (z * (x * (1.0 - y)))
	else:
		tmp = x - (x * (z * (1.0 - y)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= 2.2e+116)
		tmp = Float64(x - Float64(z * Float64(x * Float64(1.0 - y))));
	else
		tmp = Float64(x - Float64(x * Float64(z * Float64(1.0 - y))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= 2.2e+116)
		tmp = x - (z * (x * (1.0 - y)));
	else
		tmp = x - (x * (z * (1.0 - y)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, 2.2e+116], N[(x - N[(z * N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.2 \cdot 10^{+116}:\\
\;\;\;\;x - z \cdot \left(x \cdot \left(1 - y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.2e116

    1. Initial program 95.8%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Step-by-step derivation
      1. distribute-rgt-out--95.8%

        \[\leadsto \color{blue}{1 \cdot x - \left(\left(1 - y\right) \cdot z\right) \cdot x} \]
      2. *-lft-identity95.8%

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

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

        \[\leadsto \color{blue}{\left(-\left(1 - y\right) \cdot z\right) \cdot x + x} \]
      5. distribute-lft-neg-in95.8%

        \[\leadsto \color{blue}{\left(\left(-\left(1 - y\right)\right) \cdot z\right)} \cdot x + x \]
      6. associate-*l*98.2%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-\left(1 - y\right), z \cdot x, x\right)} \]
      8. neg-sub098.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{0 - \left(1 - y\right)}, z \cdot x, x\right) \]
      9. associate--r-98.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(0 - 1\right) + y}, z \cdot x, x\right) \]
      10. metadata-eval98.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{-1} + y, z \cdot x, x\right) \]
      11. +-commutative98.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{y + -1}, z \cdot x, x\right) \]
      12. *-commutative98.2%

        \[\leadsto \mathsf{fma}\left(y + -1, \color{blue}{x \cdot z}, x\right) \]
    3. Simplified98.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y + -1, x \cdot z, x\right)} \]
    4. Step-by-step derivation
      1. fma-udef98.2%

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

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

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

    if 2.2e116 < x

    1. Initial program 100.0%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Step-by-step derivation
      1. sub-neg100.0%

        \[\leadsto x \cdot \color{blue}{\left(1 + \left(-\left(1 - y\right) \cdot z\right)\right)} \]
      2. distribute-rgt-in100.0%

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

        \[\leadsto \color{blue}{x} + \left(-\left(1 - y\right) \cdot z\right) \cdot x \]
      4. distribute-rgt-neg-in100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.2 \cdot 10^{+116}:\\ \;\;\;\;x - z \cdot \left(x \cdot \left(1 - y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x - x \cdot \left(z \cdot \left(1 - y\right)\right)\\ \end{array} \]

Alternative 10: 83.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{+154}:\\ \;\;\;\;y \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{+22}:\\ \;\;\;\;x - x \cdot z\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y \cdot x\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -5.8e+154)
   (* y (* x z))
   (if (<= y 1.75e+22) (- x (* x z)) (* z (* y x)))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -5.8e+154) {
		tmp = y * (x * z);
	} else if (y <= 1.75e+22) {
		tmp = x - (x * z);
	} else {
		tmp = z * (y * x);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-5.8d+154)) then
        tmp = y * (x * z)
    else if (y <= 1.75d+22) then
        tmp = x - (x * z)
    else
        tmp = z * (y * x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -5.8e+154) {
		tmp = y * (x * z);
	} else if (y <= 1.75e+22) {
		tmp = x - (x * z);
	} else {
		tmp = z * (y * x);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -5.8e+154:
		tmp = y * (x * z)
	elif y <= 1.75e+22:
		tmp = x - (x * z)
	else:
		tmp = z * (y * x)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -5.8e+154)
		tmp = Float64(y * Float64(x * z));
	elseif (y <= 1.75e+22)
		tmp = Float64(x - Float64(x * z));
	else
		tmp = Float64(z * Float64(y * x));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -5.8e+154)
		tmp = y * (x * z);
	elseif (y <= 1.75e+22)
		tmp = x - (x * z);
	else
		tmp = z * (y * x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -5.8e+154], N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e+22], N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision], N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{+154}:\\
\;\;\;\;y \cdot \left(x \cdot z\right)\\

\mathbf{elif}\;y \leq 1.75 \cdot 10^{+22}:\\
\;\;\;\;x - x \cdot z\\

\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.79999999999999959e154

    1. Initial program 89.5%

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

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

    if -5.79999999999999959e154 < y < 1.75e22

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{x \cdot \left(1 - z\right)} \]
      2. distribute-rgt-out--93.0%

        \[\leadsto \color{blue}{1 \cdot x - z \cdot x} \]
      3. *-lft-identity93.0%

        \[\leadsto \color{blue}{x} - z \cdot x \]
    4. Simplified93.0%

      \[\leadsto \color{blue}{x - z \cdot x} \]

    if 1.75e22 < y

    1. Initial program 88.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{+154}:\\ \;\;\;\;y \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{+22}:\\ \;\;\;\;x - x \cdot z\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y \cdot x\right)\\ \end{array} \]

Alternative 11: 65.3% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1900\right):\\ \;\;\;\;x \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -1.0) (not (<= z 1900.0))) (* x (- z)) x))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -1.0) || !(z <= 1900.0)) {
		tmp = x * -z;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z <= (-1.0d0)) .or. (.not. (z <= 1900.0d0))) then
        tmp = x * -z
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -1.0) || !(z <= 1900.0)) {
		tmp = x * -z;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -1.0) or not (z <= 1900.0):
		tmp = x * -z
	else:
		tmp = x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -1.0) || !(z <= 1900.0))
		tmp = Float64(x * Float64(-z));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -1.0) || ~((z <= 1900.0)))
		tmp = x * -z;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1900.0]], $MachinePrecision]], N[(x * (-z)), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1900\right):\\
\;\;\;\;x \cdot \left(-z\right)\\

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


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

    1. Initial program 93.1%

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\left(y \cdot x + -1 \cdot x\right)} \]
      5. neg-mul-199.4%

        \[\leadsto z \cdot \left(y \cdot x + \color{blue}{\left(-x\right)}\right) \]
      6. unsub-neg99.4%

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

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

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

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

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

    if -1 < z < 1900

    1. Initial program 99.9%

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

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

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

Alternative 12: 40.9% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+176}:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+47}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -7.5e+176) (* x z) (if (<= z 1.25e+47) x (* x z))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -7.5e+176) {
		tmp = x * z;
	} else if (z <= 1.25e+47) {
		tmp = x;
	} else {
		tmp = x * z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (z <= (-7.5d+176)) then
        tmp = x * z
    else if (z <= 1.25d+47) then
        tmp = x
    else
        tmp = x * z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -7.5e+176) {
		tmp = x * z;
	} else if (z <= 1.25e+47) {
		tmp = x;
	} else {
		tmp = x * z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -7.5e+176:
		tmp = x * z
	elif z <= 1.25e+47:
		tmp = x
	else:
		tmp = x * z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -7.5e+176)
		tmp = Float64(x * z);
	elseif (z <= 1.25e+47)
		tmp = x;
	else
		tmp = Float64(x * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -7.5e+176)
		tmp = x * z;
	elseif (z <= 1.25e+47)
		tmp = x;
	else
		tmp = x * z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -7.5e+176], N[(x * z), $MachinePrecision], If[LessEqual[z, 1.25e+47], x, N[(x * z), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+176}:\\
\;\;\;\;x \cdot z\\

\mathbf{elif}\;z \leq 1.25 \cdot 10^{+47}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;x \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.499999999999999e176 or 1.25000000000000005e47 < z

    1. Initial program 91.7%

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

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

        \[\leadsto z \cdot \color{blue}{\left(x \cdot \left(y - 1\right)\right)} \]
      2. sub-neg99.9%

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

        \[\leadsto z \cdot \left(x \cdot \left(y + \color{blue}{-1}\right)\right) \]
      4. distribute-rgt-in99.9%

        \[\leadsto z \cdot \color{blue}{\left(y \cdot x + -1 \cdot x\right)} \]
      5. neg-mul-199.9%

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

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

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

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

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

        \[\leadsto z \cdot \frac{\color{blue}{{\left(y \cdot x\right)}^{2}} - \left(-x\right) \cdot \left(-x\right)}{y \cdot x - \left(-x\right)} \]
    6. Applied egg-rr61.8%

      \[\leadsto z \cdot \color{blue}{\frac{{\left(y \cdot x\right)}^{2} - \left(-x\right) \cdot \left(-x\right)}{y \cdot x - \left(-x\right)}} \]
    7. Step-by-step derivation
      1. clear-num61.7%

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{y \cdot x - \left(-x\right)}{{\left(y \cdot x\right)}^{2} - \left(-x\right) \cdot \left(-x\right)}}} \]
      2. un-div-inv61.6%

        \[\leadsto \color{blue}{\frac{z}{\frac{y \cdot x - \left(-x\right)}{{\left(y \cdot x\right)}^{2} - \left(-x\right) \cdot \left(-x\right)}}} \]
      3. clear-num61.7%

        \[\leadsto \frac{z}{\color{blue}{\frac{1}{\frac{{\left(y \cdot x\right)}^{2} - \left(-x\right) \cdot \left(-x\right)}{y \cdot x - \left(-x\right)}}}} \]
      4. unpow261.7%

        \[\leadsto \frac{z}{\frac{1}{\frac{\color{blue}{\left(y \cdot x\right) \cdot \left(y \cdot x\right)} - \left(-x\right) \cdot \left(-x\right)}{y \cdot x - \left(-x\right)}}} \]
      5. sqr-neg61.7%

        \[\leadsto \frac{z}{\frac{1}{\frac{\left(y \cdot x\right) \cdot \left(y \cdot x\right) - \color{blue}{x \cdot x}}{y \cdot x - \left(-x\right)}}} \]
      6. sub-neg61.7%

        \[\leadsto \frac{z}{\frac{1}{\frac{\left(y \cdot x\right) \cdot \left(y \cdot x\right) - x \cdot x}{\color{blue}{y \cdot x + \left(-\left(-x\right)\right)}}}} \]
      7. remove-double-neg61.7%

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

        \[\leadsto \frac{z}{\frac{1}{\color{blue}{y \cdot x - x}}} \]
      9. sub-neg99.8%

        \[\leadsto \frac{z}{\frac{1}{\color{blue}{y \cdot x + \left(-x\right)}}} \]
      10. fma-def99.8%

        \[\leadsto \frac{z}{\frac{1}{\color{blue}{\mathsf{fma}\left(y, x, -x\right)}}} \]
      11. add-sqr-sqrt38.3%

        \[\leadsto \frac{z}{\frac{1}{\mathsf{fma}\left(y, x, \color{blue}{\sqrt{-x} \cdot \sqrt{-x}}\right)}} \]
      12. sqrt-prod55.1%

        \[\leadsto \frac{z}{\frac{1}{\mathsf{fma}\left(y, x, \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}\right)}} \]
      13. sqr-neg55.1%

        \[\leadsto \frac{z}{\frac{1}{\mathsf{fma}\left(y, x, \sqrt{\color{blue}{x \cdot x}}\right)}} \]
      14. sqrt-prod29.8%

        \[\leadsto \frac{z}{\frac{1}{\mathsf{fma}\left(y, x, \color{blue}{\sqrt{x} \cdot \sqrt{x}}\right)}} \]
      15. add-sqr-sqrt46.3%

        \[\leadsto \frac{z}{\frac{1}{\mathsf{fma}\left(y, x, \color{blue}{x}\right)}} \]
    8. Applied egg-rr46.3%

      \[\leadsto \color{blue}{\frac{z}{\frac{1}{\mathsf{fma}\left(y, x, x\right)}}} \]
    9. Taylor expanded in y around 0 13.8%

      \[\leadsto \color{blue}{z \cdot x} \]

    if -7.499999999999999e176 < z < 1.25000000000000005e47

    1. Initial program 99.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+176}:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+47}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \]

Alternative 13: 39.0% accurate, 9.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
	return x;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x
end function
public static double code(double x, double y, double z) {
	return x;
}
def code(x, y, z):
	return x
function code(x, y, z)
	return x
end
function tmp = code(x, y, z)
	tmp = x;
end
code[x_, y_, z_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 96.6%

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

    \[\leadsto \color{blue}{x} \]
  3. Final simplification42.8%

    \[\leadsto x \]

Developer target: 99.6% accurate, 0.3× 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 2023228 
(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))))