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

Percentage Accurate: 95.6% → 99.8%
Time: 7.7s
Alternatives: 10
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));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z)
use fmin_fmax_functions
    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}

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 10 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: 95.6% 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));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z)
use fmin_fmax_functions
    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: 99.8% accurate, 0.8× 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}\;x\_m \leq 2.12 \cdot 10^{-35}:\\ \;\;\;\;\mathsf{fma}\left(\left(y - 1\right) \cdot x\_m, z, x\_m\right)\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot \left(1 - \left(1 - y\right) \cdot z\right)\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z)
 :precision binary64
 (*
  x_s
  (if (<= x_m 2.12e-35)
    (fma (* (- y 1.0) x_m) z x_m)
    (* x_m (- 1.0 (* (- 1.0 y) z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
	double tmp;
	if (x_m <= 2.12e-35) {
		tmp = fma(((y - 1.0) * x_m), z, x_m);
	} else {
		tmp = x_m * (1.0 - ((1.0 - y) * z));
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z)
	tmp = 0.0
	if (x_m <= 2.12e-35)
		tmp = fma(Float64(Float64(y - 1.0) * x_m), z, x_m);
	else
		tmp = Float64(x_m * Float64(1.0 - Float64(Float64(1.0 - y) * z)));
	end
	return Float64(x_s * tmp)
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[x$95$m, 2.12e-35], N[(N[(N[(y - 1.0), $MachinePrecision] * x$95$m), $MachinePrecision] * z + x$95$m), $MachinePrecision], N[(x$95$m * N[(1.0 - N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 2.12 \cdot 10^{-35}:\\
\;\;\;\;\mathsf{fma}\left(\left(y - 1\right) \cdot x\_m, z, x\_m\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.1199999999999999e-35

    1. Initial program 90.7%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Applied rewrites99.8%

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

    if 2.1199999999999999e-35 < x

    1. Initial program 99.7%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 99.8% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq 3.6 \cdot 10^{-47}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot z, x\_m, x\_m\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.94999999999999997e-12 or 3.59999999999999991e-47 < z

    1. Initial program 92.0%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Applied rewrites99.8%

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

    if -1.94999999999999997e-12 < z < 3.59999999999999991e-47

    1. Initial program 99.9%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Applied rewrites91.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - 1\right) \cdot x, z, x\right)} \]
    3. Taylor expanded in y around inf

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{y} \cdot x, z, x\right) \]
      2. Step-by-step derivation
        1. lift-fma.f64N/A

          \[\leadsto \color{blue}{\left(y \cdot x\right) \cdot z + x} \]
        2. lift-*.f64N/A

          \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot z + x \]
        3. associate-*l*N/A

          \[\leadsto \color{blue}{y \cdot \left(x \cdot z\right)} + x \]
        4. *-commutativeN/A

          \[\leadsto y \cdot \color{blue}{\left(z \cdot x\right)} + x \]
        5. associate-*r*N/A

          \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot x} + x \]
        6. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z, x, x\right)} \]
        7. lower-*.f6499.8

          \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot z}, x, x\right) \]
      3. Applied rewrites99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z, x, x\right)} \]
    5. Recombined 2 regimes into one program.
    6. Add Preprocessing

    Alternative 3: 98.9% accurate, 0.7× speedup?

    \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_0 := \left(z \cdot x\_m\right) \cdot \left(y - 1\right)\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.05:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 0.41:\\ \;\;\;\;\mathsf{fma}\left(y \cdot z, x\_m, x\_m\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \end{array} \]
    x\_m = (fabs.f64 x)
    x\_s = (copysign.f64 #s(literal 1 binary64) x)
    (FPCore (x_s x_m y z)
     :precision binary64
     (let* ((t_0 (* (* z x_m) (- y 1.0))))
       (* x_s (if (<= z -1.05) t_0 (if (<= z 0.41) (fma (* y z) x_m x_m) t_0)))))
    x\_m = fabs(x);
    x\_s = copysign(1.0, x);
    double code(double x_s, double x_m, double y, double z) {
    	double t_0 = (z * x_m) * (y - 1.0);
    	double tmp;
    	if (z <= -1.05) {
    		tmp = t_0;
    	} else if (z <= 0.41) {
    		tmp = fma((y * z), x_m, x_m);
    	} else {
    		tmp = t_0;
    	}
    	return x_s * tmp;
    }
    
    x\_m = abs(x)
    x\_s = copysign(1.0, x)
    function code(x_s, x_m, y, z)
    	t_0 = Float64(Float64(z * x_m) * Float64(y - 1.0))
    	tmp = 0.0
    	if (z <= -1.05)
    		tmp = t_0;
    	elseif (z <= 0.41)
    		tmp = fma(Float64(y * z), x_m, x_m);
    	else
    		tmp = t_0;
    	end
    	return Float64(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[(N[(z * x$95$m), $MachinePrecision] * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.05], t$95$0, If[LessEqual[z, 0.41], N[(N[(y * z), $MachinePrecision] * x$95$m + x$95$m), $MachinePrecision], t$95$0]]), $MachinePrecision]]
    
    \begin{array}{l}
    x\_m = \left|x\right|
    \\
    x\_s = \mathsf{copysign}\left(1, x\right)
    
    \\
    \begin{array}{l}
    t_0 := \left(z \cdot x\_m\right) \cdot \left(y - 1\right)\\
    x\_s \cdot \begin{array}{l}
    \mathbf{if}\;z \leq -1.05:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;z \leq 0.41:\\
    \;\;\;\;\mathsf{fma}\left(y \cdot z, x\_m, x\_m\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -1.05000000000000004 or 0.409999999999999976 < z

      1. Initial program 91.2%

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

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

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

      if -1.05000000000000004 < z < 0.409999999999999976

      1. Initial program 99.9%

        \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
      2. Applied rewrites91.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - 1\right) \cdot x, z, x\right)} \]
      3. Taylor expanded in y around inf

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{y} \cdot x, z, x\right) \]
        2. Step-by-step derivation
          1. lift-fma.f64N/A

            \[\leadsto \color{blue}{\left(y \cdot x\right) \cdot z + x} \]
          2. lift-*.f64N/A

            \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot z + x \]
          3. associate-*l*N/A

            \[\leadsto \color{blue}{y \cdot \left(x \cdot z\right)} + x \]
          4. *-commutativeN/A

            \[\leadsto y \cdot \color{blue}{\left(z \cdot x\right)} + x \]
          5. associate-*r*N/A

            \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot x} + x \]
          6. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z, x, x\right)} \]
          7. lower-*.f6499.0

            \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot z}, x, x\right) \]
        3. Applied rewrites99.0%

          \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z, x, x\right)} \]
      5. Recombined 2 regimes into one program.
      6. Add Preprocessing

      Alternative 4: 94.6% accurate, 0.7× speedup?

      \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_0 := \mathsf{fma}\left(y \cdot z, x\_m, x\_m\right)\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -13800000000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 1:\\ \;\;\;\;x\_m - z \cdot x\_m\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \end{array} \]
      x\_m = (fabs.f64 x)
      x\_s = (copysign.f64 #s(literal 1 binary64) x)
      (FPCore (x_s x_m y z)
       :precision binary64
       (let* ((t_0 (fma (* y z) x_m x_m)))
         (*
          x_s
          (if (<= y -13800000000000.0) t_0 (if (<= y 1.0) (- x_m (* z x_m)) t_0)))))
      x\_m = fabs(x);
      x\_s = copysign(1.0, x);
      double code(double x_s, double x_m, double y, double z) {
      	double t_0 = fma((y * z), x_m, x_m);
      	double tmp;
      	if (y <= -13800000000000.0) {
      		tmp = t_0;
      	} else if (y <= 1.0) {
      		tmp = x_m - (z * x_m);
      	} else {
      		tmp = t_0;
      	}
      	return x_s * tmp;
      }
      
      x\_m = abs(x)
      x\_s = copysign(1.0, x)
      function code(x_s, x_m, y, z)
      	t_0 = fma(Float64(y * z), x_m, x_m)
      	tmp = 0.0
      	if (y <= -13800000000000.0)
      		tmp = t_0;
      	elseif (y <= 1.0)
      		tmp = Float64(x_m - Float64(z * x_m));
      	else
      		tmp = t_0;
      	end
      	return Float64(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[(N[(y * z), $MachinePrecision] * x$95$m + x$95$m), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -13800000000000.0], t$95$0, If[LessEqual[y, 1.0], N[(x$95$m - N[(z * x$95$m), $MachinePrecision]), $MachinePrecision], t$95$0]]), $MachinePrecision]]
      
      \begin{array}{l}
      x\_m = \left|x\right|
      \\
      x\_s = \mathsf{copysign}\left(1, x\right)
      
      \\
      \begin{array}{l}
      t_0 := \mathsf{fma}\left(y \cdot z, x\_m, x\_m\right)\\
      x\_s \cdot \begin{array}{l}
      \mathbf{if}\;y \leq -13800000000000:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;y \leq 1:\\
      \;\;\;\;x\_m - z \cdot x\_m\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -1.38e13 or 1 < y

        1. Initial program 91.2%

          \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
        2. Applied rewrites91.5%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - 1\right) \cdot x, z, x\right)} \]
        3. Taylor expanded in y around inf

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

            \[\leadsto \mathsf{fma}\left(\color{blue}{y} \cdot x, z, x\right) \]
          2. Step-by-step derivation
            1. lift-fma.f64N/A

              \[\leadsto \color{blue}{\left(y \cdot x\right) \cdot z + x} \]
            2. lift-*.f64N/A

              \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot z + x \]
            3. associate-*l*N/A

              \[\leadsto \color{blue}{y \cdot \left(x \cdot z\right)} + x \]
            4. *-commutativeN/A

              \[\leadsto y \cdot \color{blue}{\left(z \cdot x\right)} + x \]
            5. associate-*r*N/A

              \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot x} + x \]
            6. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z, x, x\right)} \]
            7. lower-*.f6490.8

              \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot z}, x, x\right) \]
          3. Applied rewrites90.8%

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

          if -1.38e13 < y < 1

          1. Initial program 99.9%

            \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
          2. Applied rewrites100.0%

            \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - 1\right) \cdot x, z, x\right)} \]
          3. Taylor expanded in y around inf

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{y} \cdot x, z, x\right) \]
            2. Taylor expanded in y around 0

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

                \[\leadsto \color{blue}{x - z \cdot x} \]
            4. Recombined 2 regimes into one program.
            5. Add Preprocessing

            Alternative 5: 94.5% accurate, 0.7× speedup?

            \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_0 := \mathsf{fma}\left(y \cdot x\_m, z, x\_m\right)\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -13800000000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 1:\\ \;\;\;\;x\_m - z \cdot x\_m\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \end{array} \]
            x\_m = (fabs.f64 x)
            x\_s = (copysign.f64 #s(literal 1 binary64) x)
            (FPCore (x_s x_m y z)
             :precision binary64
             (let* ((t_0 (fma (* y x_m) z x_m)))
               (*
                x_s
                (if (<= y -13800000000000.0) t_0 (if (<= y 1.0) (- x_m (* z x_m)) t_0)))))
            x\_m = fabs(x);
            x\_s = copysign(1.0, x);
            double code(double x_s, double x_m, double y, double z) {
            	double t_0 = fma((y * x_m), z, x_m);
            	double tmp;
            	if (y <= -13800000000000.0) {
            		tmp = t_0;
            	} else if (y <= 1.0) {
            		tmp = x_m - (z * x_m);
            	} else {
            		tmp = t_0;
            	}
            	return x_s * tmp;
            }
            
            x\_m = abs(x)
            x\_s = copysign(1.0, x)
            function code(x_s, x_m, y, z)
            	t_0 = fma(Float64(y * x_m), z, x_m)
            	tmp = 0.0
            	if (y <= -13800000000000.0)
            		tmp = t_0;
            	elseif (y <= 1.0)
            		tmp = Float64(x_m - Float64(z * x_m));
            	else
            		tmp = t_0;
            	end
            	return Float64(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[(N[(y * x$95$m), $MachinePrecision] * z + x$95$m), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -13800000000000.0], t$95$0, If[LessEqual[y, 1.0], N[(x$95$m - N[(z * x$95$m), $MachinePrecision]), $MachinePrecision], t$95$0]]), $MachinePrecision]]
            
            \begin{array}{l}
            x\_m = \left|x\right|
            \\
            x\_s = \mathsf{copysign}\left(1, x\right)
            
            \\
            \begin{array}{l}
            t_0 := \mathsf{fma}\left(y \cdot x\_m, z, x\_m\right)\\
            x\_s \cdot \begin{array}{l}
            \mathbf{if}\;y \leq -13800000000000:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;y \leq 1:\\
            \;\;\;\;x\_m - z \cdot x\_m\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0\\
            
            
            \end{array}
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if y < -1.38e13 or 1 < y

              1. Initial program 91.2%

                \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
              2. Applied rewrites91.5%

                \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - 1\right) \cdot x, z, x\right)} \]
              3. Taylor expanded in y around inf

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

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

                if -1.38e13 < y < 1

                1. Initial program 99.9%

                  \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
                2. Applied rewrites100.0%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - 1\right) \cdot x, z, x\right)} \]
                3. Taylor expanded in y around inf

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

                    \[\leadsto \mathsf{fma}\left(\color{blue}{y} \cdot x, z, x\right) \]
                  2. Taylor expanded in y around 0

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

                      \[\leadsto \color{blue}{x - z \cdot x} \]
                  4. Recombined 2 regimes into one program.
                  5. Add Preprocessing

                  Alternative 6: 82.8% 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}\;1 - y \leq -5 \cdot 10^{+30}:\\ \;\;\;\;x\_m \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;1 - y \leq 2 \cdot 10^{+109}:\\ \;\;\;\;x\_m - z \cdot x\_m\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(z \cdot x\_m\right)\\ \end{array} \end{array} \]
                  x\_m = (fabs.f64 x)
                  x\_s = (copysign.f64 #s(literal 1 binary64) x)
                  (FPCore (x_s x_m y z)
                   :precision binary64
                   (*
                    x_s
                    (if (<= (- 1.0 y) -5e+30)
                      (* x_m (* z y))
                      (if (<= (- 1.0 y) 2e+109) (- x_m (* z x_m)) (* y (* z x_m))))))
                  x\_m = fabs(x);
                  x\_s = copysign(1.0, x);
                  double code(double x_s, double x_m, double y, double z) {
                  	double tmp;
                  	if ((1.0 - y) <= -5e+30) {
                  		tmp = x_m * (z * y);
                  	} else if ((1.0 - y) <= 2e+109) {
                  		tmp = x_m - (z * x_m);
                  	} else {
                  		tmp = y * (z * x_m);
                  	}
                  	return x_s * tmp;
                  }
                  
                  x\_m =     private
                  x\_s =     private
                  module fmin_fmax_functions
                      implicit none
                      private
                      public fmax
                      public fmin
                  
                      interface fmax
                          module procedure fmax88
                          module procedure fmax44
                          module procedure fmax84
                          module procedure fmax48
                      end interface
                      interface fmin
                          module procedure fmin88
                          module procedure fmin44
                          module procedure fmin84
                          module procedure fmin48
                      end interface
                  contains
                      real(8) function fmax88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmax44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmax84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmax48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                      end function
                      real(8) function fmin88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmin44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmin84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmin48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                      end function
                  end module
                  
                  real(8) function code(x_s, x_m, y, z)
                  use fmin_fmax_functions
                      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 ((1.0d0 - y) <= (-5d+30)) then
                          tmp = x_m * (z * y)
                      else if ((1.0d0 - y) <= 2d+109) then
                          tmp = x_m - (z * x_m)
                      else
                          tmp = y * (z * 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 ((1.0 - y) <= -5e+30) {
                  		tmp = x_m * (z * y);
                  	} else if ((1.0 - y) <= 2e+109) {
                  		tmp = x_m - (z * x_m);
                  	} else {
                  		tmp = y * (z * 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 (1.0 - y) <= -5e+30:
                  		tmp = x_m * (z * y)
                  	elif (1.0 - y) <= 2e+109:
                  		tmp = x_m - (z * x_m)
                  	else:
                  		tmp = y * (z * x_m)
                  	return x_s * tmp
                  
                  x\_m = abs(x)
                  x\_s = copysign(1.0, x)
                  function code(x_s, x_m, y, z)
                  	tmp = 0.0
                  	if (Float64(1.0 - y) <= -5e+30)
                  		tmp = Float64(x_m * Float64(z * y));
                  	elseif (Float64(1.0 - y) <= 2e+109)
                  		tmp = Float64(x_m - Float64(z * x_m));
                  	else
                  		tmp = Float64(y * Float64(z * 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 ((1.0 - y) <= -5e+30)
                  		tmp = x_m * (z * y);
                  	elseif ((1.0 - y) <= 2e+109)
                  		tmp = x_m - (z * x_m);
                  	else
                  		tmp = y * (z * x_m);
                  	end
                  	tmp_2 = x_s * tmp;
                  end
                  
                  x\_m = N[Abs[x], $MachinePrecision]
                  x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                  code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[N[(1.0 - y), $MachinePrecision], -5e+30], N[(x$95$m * N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 - y), $MachinePrecision], 2e+109], N[(x$95$m - N[(z * x$95$m), $MachinePrecision]), $MachinePrecision], N[(y * N[(z * x$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
                  
                  \begin{array}{l}
                  x\_m = \left|x\right|
                  \\
                  x\_s = \mathsf{copysign}\left(1, x\right)
                  
                  \\
                  x\_s \cdot \begin{array}{l}
                  \mathbf{if}\;1 - y \leq -5 \cdot 10^{+30}:\\
                  \;\;\;\;x\_m \cdot \left(z \cdot y\right)\\
                  
                  \mathbf{elif}\;1 - y \leq 2 \cdot 10^{+109}:\\
                  \;\;\;\;x\_m - z \cdot x\_m\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;y \cdot \left(z \cdot x\_m\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if (-.f64 #s(literal 1 binary64) y) < -4.9999999999999998e30

                    1. Initial program 91.4%

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

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

                        \[\leadsto x \cdot \left(z \cdot \color{blue}{y}\right) \]
                      2. *-rgt-identityN/A

                        \[\leadsto x \cdot \left(\left(z \cdot 1\right) \cdot y\right) \]
                      3. lower-*.f64N/A

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

                        \[\leadsto x \cdot \left(z \cdot y\right) \]
                    4. Applied rewrites68.5%

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

                    if -4.9999999999999998e30 < (-.f64 #s(literal 1 binary64) y) < 1.99999999999999996e109

                    1. Initial program 99.2%

                      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
                    2. Applied rewrites99.2%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - 1\right) \cdot x, z, x\right)} \]
                    3. Taylor expanded in y around inf

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

                        \[\leadsto \mathsf{fma}\left(\color{blue}{y} \cdot x, z, x\right) \]
                      2. Taylor expanded in y around 0

                        \[\leadsto \color{blue}{x + -1 \cdot \left(x \cdot z\right)} \]
                      3. Step-by-step derivation
                        1. Applied rewrites89.6%

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

                        if 1.99999999999999996e109 < (-.f64 #s(literal 1 binary64) y)

                        1. Initial program 88.4%

                          \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
                        2. Applied rewrites87.8%

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

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

                            \[\leadsto \color{blue}{y} \cdot \left(z \cdot x\right) \]
                        5. Recombined 3 regimes into one program.
                        6. Add Preprocessing

                        Alternative 7: 81.9% accurate, 0.6× 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(z \cdot y\right)\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;1 - y \leq -5 \cdot 10^{+30}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;1 - y \leq 2 \cdot 10^{+109}:\\ \;\;\;\;x\_m - z \cdot x\_m\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \end{array} \]
                        x\_m = (fabs.f64 x)
                        x\_s = (copysign.f64 #s(literal 1 binary64) x)
                        (FPCore (x_s x_m y z)
                         :precision binary64
                         (let* ((t_0 (* x_m (* z y))))
                           (*
                            x_s
                            (if (<= (- 1.0 y) -5e+30)
                              t_0
                              (if (<= (- 1.0 y) 2e+109) (- x_m (* z x_m)) t_0)))))
                        x\_m = fabs(x);
                        x\_s = copysign(1.0, x);
                        double code(double x_s, double x_m, double y, double z) {
                        	double t_0 = x_m * (z * y);
                        	double tmp;
                        	if ((1.0 - y) <= -5e+30) {
                        		tmp = t_0;
                        	} else if ((1.0 - y) <= 2e+109) {
                        		tmp = x_m - (z * x_m);
                        	} else {
                        		tmp = t_0;
                        	}
                        	return x_s * tmp;
                        }
                        
                        x\_m =     private
                        x\_s =     private
                        module fmin_fmax_functions
                            implicit none
                            private
                            public fmax
                            public fmin
                        
                            interface fmax
                                module procedure fmax88
                                module procedure fmax44
                                module procedure fmax84
                                module procedure fmax48
                            end interface
                            interface fmin
                                module procedure fmin88
                                module procedure fmin44
                                module procedure fmin84
                                module procedure fmin48
                            end interface
                        contains
                            real(8) function fmax88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmax44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmax84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmax48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                            end function
                            real(8) function fmin88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmin44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmin84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmin48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                            end function
                        end module
                        
                        real(8) function code(x_s, x_m, y, z)
                        use fmin_fmax_functions
                            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 * (z * y)
                            if ((1.0d0 - y) <= (-5d+30)) then
                                tmp = t_0
                            else if ((1.0d0 - y) <= 2d+109) then
                                tmp = x_m - (z * x_m)
                            else
                                tmp = t_0
                            end if
                            code = x_s * tmp
                        end function
                        
                        x\_m = Math.abs(x);
                        x\_s = Math.copySign(1.0, x);
                        public static double code(double x_s, double x_m, double y, double z) {
                        	double t_0 = x_m * (z * y);
                        	double tmp;
                        	if ((1.0 - y) <= -5e+30) {
                        		tmp = t_0;
                        	} else if ((1.0 - y) <= 2e+109) {
                        		tmp = x_m - (z * x_m);
                        	} else {
                        		tmp = t_0;
                        	}
                        	return x_s * tmp;
                        }
                        
                        x\_m = math.fabs(x)
                        x\_s = math.copysign(1.0, x)
                        def code(x_s, x_m, y, z):
                        	t_0 = x_m * (z * y)
                        	tmp = 0
                        	if (1.0 - y) <= -5e+30:
                        		tmp = t_0
                        	elif (1.0 - y) <= 2e+109:
                        		tmp = x_m - (z * x_m)
                        	else:
                        		tmp = t_0
                        	return x_s * tmp
                        
                        x\_m = abs(x)
                        x\_s = copysign(1.0, x)
                        function code(x_s, x_m, y, z)
                        	t_0 = Float64(x_m * Float64(z * y))
                        	tmp = 0.0
                        	if (Float64(1.0 - y) <= -5e+30)
                        		tmp = t_0;
                        	elseif (Float64(1.0 - y) <= 2e+109)
                        		tmp = Float64(x_m - Float64(z * x_m));
                        	else
                        		tmp = t_0;
                        	end
                        	return Float64(x_s * tmp)
                        end
                        
                        x\_m = abs(x);
                        x\_s = sign(x) * abs(1.0);
                        function tmp_2 = code(x_s, x_m, y, z)
                        	t_0 = x_m * (z * y);
                        	tmp = 0.0;
                        	if ((1.0 - y) <= -5e+30)
                        		tmp = t_0;
                        	elseif ((1.0 - y) <= 2e+109)
                        		tmp = x_m - (z * x_m);
                        	else
                        		tmp = t_0;
                        	end
                        	tmp_2 = x_s * tmp;
                        end
                        
                        x\_m = N[Abs[x], $MachinePrecision]
                        x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                        code[x$95$s_, x$95$m_, y_, z_] := Block[{t$95$0 = N[(x$95$m * N[(z * y), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[N[(1.0 - y), $MachinePrecision], -5e+30], t$95$0, If[LessEqual[N[(1.0 - y), $MachinePrecision], 2e+109], N[(x$95$m - N[(z * x$95$m), $MachinePrecision]), $MachinePrecision], t$95$0]]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        x\_m = \left|x\right|
                        \\
                        x\_s = \mathsf{copysign}\left(1, x\right)
                        
                        \\
                        \begin{array}{l}
                        t_0 := x\_m \cdot \left(z \cdot y\right)\\
                        x\_s \cdot \begin{array}{l}
                        \mathbf{if}\;1 - y \leq -5 \cdot 10^{+30}:\\
                        \;\;\;\;t\_0\\
                        
                        \mathbf{elif}\;1 - y \leq 2 \cdot 10^{+109}:\\
                        \;\;\;\;x\_m - z \cdot x\_m\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;t\_0\\
                        
                        
                        \end{array}
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if (-.f64 #s(literal 1 binary64) y) < -4.9999999999999998e30 or 1.99999999999999996e109 < (-.f64 #s(literal 1 binary64) y)

                          1. Initial program 90.1%

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

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

                              \[\leadsto x \cdot \left(z \cdot \color{blue}{y}\right) \]
                            2. *-rgt-identityN/A

                              \[\leadsto x \cdot \left(\left(z \cdot 1\right) \cdot y\right) \]
                            3. lower-*.f64N/A

                              \[\leadsto x \cdot \left(\left(z \cdot 1\right) \cdot \color{blue}{y}\right) \]
                            4. *-rgt-identity69.7

                              \[\leadsto x \cdot \left(z \cdot y\right) \]
                          4. Applied rewrites69.7%

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

                          if -4.9999999999999998e30 < (-.f64 #s(literal 1 binary64) y) < 1.99999999999999996e109

                          1. Initial program 99.2%

                            \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
                          2. Applied rewrites99.2%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - 1\right) \cdot x, z, x\right)} \]
                          3. Taylor expanded in y around inf

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

                              \[\leadsto \mathsf{fma}\left(\color{blue}{y} \cdot x, z, x\right) \]
                            2. Taylor expanded in y around 0

                              \[\leadsto \color{blue}{x + -1 \cdot \left(x \cdot z\right)} \]
                            3. Step-by-step derivation
                              1. Applied rewrites89.6%

                                \[\leadsto \color{blue}{x - z \cdot x} \]
                            4. Recombined 2 regimes into one program.
                            5. Add Preprocessing

                            Alternative 8: 65.1% accurate, 1.8× speedup?

                            \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \left(x\_m - z \cdot x\_m\right) \end{array} \]
                            x\_m = (fabs.f64 x)
                            x\_s = (copysign.f64 #s(literal 1 binary64) x)
                            (FPCore (x_s x_m y z) :precision binary64 (* x_s (- 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) {
                            	return x_s * (x_m - (z * x_m));
                            }
                            
                            x\_m =     private
                            x\_s =     private
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(x_s, x_m, y, z)
                            use fmin_fmax_functions
                                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 - (z * 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 - (z * 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 - (z * x_m))
                            
                            x\_m = abs(x)
                            x\_s = copysign(1.0, x)
                            function code(x_s, x_m, y, z)
                            	return Float64(x_s * Float64(x_m - Float64(z * 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 - (z * 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 * N[(x$95$m - N[(z * x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                            
                            \begin{array}{l}
                            x\_m = \left|x\right|
                            \\
                            x\_s = \mathsf{copysign}\left(1, x\right)
                            
                            \\
                            x\_s \cdot \left(x\_m - z \cdot x\_m\right)
                            \end{array}
                            
                            Derivation
                            1. Initial program 95.6%

                              \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
                            2. Applied rewrites95.8%

                              \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - 1\right) \cdot x, z, x\right)} \]
                            3. Taylor expanded in y around inf

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

                                \[\leadsto \mathsf{fma}\left(\color{blue}{y} \cdot x, z, x\right) \]
                              2. Taylor expanded in y around 0

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

                                  \[\leadsto \color{blue}{x - z \cdot x} \]
                                2. Add Preprocessing

                                Alternative 9: 64.2% accurate, 1.0× 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(-z\right)\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;x\_m\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \end{array} \]
                                x\_m = (fabs.f64 x)
                                x\_s = (copysign.f64 #s(literal 1 binary64) x)
                                (FPCore (x_s x_m y z)
                                 :precision binary64
                                 (let* ((t_0 (* x_m (- z))))
                                   (* x_s (if (<= z -1.0) t_0 (if (<= z 1.0) x_m t_0)))))
                                x\_m = fabs(x);
                                x\_s = copysign(1.0, x);
                                double code(double x_s, double x_m, double y, double z) {
                                	double t_0 = x_m * -z;
                                	double tmp;
                                	if (z <= -1.0) {
                                		tmp = t_0;
                                	} else if (z <= 1.0) {
                                		tmp = x_m;
                                	} else {
                                		tmp = t_0;
                                	}
                                	return x_s * tmp;
                                }
                                
                                x\_m =     private
                                x\_s =     private
                                module fmin_fmax_functions
                                    implicit none
                                    private
                                    public fmax
                                    public fmin
                                
                                    interface fmax
                                        module procedure fmax88
                                        module procedure fmax44
                                        module procedure fmax84
                                        module procedure fmax48
                                    end interface
                                    interface fmin
                                        module procedure fmin88
                                        module procedure fmin44
                                        module procedure fmin84
                                        module procedure fmin48
                                    end interface
                                contains
                                    real(8) function fmax88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmax44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmax84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmax48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmin44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmin48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                    end function
                                end module
                                
                                real(8) function code(x_s, x_m, y, z)
                                use fmin_fmax_functions
                                    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 * -z
                                    if (z <= (-1.0d0)) then
                                        tmp = t_0
                                    else if (z <= 1.0d0) then
                                        tmp = x_m
                                    else
                                        tmp = t_0
                                    end if
                                    code = x_s * tmp
                                end function
                                
                                x\_m = Math.abs(x);
                                x\_s = Math.copySign(1.0, x);
                                public static double code(double x_s, double x_m, double y, double z) {
                                	double t_0 = x_m * -z;
                                	double tmp;
                                	if (z <= -1.0) {
                                		tmp = t_0;
                                	} else if (z <= 1.0) {
                                		tmp = x_m;
                                	} else {
                                		tmp = t_0;
                                	}
                                	return x_s * tmp;
                                }
                                
                                x\_m = math.fabs(x)
                                x\_s = math.copysign(1.0, x)
                                def code(x_s, x_m, y, z):
                                	t_0 = x_m * -z
                                	tmp = 0
                                	if z <= -1.0:
                                		tmp = t_0
                                	elif z <= 1.0:
                                		tmp = x_m
                                	else:
                                		tmp = t_0
                                	return x_s * tmp
                                
                                x\_m = abs(x)
                                x\_s = copysign(1.0, x)
                                function code(x_s, x_m, y, z)
                                	t_0 = Float64(x_m * Float64(-z))
                                	tmp = 0.0
                                	if (z <= -1.0)
                                		tmp = t_0;
                                	elseif (z <= 1.0)
                                		tmp = x_m;
                                	else
                                		tmp = t_0;
                                	end
                                	return Float64(x_s * tmp)
                                end
                                
                                x\_m = abs(x);
                                x\_s = sign(x) * abs(1.0);
                                function tmp_2 = code(x_s, x_m, y, z)
                                	t_0 = x_m * -z;
                                	tmp = 0.0;
                                	if (z <= -1.0)
                                		tmp = t_0;
                                	elseif (z <= 1.0)
                                		tmp = x_m;
                                	else
                                		tmp = t_0;
                                	end
                                	tmp_2 = x_s * tmp;
                                end
                                
                                x\_m = N[Abs[x], $MachinePrecision]
                                x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                code[x$95$s_, x$95$m_, y_, z_] := Block[{t$95$0 = N[(x$95$m * (-z)), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.0], t$95$0, If[LessEqual[z, 1.0], x$95$m, t$95$0]]), $MachinePrecision]]
                                
                                \begin{array}{l}
                                x\_m = \left|x\right|
                                \\
                                x\_s = \mathsf{copysign}\left(1, x\right)
                                
                                \\
                                \begin{array}{l}
                                t_0 := x\_m \cdot \left(-z\right)\\
                                x\_s \cdot \begin{array}{l}
                                \mathbf{if}\;z \leq -1:\\
                                \;\;\;\;t\_0\\
                                
                                \mathbf{elif}\;z \leq 1:\\
                                \;\;\;\;x\_m\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;t\_0\\
                                
                                
                                \end{array}
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if z < -1 or 1 < z

                                  1. Initial program 91.2%

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

                                    \[\leadsto x \cdot \color{blue}{\left(z \cdot \left(y - 1\right)\right)} \]
                                  3. Step-by-step derivation
                                    1. lft-mult-inverseN/A

                                      \[\leadsto x \cdot \left(z \cdot \left(y - \frac{1}{z} \cdot \color{blue}{z}\right)\right) \]
                                    2. metadata-evalN/A

                                      \[\leadsto x \cdot \left(z \cdot \left(y - \frac{\mathsf{neg}\left(-1\right)}{z} \cdot z\right)\right) \]
                                    3. distribute-frac-negN/A

                                      \[\leadsto x \cdot \left(z \cdot \left(y - \left(\mathsf{neg}\left(\frac{-1}{z}\right)\right) \cdot z\right)\right) \]
                                    4. fp-cancel-sign-subN/A

                                      \[\leadsto x \cdot \left(z \cdot \left(y + \color{blue}{\frac{-1}{z} \cdot z}\right)\right) \]
                                    5. *-rgt-identityN/A

                                      \[\leadsto x \cdot \left(z \cdot \left(y + \frac{-1}{z} \cdot \left(z \cdot \color{blue}{1}\right)\right)\right) \]
                                    6. *-commutativeN/A

                                      \[\leadsto x \cdot \left(z \cdot \left(y + \left(z \cdot 1\right) \cdot \color{blue}{\frac{-1}{z}}\right)\right) \]
                                    7. *-rgt-identityN/A

                                      \[\leadsto x \cdot \left(z \cdot \left(y + z \cdot \frac{\color{blue}{-1}}{z}\right)\right) \]
                                    8. metadata-evalN/A

                                      \[\leadsto x \cdot \left(z \cdot \left(y + z \cdot \frac{\mathsf{neg}\left(1\right)}{z}\right)\right) \]
                                    9. distribute-neg-fracN/A

                                      \[\leadsto x \cdot \left(z \cdot \left(y + z \cdot \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right) \]
                                    10. distribute-rgt-neg-inN/A

                                      \[\leadsto x \cdot \left(z \cdot \left(y + \left(\mathsf{neg}\left(z \cdot \frac{1}{z}\right)\right)\right)\right) \]
                                    11. rgt-mult-inverseN/A

                                      \[\leadsto x \cdot \left(z \cdot \left(y + \left(\mathsf{neg}\left(1\right)\right)\right)\right) \]
                                    12. metadata-evalN/A

                                      \[\leadsto x \cdot \left(z \cdot \left(y + -1\right)\right) \]
                                    13. remove-double-negN/A

                                      \[\leadsto x \cdot \left(z \cdot \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(y\right)\right)\right)\right) + -1\right)\right) \]
                                    14. metadata-evalN/A

                                      \[\leadsto x \cdot \left(z \cdot \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(y\right)\right)\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right) \]
                                    15. distribute-neg-outN/A

                                      \[\leadsto x \cdot \left(z \cdot \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(y\right)\right) + 1\right)\right)\right)\right) \]
                                    16. +-commutativeN/A

                                      \[\leadsto x \cdot \left(z \cdot \left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(y\right)\right)\right)\right)\right)\right) \]
                                    17. mul-1-negN/A

                                      \[\leadsto x \cdot \left(z \cdot \left(\mathsf{neg}\left(\left(1 + -1 \cdot y\right)\right)\right)\right) \]
                                    18. metadata-evalN/A

                                      \[\leadsto x \cdot \left(z \cdot \left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(1\right)\right) \cdot y\right)\right)\right)\right) \]
                                    19. cancel-sign-sub-invN/A

                                      \[\leadsto x \cdot \left(z \cdot \left(\mathsf{neg}\left(\left(1 - 1 \cdot y\right)\right)\right)\right) \]
                                    20. *-lft-identityN/A

                                      \[\leadsto x \cdot \left(z \cdot \left(\mathsf{neg}\left(\left(1 - y\right)\right)\right)\right) \]
                                    21. distribute-rgt-neg-outN/A

                                      \[\leadsto x \cdot \left(\mathsf{neg}\left(z \cdot \left(1 - y\right)\right)\right) \]
                                  4. Applied rewrites90.2%

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

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

                                      \[\leadsto x \cdot \left(\mathsf{neg}\left(z\right)\right) \]
                                    2. lower-neg.f6454.9

                                      \[\leadsto x \cdot \left(-z\right) \]
                                  7. Applied rewrites54.9%

                                    \[\leadsto x \cdot \left(-z\right) \]

                                  if -1 < z < 1

                                  1. Initial program 99.9%

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

                                    \[\leadsto \color{blue}{x} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites73.2%

                                      \[\leadsto \color{blue}{x} \]
                                  4. Recombined 2 regimes into one program.
                                  5. Add Preprocessing

                                  Alternative 10: 38.9% accurate, 12.1× 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 #s(literal 1 binary64) x)
                                  (FPCore (x_s x_m y z) :precision binary64 (* x_s x_m))
                                  x\_m = fabs(x);
                                  x\_s = copysign(1.0, x);
                                  double code(double x_s, double x_m, double y, double z) {
                                  	return x_s * x_m;
                                  }
                                  
                                  x\_m =     private
                                  x\_s =     private
                                  module fmin_fmax_functions
                                      implicit none
                                      private
                                      public fmax
                                      public fmin
                                  
                                      interface fmax
                                          module procedure fmax88
                                          module procedure fmax44
                                          module procedure fmax84
                                          module procedure fmax48
                                      end interface
                                      interface fmin
                                          module procedure fmin88
                                          module procedure fmin44
                                          module procedure fmin84
                                          module procedure fmin48
                                      end interface
                                  contains
                                      real(8) function fmax88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmax44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmax84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmax48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmin44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmin48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                      end function
                                  end module
                                  
                                  real(8) function code(x_s, x_m, y, z)
                                  use fmin_fmax_functions
                                      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 95.6%

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

                                    \[\leadsto \color{blue}{x} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites38.9%

                                      \[\leadsto \color{blue}{x} \]
                                    2. Add Preprocessing

                                    Reproduce

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