System.Random.MWC.Distributions:gamma from mwc-random-0.13.3.2

Percentage Accurate: 99.9% → 99.9%
Time: 5.6s
Alternatives: 10
Speedup: 1.0×

Specification

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

\\
x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log 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 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: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

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

    \[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-+.f64N/A

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

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

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

      \[\leadsto \color{blue}{\left(\left(1 - z\right) + \log z\right) \cdot y} + x \cdot \frac{1}{2} \]
    5. lower-fma.f6499.9

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - z\right) + \log z, y, x \cdot 0.5\right)} \]
    6. lift-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 - z\right) + \log z}, y, x \cdot \frac{1}{2}\right) \]
    7. +-commutativeN/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\log z + \left(1 - z\right)}, y, x \cdot \frac{1}{2}\right) \]
    8. lift--.f64N/A

      \[\leadsto \mathsf{fma}\left(\log z + \color{blue}{\left(1 - z\right)}, y, x \cdot \frac{1}{2}\right) \]
    9. associate-+r-N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right) - z}, y, x \cdot \frac{1}{2}\right) \]
    10. lower--.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right) - z}, y, x \cdot \frac{1}{2}\right) \]
    11. lower-+.f6499.9

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right)} - z, y, x \cdot 0.5\right) \]
    12. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{x \cdot \frac{1}{2}}\right) \]
    13. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{\frac{1}{2} \cdot x}\right) \]
    14. lower-*.f6499.9

      \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{0.5 \cdot x}\right) \]
  4. Applied rewrites99.9%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\log z + 1\right) - z, y, 0.5 \cdot x\right)} \]
  5. Add Preprocessing

Alternative 2: 74.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(1 - z\right) + \log z\\ \mathbf{if}\;t\_0 \leq -220 \lor \neg \left(t\_0 \leq -108\right):\\ \;\;\;\;\mathsf{fma}\left(-z, y, 0.5 \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log z, y, y\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (+ (- 1.0 z) (log z))))
   (if (or (<= t_0 -220.0) (not (<= t_0 -108.0)))
     (fma (- z) y (* 0.5 x))
     (fma (log z) y y))))
double code(double x, double y, double z) {
	double t_0 = (1.0 - z) + log(z);
	double tmp;
	if ((t_0 <= -220.0) || !(t_0 <= -108.0)) {
		tmp = fma(-z, y, (0.5 * x));
	} else {
		tmp = fma(log(z), y, y);
	}
	return tmp;
}
function code(x, y, z)
	t_0 = Float64(Float64(1.0 - z) + log(z))
	tmp = 0.0
	if ((t_0 <= -220.0) || !(t_0 <= -108.0))
		tmp = fma(Float64(-z), y, Float64(0.5 * x));
	else
		tmp = fma(log(z), y, y);
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(1.0 - z), $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -220.0], N[Not[LessEqual[t$95$0, -108.0]], $MachinePrecision]], N[((-z) * y + N[(0.5 * x), $MachinePrecision]), $MachinePrecision], N[(N[Log[z], $MachinePrecision] * y + y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(1 - z\right) + \log z\\
\mathbf{if}\;t\_0 \leq -220 \lor \neg \left(t\_0 \leq -108\right):\\
\;\;\;\;\mathsf{fma}\left(-z, y, 0.5 \cdot x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log z, y, y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (-.f64 #s(literal 1 binary64) z) (log.f64 z)) < -220 or -108 < (+.f64 (-.f64 #s(literal 1 binary64) z) (log.f64 z))

    1. Initial program 99.9%

      \[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

        \[\leadsto \color{blue}{\left(\left(1 - z\right) + \log z\right) \cdot y} + x \cdot \frac{1}{2} \]
      5. lower-fma.f6499.9

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - z\right) + \log z, y, x \cdot 0.5\right)} \]
      6. lift-+.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 - z\right) + \log z}, y, x \cdot \frac{1}{2}\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\log z + \left(1 - z\right)}, y, x \cdot \frac{1}{2}\right) \]
      8. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(\log z + \color{blue}{\left(1 - z\right)}, y, x \cdot \frac{1}{2}\right) \]
      9. associate-+r-N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right) - z}, y, x \cdot \frac{1}{2}\right) \]
      10. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right) - z}, y, x \cdot \frac{1}{2}\right) \]
      11. lower-+.f6499.9

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right)} - z, y, x \cdot 0.5\right) \]
      12. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{x \cdot \frac{1}{2}}\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{\frac{1}{2} \cdot x}\right) \]
      14. lower-*.f6499.9

        \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{0.5 \cdot x}\right) \]
    4. Applied rewrites99.9%

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(z\right)}, y, \frac{1}{2} \cdot x\right) \]
      2. lower-neg.f6481.9

        \[\leadsto \mathsf{fma}\left(\color{blue}{-z}, y, 0.5 \cdot x\right) \]
    7. Applied rewrites81.9%

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

    if -220 < (+.f64 (-.f64 #s(literal 1 binary64) z) (log.f64 z)) < -108

    1. Initial program 99.6%

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

      \[\leadsto \color{blue}{y \cdot \left(\left(1 + \log z\right) - z\right)} \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto y \cdot \color{blue}{\left(1 + \left(\log z - z\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto y \cdot \color{blue}{\left(\left(\log z - z\right) + 1\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \color{blue}{\left(\log z - z\right) \cdot y + 1 \cdot y} \]
      4. *-lft-identityN/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\log z - z, y, y\right)} \]
      6. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\log z - z}, y, y\right) \]
      7. lower-log.f6474.3

        \[\leadsto \mathsf{fma}\left(\color{blue}{\log z} - z, y, y\right) \]
    5. Applied rewrites74.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\log z - z, y, y\right)} \]
    6. Step-by-step derivation
      1. Applied rewrites74.1%

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

        \[\leadsto \log z \cdot y + y \]
      3. Step-by-step derivation
        1. Applied rewrites74.1%

          \[\leadsto \log z \cdot y + y \]
        2. Step-by-step derivation
          1. Applied rewrites74.3%

            \[\leadsto \mathsf{fma}\left(\log z, \color{blue}{y}, y\right) \]
        3. Recombined 2 regimes into one program.
        4. Final simplification81.2%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\left(1 - z\right) + \log z \leq -220 \lor \neg \left(\left(1 - z\right) + \log z \leq -108\right):\\ \;\;\;\;\mathsf{fma}\left(-z, y, 0.5 \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log z, y, y\right)\\ \end{array} \]
        5. Add Preprocessing

        Alternative 3: 86.3% accurate, 1.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -9 \cdot 10^{-49} \lor \neg \left(x \leq 1.5 \cdot 10^{-61}\right):\\ \;\;\;\;\mathsf{fma}\left(-z, y, 0.5 \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(1 + \log z\right) - z\right) \cdot y\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (if (or (<= x -9e-49) (not (<= x 1.5e-61)))
           (fma (- z) y (* 0.5 x))
           (* (- (+ 1.0 (log z)) z) y)))
        double code(double x, double y, double z) {
        	double tmp;
        	if ((x <= -9e-49) || !(x <= 1.5e-61)) {
        		tmp = fma(-z, y, (0.5 * x));
        	} else {
        		tmp = ((1.0 + log(z)) - z) * y;
        	}
        	return tmp;
        }
        
        function code(x, y, z)
        	tmp = 0.0
        	if ((x <= -9e-49) || !(x <= 1.5e-61))
        		tmp = fma(Float64(-z), y, Float64(0.5 * x));
        	else
        		tmp = Float64(Float64(Float64(1.0 + log(z)) - z) * y);
        	end
        	return tmp
        end
        
        code[x_, y_, z_] := If[Or[LessEqual[x, -9e-49], N[Not[LessEqual[x, 1.5e-61]], $MachinePrecision]], N[((-z) * y + N[(0.5 * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[Log[z], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] * y), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;x \leq -9 \cdot 10^{-49} \lor \neg \left(x \leq 1.5 \cdot 10^{-61}\right):\\
        \;\;\;\;\mathsf{fma}\left(-z, y, 0.5 \cdot x\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(\left(1 + \log z\right) - z\right) \cdot y\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if x < -9.0000000000000004e-49 or 1.50000000000000006e-61 < x

          1. Initial program 100.0%

            \[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right) \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-+.f64N/A

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

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

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

              \[\leadsto \color{blue}{\left(\left(1 - z\right) + \log z\right) \cdot y} + x \cdot \frac{1}{2} \]
            5. lower-fma.f64100.0

              \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - z\right) + \log z, y, x \cdot 0.5\right)} \]
            6. lift-+.f64N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 - z\right) + \log z}, y, x \cdot \frac{1}{2}\right) \]
            7. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\log z + \left(1 - z\right)}, y, x \cdot \frac{1}{2}\right) \]
            8. lift--.f64N/A

              \[\leadsto \mathsf{fma}\left(\log z + \color{blue}{\left(1 - z\right)}, y, x \cdot \frac{1}{2}\right) \]
            9. associate-+r-N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right) - z}, y, x \cdot \frac{1}{2}\right) \]
            10. lower--.f64N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right) - z}, y, x \cdot \frac{1}{2}\right) \]
            11. lower-+.f64100.0

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right)} - z, y, x \cdot 0.5\right) \]
            12. lift-*.f64N/A

              \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{x \cdot \frac{1}{2}}\right) \]
            13. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{\frac{1}{2} \cdot x}\right) \]
            14. lower-*.f64100.0

              \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{0.5 \cdot x}\right) \]
          4. Applied rewrites100.0%

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

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(z\right)}, y, \frac{1}{2} \cdot x\right) \]
            2. lower-neg.f6487.6

              \[\leadsto \mathsf{fma}\left(\color{blue}{-z}, y, 0.5 \cdot x\right) \]
          7. Applied rewrites87.6%

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

          if -9.0000000000000004e-49 < x < 1.50000000000000006e-61

          1. Initial program 99.9%

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

            \[\leadsto \color{blue}{y \cdot \left(\left(1 + \log z\right) - z\right)} \]
          4. Step-by-step derivation
            1. associate--l+N/A

              \[\leadsto y \cdot \color{blue}{\left(1 + \left(\log z - z\right)\right)} \]
            2. +-commutativeN/A

              \[\leadsto y \cdot \color{blue}{\left(\left(\log z - z\right) + 1\right)} \]
            3. distribute-rgt-inN/A

              \[\leadsto \color{blue}{\left(\log z - z\right) \cdot y + 1 \cdot y} \]
            4. *-lft-identityN/A

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(\log z - z, y, y\right)} \]
            6. lower--.f64N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\log z - z}, y, y\right) \]
            7. lower-log.f6487.5

              \[\leadsto \mathsf{fma}\left(\color{blue}{\log z} - z, y, y\right) \]
          5. Applied rewrites87.5%

            \[\leadsto \color{blue}{\mathsf{fma}\left(\log z - z, y, y\right)} \]
          6. Step-by-step derivation
            1. Applied rewrites87.6%

              \[\leadsto \left(\left(1 + \log z\right) - z\right) \cdot \color{blue}{y} \]
          7. Recombined 2 regimes into one program.
          8. Final simplification87.6%

            \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9 \cdot 10^{-49} \lor \neg \left(x \leq 1.5 \cdot 10^{-61}\right):\\ \;\;\;\;\mathsf{fma}\left(-z, y, 0.5 \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(1 + \log z\right) - z\right) \cdot y\\ \end{array} \]
          9. Add Preprocessing

          Alternative 4: 86.3% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -9 \cdot 10^{-49} \lor \neg \left(x \leq 1.5 \cdot 10^{-61}\right):\\ \;\;\;\;\mathsf{fma}\left(-z, y, 0.5 \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log z - z, y, y\right)\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (if (or (<= x -9e-49) (not (<= x 1.5e-61)))
             (fma (- z) y (* 0.5 x))
             (fma (- (log z) z) y y)))
          double code(double x, double y, double z) {
          	double tmp;
          	if ((x <= -9e-49) || !(x <= 1.5e-61)) {
          		tmp = fma(-z, y, (0.5 * x));
          	} else {
          		tmp = fma((log(z) - z), y, y);
          	}
          	return tmp;
          }
          
          function code(x, y, z)
          	tmp = 0.0
          	if ((x <= -9e-49) || !(x <= 1.5e-61))
          		tmp = fma(Float64(-z), y, Float64(0.5 * x));
          	else
          		tmp = fma(Float64(log(z) - z), y, y);
          	end
          	return tmp
          end
          
          code[x_, y_, z_] := If[Or[LessEqual[x, -9e-49], N[Not[LessEqual[x, 1.5e-61]], $MachinePrecision]], N[((-z) * y + N[(0.5 * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - z), $MachinePrecision] * y + y), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;x \leq -9 \cdot 10^{-49} \lor \neg \left(x \leq 1.5 \cdot 10^{-61}\right):\\
          \;\;\;\;\mathsf{fma}\left(-z, y, 0.5 \cdot x\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(\log z - z, y, y\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < -9.0000000000000004e-49 or 1.50000000000000006e-61 < x

            1. Initial program 100.0%

              \[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right) \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-+.f64N/A

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

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

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

                \[\leadsto \color{blue}{\left(\left(1 - z\right) + \log z\right) \cdot y} + x \cdot \frac{1}{2} \]
              5. lower-fma.f64100.0

                \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - z\right) + \log z, y, x \cdot 0.5\right)} \]
              6. lift-+.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 - z\right) + \log z}, y, x \cdot \frac{1}{2}\right) \]
              7. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\log z + \left(1 - z\right)}, y, x \cdot \frac{1}{2}\right) \]
              8. lift--.f64N/A

                \[\leadsto \mathsf{fma}\left(\log z + \color{blue}{\left(1 - z\right)}, y, x \cdot \frac{1}{2}\right) \]
              9. associate-+r-N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right) - z}, y, x \cdot \frac{1}{2}\right) \]
              10. lower--.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right) - z}, y, x \cdot \frac{1}{2}\right) \]
              11. lower-+.f64100.0

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right)} - z, y, x \cdot 0.5\right) \]
              12. lift-*.f64N/A

                \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{x \cdot \frac{1}{2}}\right) \]
              13. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{\frac{1}{2} \cdot x}\right) \]
              14. lower-*.f64100.0

                \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{0.5 \cdot x}\right) \]
            4. Applied rewrites100.0%

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

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(z\right)}, y, \frac{1}{2} \cdot x\right) \]
              2. lower-neg.f6487.6

                \[\leadsto \mathsf{fma}\left(\color{blue}{-z}, y, 0.5 \cdot x\right) \]
            7. Applied rewrites87.6%

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

            if -9.0000000000000004e-49 < x < 1.50000000000000006e-61

            1. Initial program 99.9%

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

              \[\leadsto \color{blue}{y \cdot \left(\left(1 + \log z\right) - z\right)} \]
            4. Step-by-step derivation
              1. associate--l+N/A

                \[\leadsto y \cdot \color{blue}{\left(1 + \left(\log z - z\right)\right)} \]
              2. +-commutativeN/A

                \[\leadsto y \cdot \color{blue}{\left(\left(\log z - z\right) + 1\right)} \]
              3. distribute-rgt-inN/A

                \[\leadsto \color{blue}{\left(\log z - z\right) \cdot y + 1 \cdot y} \]
              4. *-lft-identityN/A

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(\log z - z, y, y\right)} \]
              6. lower--.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\log z - z}, y, y\right) \]
              7. lower-log.f6487.5

                \[\leadsto \mathsf{fma}\left(\color{blue}{\log z} - z, y, y\right) \]
            5. Applied rewrites87.5%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\log z - z, y, y\right)} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification87.6%

            \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9 \cdot 10^{-49} \lor \neg \left(x \leq 1.5 \cdot 10^{-61}\right):\\ \;\;\;\;\mathsf{fma}\left(-z, y, 0.5 \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log z - z, y, y\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 5: 98.9% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 0.27:\\ \;\;\;\;\mathsf{fma}\left(\log z + 1, y, 0.5 \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-z, y, 0.5 \cdot x\right)\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (if (<= z 0.27) (fma (+ (log z) 1.0) y (* 0.5 x)) (fma (- z) y (* 0.5 x))))
          double code(double x, double y, double z) {
          	double tmp;
          	if (z <= 0.27) {
          		tmp = fma((log(z) + 1.0), y, (0.5 * x));
          	} else {
          		tmp = fma(-z, y, (0.5 * x));
          	}
          	return tmp;
          }
          
          function code(x, y, z)
          	tmp = 0.0
          	if (z <= 0.27)
          		tmp = fma(Float64(log(z) + 1.0), y, Float64(0.5 * x));
          	else
          		tmp = fma(Float64(-z), y, Float64(0.5 * x));
          	end
          	return tmp
          end
          
          code[x_, y_, z_] := If[LessEqual[z, 0.27], N[(N[(N[Log[z], $MachinePrecision] + 1.0), $MachinePrecision] * y + N[(0.5 * x), $MachinePrecision]), $MachinePrecision], N[((-z) * y + N[(0.5 * x), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;z \leq 0.27:\\
          \;\;\;\;\mathsf{fma}\left(\log z + 1, y, 0.5 \cdot x\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(-z, y, 0.5 \cdot x\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < 0.27000000000000002

            1. Initial program 99.9%

              \[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right) \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-+.f64N/A

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

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

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

                \[\leadsto \color{blue}{\left(\left(1 - z\right) + \log z\right) \cdot y} + x \cdot \frac{1}{2} \]
              5. lower-fma.f6499.9

                \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - z\right) + \log z, y, x \cdot 0.5\right)} \]
              6. lift-+.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 - z\right) + \log z}, y, x \cdot \frac{1}{2}\right) \]
              7. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\log z + \left(1 - z\right)}, y, x \cdot \frac{1}{2}\right) \]
              8. lift--.f64N/A

                \[\leadsto \mathsf{fma}\left(\log z + \color{blue}{\left(1 - z\right)}, y, x \cdot \frac{1}{2}\right) \]
              9. associate-+r-N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right) - z}, y, x \cdot \frac{1}{2}\right) \]
              10. lower--.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right) - z}, y, x \cdot \frac{1}{2}\right) \]
              11. lower-+.f6499.9

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right)} - z, y, x \cdot 0.5\right) \]
              12. lift-*.f64N/A

                \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{x \cdot \frac{1}{2}}\right) \]
              13. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{\frac{1}{2} \cdot x}\right) \]
              14. lower-*.f6499.9

                \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{0.5 \cdot x}\right) \]
            4. Applied rewrites99.9%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\log z + 1\right) - z, y, 0.5 \cdot x\right)} \]
            5. Taylor expanded in z around 0

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{\log z + 1}, y, \frac{1}{2} \cdot x\right) \]
              2. lower-+.f64N/A

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{\log z} + 1, y, 0.5 \cdot x\right) \]
            7. Applied rewrites99.2%

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

            if 0.27000000000000002 < z

            1. Initial program 100.0%

              \[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right) \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-+.f64N/A

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

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

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

                \[\leadsto \color{blue}{\left(\left(1 - z\right) + \log z\right) \cdot y} + x \cdot \frac{1}{2} \]
              5. lower-fma.f64100.0

                \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - z\right) + \log z, y, x \cdot 0.5\right)} \]
              6. lift-+.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 - z\right) + \log z}, y, x \cdot \frac{1}{2}\right) \]
              7. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\log z + \left(1 - z\right)}, y, x \cdot \frac{1}{2}\right) \]
              8. lift--.f64N/A

                \[\leadsto \mathsf{fma}\left(\log z + \color{blue}{\left(1 - z\right)}, y, x \cdot \frac{1}{2}\right) \]
              9. associate-+r-N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right) - z}, y, x \cdot \frac{1}{2}\right) \]
              10. lower--.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right) - z}, y, x \cdot \frac{1}{2}\right) \]
              11. lower-+.f64100.0

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right)} - z, y, x \cdot 0.5\right) \]
              12. lift-*.f64N/A

                \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{x \cdot \frac{1}{2}}\right) \]
              13. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{\frac{1}{2} \cdot x}\right) \]
              14. lower-*.f64100.0

                \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{0.5 \cdot x}\right) \]
            4. Applied rewrites100.0%

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

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(z\right)}, y, \frac{1}{2} \cdot x\right) \]
              2. lower-neg.f6497.5

                \[\leadsto \mathsf{fma}\left(\color{blue}{-z}, y, 0.5 \cdot x\right) \]
            7. Applied rewrites97.5%

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

          Alternative 6: 98.9% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 0.27:\\ \;\;\;\;\mathsf{fma}\left(0.5, x, \mathsf{fma}\left(\log z, y, y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-z, y, 0.5 \cdot x\right)\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (if (<= z 0.27) (fma 0.5 x (fma (log z) y y)) (fma (- z) y (* 0.5 x))))
          double code(double x, double y, double z) {
          	double tmp;
          	if (z <= 0.27) {
          		tmp = fma(0.5, x, fma(log(z), y, y));
          	} else {
          		tmp = fma(-z, y, (0.5 * x));
          	}
          	return tmp;
          }
          
          function code(x, y, z)
          	tmp = 0.0
          	if (z <= 0.27)
          		tmp = fma(0.5, x, fma(log(z), y, y));
          	else
          		tmp = fma(Float64(-z), y, Float64(0.5 * x));
          	end
          	return tmp
          end
          
          code[x_, y_, z_] := If[LessEqual[z, 0.27], N[(0.5 * x + N[(N[Log[z], $MachinePrecision] * y + y), $MachinePrecision]), $MachinePrecision], N[((-z) * y + N[(0.5 * x), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;z \leq 0.27:\\
          \;\;\;\;\mathsf{fma}\left(0.5, x, \mathsf{fma}\left(\log z, y, y\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(-z, y, 0.5 \cdot x\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < 0.27000000000000002

            1. Initial program 99.9%

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

              \[\leadsto \color{blue}{\frac{1}{2} \cdot x + y \cdot \left(1 + \log z\right)} \]
            4. Step-by-step derivation
              1. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{2}, x, y \cdot \left(1 + \log z\right)\right)} \]
              2. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(\frac{1}{2}, x, y \cdot \color{blue}{\left(\log z + 1\right)}\right) \]
              3. distribute-rgt-inN/A

                \[\leadsto \mathsf{fma}\left(\frac{1}{2}, x, \color{blue}{\log z \cdot y + 1 \cdot y}\right) \]
              4. *-lft-identityN/A

                \[\leadsto \mathsf{fma}\left(\frac{1}{2}, x, \log z \cdot y + \color{blue}{y}\right) \]
              5. lower-fma.f64N/A

                \[\leadsto \mathsf{fma}\left(\frac{1}{2}, x, \color{blue}{\mathsf{fma}\left(\log z, y, y\right)}\right) \]
              6. lower-log.f6499.1

                \[\leadsto \mathsf{fma}\left(0.5, x, \mathsf{fma}\left(\color{blue}{\log z}, y, y\right)\right) \]
            5. Applied rewrites99.1%

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

            if 0.27000000000000002 < z

            1. Initial program 100.0%

              \[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right) \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-+.f64N/A

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

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

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

                \[\leadsto \color{blue}{\left(\left(1 - z\right) + \log z\right) \cdot y} + x \cdot \frac{1}{2} \]
              5. lower-fma.f64100.0

                \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - z\right) + \log z, y, x \cdot 0.5\right)} \]
              6. lift-+.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 - z\right) + \log z}, y, x \cdot \frac{1}{2}\right) \]
              7. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\log z + \left(1 - z\right)}, y, x \cdot \frac{1}{2}\right) \]
              8. lift--.f64N/A

                \[\leadsto \mathsf{fma}\left(\log z + \color{blue}{\left(1 - z\right)}, y, x \cdot \frac{1}{2}\right) \]
              9. associate-+r-N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right) - z}, y, x \cdot \frac{1}{2}\right) \]
              10. lower--.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right) - z}, y, x \cdot \frac{1}{2}\right) \]
              11. lower-+.f64100.0

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right)} - z, y, x \cdot 0.5\right) \]
              12. lift-*.f64N/A

                \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{x \cdot \frac{1}{2}}\right) \]
              13. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{\frac{1}{2} \cdot x}\right) \]
              14. lower-*.f64100.0

                \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{0.5 \cdot x}\right) \]
            4. Applied rewrites100.0%

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

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(z\right)}, y, \frac{1}{2} \cdot x\right) \]
              2. lower-neg.f6497.5

                \[\leadsto \mathsf{fma}\left(\color{blue}{-z}, y, 0.5 \cdot x\right) \]
            7. Applied rewrites97.5%

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

          Alternative 7: 60.1% accurate, 7.1× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 28.5:\\ \;\;\;\;0.5 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(-z\right) \cdot y + y\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (if (<= z 28.5) (* 0.5 x) (+ (* (- z) y) y)))
          double code(double x, double y, double z) {
          	double tmp;
          	if (z <= 28.5) {
          		tmp = 0.5 * x;
          	} else {
          		tmp = (-z * y) + 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 (z <= 28.5d0) then
                  tmp = 0.5d0 * x
              else
                  tmp = (-z * y) + y
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z) {
          	double tmp;
          	if (z <= 28.5) {
          		tmp = 0.5 * x;
          	} else {
          		tmp = (-z * y) + y;
          	}
          	return tmp;
          }
          
          def code(x, y, z):
          	tmp = 0
          	if z <= 28.5:
          		tmp = 0.5 * x
          	else:
          		tmp = (-z * y) + y
          	return tmp
          
          function code(x, y, z)
          	tmp = 0.0
          	if (z <= 28.5)
          		tmp = Float64(0.5 * x);
          	else
          		tmp = Float64(Float64(Float64(-z) * y) + y);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z)
          	tmp = 0.0;
          	if (z <= 28.5)
          		tmp = 0.5 * x;
          	else
          		tmp = (-z * y) + y;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_] := If[LessEqual[z, 28.5], N[(0.5 * x), $MachinePrecision], N[(N[((-z) * y), $MachinePrecision] + y), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;z \leq 28.5:\\
          \;\;\;\;0.5 \cdot x\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(-z\right) \cdot y + y\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < 28.5

            1. Initial program 99.9%

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{x}, \left(1 + \log z\right) - z, \frac{1}{2}\right)} \cdot x \]
              8. lower-/.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y}{x}}, \left(1 + \log z\right) - z, \frac{1}{2}\right) \cdot x \]
              9. lower--.f64N/A

                \[\leadsto \mathsf{fma}\left(\frac{y}{x}, \color{blue}{\left(1 + \log z\right) - z}, \frac{1}{2}\right) \cdot x \]
              10. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(\frac{y}{x}, \color{blue}{\left(\log z + 1\right)} - z, \frac{1}{2}\right) \cdot x \]
              11. lower-+.f64N/A

                \[\leadsto \mathsf{fma}\left(\frac{y}{x}, \color{blue}{\left(\log z + 1\right)} - z, \frac{1}{2}\right) \cdot x \]
              12. lower-log.f6493.4

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

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

              \[\leadsto \frac{1}{2} \cdot x \]
            7. Step-by-step derivation
              1. Applied rewrites56.5%

                \[\leadsto 0.5 \cdot x \]

              if 28.5 < z

              1. Initial program 100.0%

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

                \[\leadsto \color{blue}{y \cdot \left(\left(1 + \log z\right) - z\right)} \]
              4. Step-by-step derivation
                1. associate--l+N/A

                  \[\leadsto y \cdot \color{blue}{\left(1 + \left(\log z - z\right)\right)} \]
                2. +-commutativeN/A

                  \[\leadsto y \cdot \color{blue}{\left(\left(\log z - z\right) + 1\right)} \]
                3. distribute-rgt-inN/A

                  \[\leadsto \color{blue}{\left(\log z - z\right) \cdot y + 1 \cdot y} \]
                4. *-lft-identityN/A

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

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\log z - z, y, y\right)} \]
                6. lower--.f64N/A

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\log z - z}, y, y\right) \]
                7. lower-log.f6474.4

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\log z} - z, y, y\right) \]
              5. Applied rewrites74.4%

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

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

                  \[\leadsto \log z \cdot y + y \]
                3. Step-by-step derivation
                  1. Applied rewrites1.5%

                    \[\leadsto \log z \cdot y + y \]
                  2. Taylor expanded in z around inf

                    \[\leadsto \left(-1 \cdot z\right) \cdot y + y \]
                  3. Step-by-step derivation
                    1. Applied rewrites72.5%

                      \[\leadsto \left(-z\right) \cdot y + y \]
                  4. Recombined 2 regimes into one program.
                  5. Add Preprocessing

                  Alternative 8: 60.1% accurate, 8.6× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 28.5:\\ \;\;\;\;0.5 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(-y\right) \cdot z\\ \end{array} \end{array} \]
                  (FPCore (x y z) :precision binary64 (if (<= z 28.5) (* 0.5 x) (* (- y) z)))
                  double code(double x, double y, double z) {
                  	double tmp;
                  	if (z <= 28.5) {
                  		tmp = 0.5 * x;
                  	} else {
                  		tmp = -y * 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 <= 28.5d0) then
                          tmp = 0.5d0 * x
                      else
                          tmp = -y * z
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z) {
                  	double tmp;
                  	if (z <= 28.5) {
                  		tmp = 0.5 * x;
                  	} else {
                  		tmp = -y * z;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z):
                  	tmp = 0
                  	if z <= 28.5:
                  		tmp = 0.5 * x
                  	else:
                  		tmp = -y * z
                  	return tmp
                  
                  function code(x, y, z)
                  	tmp = 0.0
                  	if (z <= 28.5)
                  		tmp = Float64(0.5 * x);
                  	else
                  		tmp = Float64(Float64(-y) * z);
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z)
                  	tmp = 0.0;
                  	if (z <= 28.5)
                  		tmp = 0.5 * x;
                  	else
                  		tmp = -y * z;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_] := If[LessEqual[z, 28.5], N[(0.5 * x), $MachinePrecision], N[((-y) * z), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;z \leq 28.5:\\
                  \;\;\;\;0.5 \cdot x\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\left(-y\right) \cdot z\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if z < 28.5

                    1. Initial program 99.9%

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{x}, \left(1 + \log z\right) - z, \frac{1}{2}\right)} \cdot x \]
                      8. lower-/.f64N/A

                        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y}{x}}, \left(1 + \log z\right) - z, \frac{1}{2}\right) \cdot x \]
                      9. lower--.f64N/A

                        \[\leadsto \mathsf{fma}\left(\frac{y}{x}, \color{blue}{\left(1 + \log z\right) - z}, \frac{1}{2}\right) \cdot x \]
                      10. +-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(\frac{y}{x}, \color{blue}{\left(\log z + 1\right)} - z, \frac{1}{2}\right) \cdot x \]
                      11. lower-+.f64N/A

                        \[\leadsto \mathsf{fma}\left(\frac{y}{x}, \color{blue}{\left(\log z + 1\right)} - z, \frac{1}{2}\right) \cdot x \]
                      12. lower-log.f6493.4

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

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

                      \[\leadsto \frac{1}{2} \cdot x \]
                    7. Step-by-step derivation
                      1. Applied rewrites56.5%

                        \[\leadsto 0.5 \cdot x \]

                      if 28.5 < z

                      1. Initial program 100.0%

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

                        \[\leadsto \color{blue}{-1 \cdot \left(y \cdot z\right)} \]
                      4. Step-by-step derivation
                        1. associate-*r*N/A

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

                          \[\leadsto \color{blue}{\left(-1 \cdot y\right) \cdot z} \]
                        3. mul-1-negN/A

                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(y\right)\right)} \cdot z \]
                        4. lower-neg.f6472.5

                          \[\leadsto \color{blue}{\left(-y\right)} \cdot z \]
                      5. Applied rewrites72.5%

                        \[\leadsto \color{blue}{\left(-y\right) \cdot z} \]
                    8. Recombined 2 regimes into one program.
                    9. Add Preprocessing

                    Alternative 9: 74.8% accurate, 8.6× speedup?

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

                      \[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right) \]
                    2. Add Preprocessing
                    3. Step-by-step derivation
                      1. lift-+.f64N/A

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

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

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

                        \[\leadsto \color{blue}{\left(\left(1 - z\right) + \log z\right) \cdot y} + x \cdot \frac{1}{2} \]
                      5. lower-fma.f6499.9

                        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - z\right) + \log z, y, x \cdot 0.5\right)} \]
                      6. lift-+.f64N/A

                        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 - z\right) + \log z}, y, x \cdot \frac{1}{2}\right) \]
                      7. +-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(\color{blue}{\log z + \left(1 - z\right)}, y, x \cdot \frac{1}{2}\right) \]
                      8. lift--.f64N/A

                        \[\leadsto \mathsf{fma}\left(\log z + \color{blue}{\left(1 - z\right)}, y, x \cdot \frac{1}{2}\right) \]
                      9. associate-+r-N/A

                        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right) - z}, y, x \cdot \frac{1}{2}\right) \]
                      10. lower--.f64N/A

                        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right) - z}, y, x \cdot \frac{1}{2}\right) \]
                      11. lower-+.f6499.9

                        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\log z + 1\right)} - z, y, x \cdot 0.5\right) \]
                      12. lift-*.f64N/A

                        \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{x \cdot \frac{1}{2}}\right) \]
                      13. *-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{\frac{1}{2} \cdot x}\right) \]
                      14. lower-*.f6499.9

                        \[\leadsto \mathsf{fma}\left(\left(\log z + 1\right) - z, y, \color{blue}{0.5 \cdot x}\right) \]
                    4. Applied rewrites99.9%

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

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

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

                        \[\leadsto \mathsf{fma}\left(\color{blue}{-z}, y, 0.5 \cdot x\right) \]
                    7. Applied rewrites77.2%

                      \[\leadsto \mathsf{fma}\left(\color{blue}{-z}, y, 0.5 \cdot x\right) \]
                    8. Add Preprocessing

                    Alternative 10: 40.1% accurate, 20.0× speedup?

                    \[\begin{array}{l} \\ 0.5 \cdot x \end{array} \]
                    (FPCore (x y z) :precision binary64 (* 0.5 x))
                    double code(double x, double y, double z) {
                    	return 0.5 * x;
                    }
                    
                    real(8) function code(x, y, z)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8), intent (in) :: z
                        code = 0.5d0 * x
                    end function
                    
                    public static double code(double x, double y, double z) {
                    	return 0.5 * x;
                    }
                    
                    def code(x, y, z):
                    	return 0.5 * x
                    
                    function code(x, y, z)
                    	return Float64(0.5 * x)
                    end
                    
                    function tmp = code(x, y, z)
                    	tmp = 0.5 * x;
                    end
                    
                    code[x_, y_, z_] := N[(0.5 * x), $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    0.5 \cdot x
                    \end{array}
                    
                    Derivation
                    1. Initial program 99.9%

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{x}, \left(1 + \log z\right) - z, \frac{1}{2}\right)} \cdot x \]
                      8. lower-/.f64N/A

                        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y}{x}}, \left(1 + \log z\right) - z, \frac{1}{2}\right) \cdot x \]
                      9. lower--.f64N/A

                        \[\leadsto \mathsf{fma}\left(\frac{y}{x}, \color{blue}{\left(1 + \log z\right) - z}, \frac{1}{2}\right) \cdot x \]
                      10. +-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(\frac{y}{x}, \color{blue}{\left(\log z + 1\right)} - z, \frac{1}{2}\right) \cdot x \]
                      11. lower-+.f64N/A

                        \[\leadsto \mathsf{fma}\left(\frac{y}{x}, \color{blue}{\left(\log z + 1\right)} - z, \frac{1}{2}\right) \cdot x \]
                      12. lower-log.f6489.2

                        \[\leadsto \mathsf{fma}\left(\frac{y}{x}, \left(\color{blue}{\log z} + 1\right) - z, 0.5\right) \cdot x \]
                    5. Applied rewrites89.2%

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

                      \[\leadsto \frac{1}{2} \cdot x \]
                    7. Step-by-step derivation
                      1. Applied rewrites42.8%

                        \[\leadsto 0.5 \cdot x \]
                      2. Add Preprocessing

                      Developer Target 1: 99.8% accurate, 1.0× speedup?

                      \[\begin{array}{l} \\ \left(y + 0.5 \cdot x\right) - y \cdot \left(z - \log z\right) \end{array} \]
                      (FPCore (x y z) :precision binary64 (- (+ y (* 0.5 x)) (* y (- z (log z)))))
                      double code(double x, double y, double z) {
                      	return (y + (0.5 * x)) - (y * (z - log(z)));
                      }
                      
                      real(8) function code(x, y, z)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          real(8), intent (in) :: z
                          code = (y + (0.5d0 * x)) - (y * (z - log(z)))
                      end function
                      
                      public static double code(double x, double y, double z) {
                      	return (y + (0.5 * x)) - (y * (z - Math.log(z)));
                      }
                      
                      def code(x, y, z):
                      	return (y + (0.5 * x)) - (y * (z - math.log(z)))
                      
                      function code(x, y, z)
                      	return Float64(Float64(y + Float64(0.5 * x)) - Float64(y * Float64(z - log(z))))
                      end
                      
                      function tmp = code(x, y, z)
                      	tmp = (y + (0.5 * x)) - (y * (z - log(z)));
                      end
                      
                      code[x_, y_, z_] := N[(N[(y + N[(0.5 * x), $MachinePrecision]), $MachinePrecision] - N[(y * N[(z - N[Log[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                      
                      \begin{array}{l}
                      
                      \\
                      \left(y + 0.5 \cdot x\right) - y \cdot \left(z - \log z\right)
                      \end{array}
                      

                      Reproduce

                      ?
                      herbie shell --seed 2024332 
                      (FPCore (x y z)
                        :name "System.Random.MWC.Distributions:gamma from mwc-random-0.13.3.2"
                        :precision binary64
                      
                        :alt
                        (! :herbie-platform default (- (+ y (* 1/2 x)) (* y (- z (log z)))))
                      
                        (+ (* x 0.5) (* y (+ (- 1.0 z) (log z)))))