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

Percentage Accurate: 99.9% → 99.9%
Time: 8.8s
Alternatives: 11
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 11 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(\log z - z, y, \mathsf{fma}\left(0.5, x, y\right)\right) \end{array} \]
(FPCore (x y z) :precision binary64 (fma (- (log z) z) y (fma 0.5 x y)))
double code(double x, double y, double z) {
	return fma((log(z) - z), y, fma(0.5, x, y));
}
function code(x, y, z)
	return fma(Float64(log(z) - z), y, fma(0.5, x, y))
end
code[x_, y_, z_] := N[(N[(N[Log[z], $MachinePrecision] - z), $MachinePrecision] * y + N[(0.5 * x + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[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}{\frac{1}{2} \cdot x + y \cdot \left(\left(1 + \log z\right) - z\right)} \]
  4. Step-by-step derivation
    1. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 58.8% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_0 := y \cdot \left(\left(1 - z\right) + \log z\right)\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+259} \lor \neg \left(t\_0 \leq 10^{+122}\right):\\
\;\;\;\;\left(-z\right) \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y (+.f64 (-.f64 #s(literal 1 binary64) z) (log.f64 z))) < -5.00000000000000033e259 or 1.00000000000000001e122 < (*.f64 y (+.f64 (-.f64 #s(literal 1 binary64) z) (log.f64 z)))

    1. Initial program 99.8%

      \[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. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(y \cdot z\right)} \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{z \cdot y}\right) \]
      3. distribute-lft-neg-inN/A

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

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

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

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

    if -5.00000000000000033e259 < (*.f64 y (+.f64 (-.f64 #s(literal 1 binary64) z) (log.f64 z))) < 1.00000000000000001e122

    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}{\frac{1}{2} \cdot x + y \cdot \left(\left(1 + \log z\right) - z\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot x} \]
    7. Step-by-step derivation
      1. lower-*.f6461.1

        \[\leadsto \color{blue}{0.5 \cdot x} \]
    8. Applied rewrites61.1%

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

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

Alternative 3: 85.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{+66} \lor \neg \left(y \leq 3.4 \cdot 10^{+71}\right):\\
\;\;\;\;\mathsf{fma}\left(\log z - z, y, y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.50000000000000001e66 or 3.3999999999999998e71 < y

    1. Initial program 99.7%

      \[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. sub-negN/A

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\log z + -1 \cdot z, y, y\right)} \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(\log z + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}, y, y\right) \]
      9. sub-negN/A

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

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

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

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

    if -1.50000000000000001e66 < y < 3.3999999999999998e71

    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 inf

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

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

        \[\leadsto x \cdot 0.5 + y \cdot \color{blue}{\left(-z\right)} \]
    5. Applied rewrites88.9%

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

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

Alternative 4: 85.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \log z - z\\ \mathbf{if}\;y \leq -1.5 \cdot 10^{+66}:\\ \;\;\;\;t\_0 \cdot y + y\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{+71}:\\ \;\;\;\;x \cdot 0.5 + y \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t\_0, y, y\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- (log z) z)))
   (if (<= y -1.5e+66)
     (+ (* t_0 y) y)
     (if (<= y 3.4e+71) (+ (* x 0.5) (* y (- z))) (fma t_0 y y)))))
double code(double x, double y, double z) {
	double t_0 = log(z) - z;
	double tmp;
	if (y <= -1.5e+66) {
		tmp = (t_0 * y) + y;
	} else if (y <= 3.4e+71) {
		tmp = (x * 0.5) + (y * -z);
	} else {
		tmp = fma(t_0, y, y);
	}
	return tmp;
}
function code(x, y, z)
	t_0 = Float64(log(z) - z)
	tmp = 0.0
	if (y <= -1.5e+66)
		tmp = Float64(Float64(t_0 * y) + y);
	elseif (y <= 3.4e+71)
		tmp = Float64(Float64(x * 0.5) + Float64(y * Float64(-z)));
	else
		tmp = fma(t_0, y, y);
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Log[z], $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[y, -1.5e+66], N[(N[(t$95$0 * y), $MachinePrecision] + y), $MachinePrecision], If[LessEqual[y, 3.4e+71], N[(N[(x * 0.5), $MachinePrecision] + N[(y * (-z)), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * y + y), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \log z - z\\
\mathbf{if}\;y \leq -1.5 \cdot 10^{+66}:\\
\;\;\;\;t\_0 \cdot y + y\\

\mathbf{elif}\;y \leq 3.4 \cdot 10^{+71}:\\
\;\;\;\;x \cdot 0.5 + y \cdot \left(-z\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, y, y\right)\\


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

    1. Initial program 99.8%

      \[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. sub-negN/A

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\log z + -1 \cdot z, y, y\right)} \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(\log z + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}, y, y\right) \]
      9. sub-negN/A

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

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

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

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

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

      if -1.50000000000000001e66 < y < 3.3999999999999998e71

      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 inf

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

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

          \[\leadsto x \cdot 0.5 + y \cdot \color{blue}{\left(-z\right)} \]
      5. Applied rewrites88.9%

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

      if 3.3999999999999998e71 < y

      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. sub-negN/A

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(\log z + -1 \cdot z, y, y\right)} \]
        8. mul-1-negN/A

          \[\leadsto \mathsf{fma}\left(\log z + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}, y, y\right) \]
        9. sub-negN/A

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{\log z - z}, y, y\right) \]
        11. lower-log.f6489.0

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\log z - z, y, y\right)} \]
    7. Recombined 3 regimes into one program.
    8. Add Preprocessing

    Alternative 5: 98.6% accurate, 1.0× speedup?

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

      1. Initial program 99.7%

        \[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.3

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

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

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

        if 1.39999999999999998e-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}{\frac{1}{2} \cdot x + y \cdot \left(\left(1 + \log z\right) - z\right)} \]
        4. Step-by-step derivation
          1. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(z \cdot \left(-1 \cdot \frac{\log \left(\frac{1}{z}\right)}{z} - 1\right), y, \mathsf{fma}\left(\frac{1}{2}, x, y\right)\right) \]
        7. Step-by-step derivation
          1. Applied rewrites100.0%

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

            \[\leadsto \mathsf{fma}\left(-1 \cdot z, y, \mathsf{fma}\left(\frac{1}{2}, x, y\right)\right) \]
          3. Step-by-step derivation
            1. Applied rewrites97.8%

              \[\leadsto \mathsf{fma}\left(-z, y, \mathsf{fma}\left(0.5, x, y\right)\right) \]
          4. Recombined 2 regimes into one program.
          5. Final simplification98.6%

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

          Alternative 6: 75.0% accurate, 1.0× speedup?

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

            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 inf

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

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

                \[\leadsto x \cdot 0.5 + y \cdot \color{blue}{\left(-z\right)} \]
            5. Applied rewrites85.7%

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

            if 1.7499999999999999e-197 < z < 1.85e-50

            1. Initial program 99.7%

              \[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.7

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

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

              \[\leadsto y + \color{blue}{y \cdot \log z} \]
            7. Step-by-step derivation
              1. Applied rewrites62.3%

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

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

            Alternative 7: 98.6% accurate, 1.0× speedup?

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

              1. Initial program 99.7%

                \[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.3

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

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

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

                if 1.39999999999999998e-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}{\frac{1}{2} \cdot x + y \cdot \left(\left(1 + \log z\right) - z\right)} \]
                4. Step-by-step derivation
                  1. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(z \cdot \left(-1 \cdot \frac{\log \left(\frac{1}{z}\right)}{z} - 1\right), y, \mathsf{fma}\left(\frac{1}{2}, x, y\right)\right) \]
                7. Step-by-step derivation
                  1. Applied rewrites100.0%

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

                    \[\leadsto \mathsf{fma}\left(-1 \cdot z, y, \mathsf{fma}\left(\frac{1}{2}, x, y\right)\right) \]
                  3. Step-by-step derivation
                    1. Applied rewrites97.8%

                      \[\leadsto \mathsf{fma}\left(-z, y, \mathsf{fma}\left(0.5, x, y\right)\right) \]
                  4. Recombined 2 regimes into one program.
                  5. Final simplification98.6%

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

                  Alternative 8: 98.6% accurate, 1.0× speedup?

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

                    1. Initial program 99.7%

                      \[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.3

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

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

                    if 1.39999999999999998e-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}{\frac{1}{2} \cdot x + y \cdot \left(\left(1 + \log z\right) - z\right)} \]
                    4. Step-by-step derivation
                      1. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(z \cdot \left(-1 \cdot \frac{\log \left(\frac{1}{z}\right)}{z} - 1\right), y, \mathsf{fma}\left(\frac{1}{2}, x, y\right)\right) \]
                    7. Step-by-step derivation
                      1. Applied rewrites100.0%

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

                        \[\leadsto \mathsf{fma}\left(-1 \cdot z, y, \mathsf{fma}\left(\frac{1}{2}, x, y\right)\right) \]
                      3. Step-by-step derivation
                        1. Applied rewrites97.8%

                          \[\leadsto \mathsf{fma}\left(-z, y, \mathsf{fma}\left(0.5, x, y\right)\right) \]
                      4. Recombined 2 regimes into one program.
                      5. Final simplification98.6%

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

                      Alternative 9: 75.6% accurate, 7.5× speedup?

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

                        \[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 x \cdot \frac{1}{2} + y \cdot \color{blue}{\left(-1 \cdot z\right)} \]
                      4. Step-by-step derivation
                        1. mul-1-negN/A

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

                          \[\leadsto x \cdot 0.5 + y \cdot \color{blue}{\left(-z\right)} \]
                      5. Applied rewrites75.2%

                        \[\leadsto x \cdot 0.5 + y \cdot \color{blue}{\left(-z\right)} \]
                      6. Add Preprocessing

                      Alternative 10: 74.5% accurate, 8.0× speedup?

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

                        \[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}{\frac{1}{2} \cdot x + y \cdot \left(\left(1 + \log z\right) - z\right)} \]
                      4. Step-by-step derivation
                        1. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(z \cdot \left(-1 \cdot \frac{\log \left(\frac{1}{z}\right)}{z} - 1\right), y, \mathsf{fma}\left(\frac{1}{2}, x, y\right)\right) \]
                      7. Step-by-step derivation
                        1. Applied rewrites99.5%

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

                          \[\leadsto \mathsf{fma}\left(-1 \cdot z, y, \mathsf{fma}\left(\frac{1}{2}, x, y\right)\right) \]
                        3. Step-by-step derivation
                          1. Applied rewrites74.1%

                            \[\leadsto \mathsf{fma}\left(-z, y, \mathsf{fma}\left(0.5, x, y\right)\right) \]
                          2. Final simplification74.1%

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

                          Alternative 11: 40.6% 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.8%

                            \[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}{\frac{1}{2} \cdot x + y \cdot \left(\left(1 + \log z\right) - z\right)} \]
                          4. Step-by-step derivation
                            1. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \color{blue}{\frac{1}{2} \cdot x} \]
                          7. Step-by-step derivation
                            1. lower-*.f6445.0

                              \[\leadsto \color{blue}{0.5 \cdot x} \]
                          8. Applied rewrites45.0%

                            \[\leadsto \color{blue}{0.5 \cdot x} \]
                          9. 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 2024322 
                          (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)))))