Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B

Percentage Accurate: 93.8% → 99.0%
Time: 17.3s
Alternatives: 20
Speedup: 1.0×

Specification

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

\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\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 20 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: 93.8% accurate, 1.0× speedup?

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

\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}

Alternative 1: 99.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 4 \cdot 10^{+97}:\\ \;\;\;\;\left(\left(\frac{\mathsf{fma}\left(x, x, -0.25\right) \cdot \log x}{x + 0.5} - x\right) + 0.91893853320467\right) + \frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;0.91893853320467 + \mathsf{fma}\left(\log x, x + -0.5, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{y}{x}, \frac{\mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)}{x}\right), \frac{0.083333333333333}{x}\right) - x\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x 4e+97)
   (+
    (+ (- (/ (* (fma x x -0.25) (log x)) (+ x 0.5)) x) 0.91893853320467)
    (/
     (+
      (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
      0.083333333333333)
     x))
   (+
    0.91893853320467
    (fma
     (log x)
     (+ x -0.5)
     (-
      (fma
       z
       (fma z (/ y x) (/ (fma z 0.0007936500793651 -0.0027777777777778) x))
       (/ 0.083333333333333 x))
      x)))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= 4e+97) {
		tmp = ((((fma(x, x, -0.25) * log(x)) / (x + 0.5)) - x) + 0.91893853320467) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x);
	} else {
		tmp = 0.91893853320467 + fma(log(x), (x + -0.5), (fma(z, fma(z, (y / x), (fma(z, 0.0007936500793651, -0.0027777777777778) / x)), (0.083333333333333 / x)) - x));
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (x <= 4e+97)
		tmp = Float64(Float64(Float64(Float64(Float64(fma(x, x, -0.25) * log(x)) / Float64(x + 0.5)) - x) + 0.91893853320467) + Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x));
	else
		tmp = Float64(0.91893853320467 + fma(log(x), Float64(x + -0.5), Float64(fma(z, fma(z, Float64(y / x), Float64(fma(z, 0.0007936500793651, -0.0027777777777778) / x)), Float64(0.083333333333333 / x)) - x)));
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[x, 4e+97], N[(N[(N[(N[(N[(N[(x * x + -0.25), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] / N[(x + 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + N[(N[(z * N[(z * N[(y / x), $MachinePrecision] + N[(N[(z * 0.0007936500793651 + -0.0027777777777778), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 4 \cdot 10^{+97}:\\
\;\;\;\;\left(\left(\frac{\mathsf{fma}\left(x, x, -0.25\right) \cdot \log x}{x + 0.5} - x\right) + 0.91893853320467\right) + \frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x}\\

\mathbf{else}:\\
\;\;\;\;0.91893853320467 + \mathsf{fma}\left(\log x, x + -0.5, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{y}{x}, \frac{\mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)}{x}\right), \frac{0.083333333333333}{x}\right) - x\right)\\


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

    1. Initial program 99.7%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. flip--N/A

        \[\leadsto \left(\left(\color{blue}{\frac{x \cdot x - \frac{1}{2} \cdot \frac{1}{2}}{x + \frac{1}{2}}} \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
      2. lift-log.f64N/A

        \[\leadsto \left(\left(\frac{x \cdot x - \frac{1}{2} \cdot \frac{1}{2}}{x + \frac{1}{2}} \cdot \color{blue}{\log x} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
      3. associate-*l/N/A

        \[\leadsto \left(\left(\color{blue}{\frac{\left(x \cdot x - \frac{1}{2} \cdot \frac{1}{2}\right) \cdot \log x}{x + \frac{1}{2}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
      4. lower-/.f64N/A

        \[\leadsto \left(\left(\color{blue}{\frac{\left(x \cdot x - \frac{1}{2} \cdot \frac{1}{2}\right) \cdot \log x}{x + \frac{1}{2}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
      5. lower-*.f64N/A

        \[\leadsto \left(\left(\frac{\color{blue}{\left(x \cdot x - \frac{1}{2} \cdot \frac{1}{2}\right) \cdot \log x}}{x + \frac{1}{2}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
      6. sub-negN/A

        \[\leadsto \left(\left(\frac{\color{blue}{\left(x \cdot x + \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{2}\right)\right)\right)} \cdot \log x}{x + \frac{1}{2}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
      7. lower-fma.f64N/A

        \[\leadsto \left(\left(\frac{\color{blue}{\mathsf{fma}\left(x, x, \mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{2}\right)\right)} \cdot \log x}{x + \frac{1}{2}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
      8. metadata-evalN/A

        \[\leadsto \left(\left(\frac{\mathsf{fma}\left(x, x, \mathsf{neg}\left(\color{blue}{\frac{1}{4}}\right)\right) \cdot \log x}{x + \frac{1}{2}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
      9. metadata-evalN/A

        \[\leadsto \left(\left(\frac{\mathsf{fma}\left(x, x, \color{blue}{\frac{-1}{4}}\right) \cdot \log x}{x + \frac{1}{2}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
      10. lower-+.f6499.7

        \[\leadsto \left(\left(\frac{\mathsf{fma}\left(x, x, -0.25\right) \cdot \log x}{\color{blue}{x + 0.5}} - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    4. Applied rewrites99.7%

      \[\leadsto \left(\left(\color{blue}{\frac{\mathsf{fma}\left(x, x, -0.25\right) \cdot \log x}{x + 0.5}} - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]

    if 4.0000000000000003e97 < x

    1. Initial program 82.9%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{\left(\frac{91893853320467}{100000000000000} + \left(\frac{83333333333333}{1000000000000000} \cdot \frac{1}{x} + \left(\log x \cdot \left(x - \frac{1}{2}\right) + \left(\frac{y \cdot {z}^{2}}{x} + \frac{z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right)}{x}\right)\right)\right)\right) - x} \]
    4. Applied rewrites99.8%

      \[\leadsto \color{blue}{0.91893853320467 + \mathsf{fma}\left(\log x, -0.5 + x, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{y}{x}, \frac{\mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)}{x}\right), \frac{0.083333333333333}{x}\right) - x\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 4 \cdot 10^{+97}:\\ \;\;\;\;\left(\left(\frac{\mathsf{fma}\left(x, x, -0.25\right) \cdot \log x}{x + 0.5} - x\right) + 0.91893853320467\right) + \frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;0.91893853320467 + \mathsf{fma}\left(\log x, x + -0.5, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{y}{x}, \frac{\mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)}{x}\right), \frac{0.083333333333333}{x}\right) - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 88.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(y + 0.0007936500793651\right)\\ t_1 := \frac{z \cdot \left(t\_0 - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+186}:\\ \;\;\;\;\frac{z \cdot t\_0}{x}\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+294}:\\ \;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, \left(0.91893853320467 + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\right) - x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (+ y 0.0007936500793651)))
        (t_1
         (+
          (/ (+ (* z (- t_0 0.0027777777777778)) 0.083333333333333) x)
          (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)))))
   (if (<= t_1 -5e+186)
     (/ (* z t_0) x)
     (if (<= t_1 4e+294)
       (fma
        (+ x -0.5)
        (log x)
        (-
         (+
          0.91893853320467
          (/
           (fma
            z
            (fma z 0.0007936500793651 -0.0027777777777778)
            0.083333333333333)
           x))
         x))
       (* (* z z) (+ (/ y x) (/ 0.0007936500793651 x)))))))
double code(double x, double y, double z) {
	double t_0 = z * (y + 0.0007936500793651);
	double t_1 = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x));
	double tmp;
	if (t_1 <= -5e+186) {
		tmp = (z * t_0) / x;
	} else if (t_1 <= 4e+294) {
		tmp = fma((x + -0.5), log(x), ((0.91893853320467 + (fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x)) - x));
	} else {
		tmp = (z * z) * ((y / x) + (0.0007936500793651 / x));
	}
	return tmp;
}
function code(x, y, z)
	t_0 = Float64(z * Float64(y + 0.0007936500793651))
	t_1 = Float64(Float64(Float64(Float64(z * Float64(t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)))
	tmp = 0.0
	if (t_1 <= -5e+186)
		tmp = Float64(Float64(z * t_0) / x);
	elseif (t_1 <= 4e+294)
		tmp = fma(Float64(x + -0.5), log(x), Float64(Float64(0.91893853320467 + Float64(fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x)) - x));
	else
		tmp = Float64(Float64(z * z) * Float64(Float64(y / x) + Float64(0.0007936500793651 / x)));
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(z * N[(t$95$0 - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+186], N[(N[(z * t$95$0), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$1, 4e+294], N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(N[(0.91893853320467 + N[(N[(z * N[(z * 0.0007936500793651 + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := z \cdot \left(y + 0.0007936500793651\right)\\
t_1 := \frac{z \cdot \left(t\_0 - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+186}:\\
\;\;\;\;\frac{z \cdot t\_0}{x}\\

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+294}:\\
\;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, \left(0.91893853320467 + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\right) - x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -4.99999999999999954e186

    1. Initial program 94.2%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + \left(x \cdot \left(\frac{91893853320467}{100000000000000} + \left(\frac{-1}{2} \cdot \log x + x \cdot \left(\log x - 1\right)\right)\right) + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)\right)}{x}} \]
    4. Applied rewrites94.2%

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

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

        \[\leadsto \color{blue}{\frac{{z}^{2} \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)}{x}} \]
      2. unpow2N/A

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

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

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

        \[\leadsto \frac{z \cdot \color{blue}{\left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)\right)}}{x} \]
      6. lower-+.f6494.2

        \[\leadsto \frac{z \cdot \left(z \cdot \color{blue}{\left(0.0007936500793651 + y\right)}\right)}{x} \]
    7. Applied rewrites94.2%

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

    if -4.99999999999999954e186 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 4.00000000000000027e294

    1. Initial program 99.5%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. Applied rewrites99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x + -0.5, \log x, \left(-x\right) + \left(0.91893853320467 + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}\right)\right)} \]
    4. Taylor expanded in y around 0

      \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right)}{x}}\right)\right) \]
    5. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right)}{x}}\right)\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{\color{blue}{z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}}{x}\right)\right) \]
      3. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{\color{blue}{\mathsf{fma}\left(z, \frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}, \frac{83333333333333}{1000000000000000}\right)}}{x}\right)\right) \]
      4. sub-negN/A

        \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{\mathsf{fma}\left(z, \color{blue}{\frac{7936500793651}{10000000000000000} \cdot z + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right)}, \frac{83333333333333}{1000000000000000}\right)}{x}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{\mathsf{fma}\left(z, \color{blue}{z \cdot \frac{7936500793651}{10000000000000000}} + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right), \frac{83333333333333}{1000000000000000}\right)}{x}\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{\mathsf{fma}\left(z, z \cdot \frac{7936500793651}{10000000000000000} + \color{blue}{\frac{-13888888888889}{5000000000000000}}, \frac{83333333333333}{1000000000000000}\right)}{x}\right)\right) \]
      7. lower-fma.f6496.6

        \[\leadsto \mathsf{fma}\left(x + -0.5, \log x, \left(-x\right) + \left(0.91893853320467 + \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)}, 0.083333333333333\right)}{x}\right)\right) \]
    6. Applied rewrites96.6%

      \[\leadsto \mathsf{fma}\left(x + -0.5, \log x, \left(-x\right) + \left(0.91893853320467 + \color{blue}{\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}}\right)\right) \]
    7. Step-by-step derivation
      1. lift-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} + \left(\frac{91893853320467}{100000000000000} + \frac{z \cdot \left(z \cdot \frac{7936500793651}{10000000000000000} + \frac{-13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}{x}\right)\right) \]
      2. lift-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{z \cdot \color{blue}{\mathsf{fma}\left(z, \frac{7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right)} + \frac{83333333333333}{1000000000000000}}{x}\right)\right) \]
      3. lift-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{\color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right)}}{x}\right)\right) \]
      4. lift-/.f64N/A

        \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \color{blue}{\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right)}{x}}\right)\right) \]
      5. lift-+.f64N/A

        \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \color{blue}{\left(\frac{91893853320467}{100000000000000} + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right)}{x}\right)}\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \color{blue}{\left(\frac{91893853320467}{100000000000000} + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right)}{x}\right) + \left(\mathsf{neg}\left(x\right)\right)}\right) \]
      7. lift-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\frac{91893853320467}{100000000000000} + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right)}{x}\right) + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right) \]
      8. unsub-negN/A

        \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \color{blue}{\left(\frac{91893853320467}{100000000000000} + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right)}{x}\right) - x}\right) \]
      9. lower--.f6496.6

        \[\leadsto \mathsf{fma}\left(x + -0.5, \log x, \color{blue}{\left(0.91893853320467 + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\right) - x}\right) \]
    8. Applied rewrites96.6%

      \[\leadsto \mathsf{fma}\left(x + -0.5, \log x, \color{blue}{\left(0.91893853320467 + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\right) - x}\right) \]

    if 4.00000000000000027e294 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x))

    1. Initial program 82.2%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

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

        \[\leadsto \color{blue}{{z}^{2} \cdot \left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right)} \]
      2. unpow2N/A

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

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

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

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

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

        \[\leadsto \left(z \cdot z\right) \cdot \left(\color{blue}{\frac{\frac{7936500793651}{10000000000000000}}{x}} + \frac{y}{x}\right) \]
      8. lower-/.f6484.7

        \[\leadsto \left(z \cdot z\right) \cdot \left(\frac{0.0007936500793651}{x} + \color{blue}{\frac{y}{x}}\right) \]
    5. Applied rewrites84.7%

      \[\leadsto \color{blue}{\left(z \cdot z\right) \cdot \left(\frac{0.0007936500793651}{x} + \frac{y}{x}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification93.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) \leq -5 \cdot 10^{+186}:\\ \;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right)\right)}{x}\\ \mathbf{elif}\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) \leq 4 \cdot 10^{+294}:\\ \;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, \left(0.91893853320467 + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\right) - x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 83.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(y + 0.0007936500793651\right)\\ t_1 := \frac{z \cdot \left(t\_0 - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+186}:\\ \;\;\;\;\frac{z \cdot t\_0}{x}\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+294}:\\ \;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - \left(x - \frac{0.083333333333333}{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (+ y 0.0007936500793651)))
        (t_1
         (+
          (/ (+ (* z (- t_0 0.0027777777777778)) 0.083333333333333) x)
          (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)))))
   (if (<= t_1 -5e+186)
     (/ (* z t_0) x)
     (if (<= t_1 4e+294)
       (fma
        (+ x -0.5)
        (log x)
        (- 0.91893853320467 (- x (/ 0.083333333333333 x))))
       (* (* z z) (+ (/ y x) (/ 0.0007936500793651 x)))))))
double code(double x, double y, double z) {
	double t_0 = z * (y + 0.0007936500793651);
	double t_1 = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x));
	double tmp;
	if (t_1 <= -5e+186) {
		tmp = (z * t_0) / x;
	} else if (t_1 <= 4e+294) {
		tmp = fma((x + -0.5), log(x), (0.91893853320467 - (x - (0.083333333333333 / x))));
	} else {
		tmp = (z * z) * ((y / x) + (0.0007936500793651 / x));
	}
	return tmp;
}
function code(x, y, z)
	t_0 = Float64(z * Float64(y + 0.0007936500793651))
	t_1 = Float64(Float64(Float64(Float64(z * Float64(t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)))
	tmp = 0.0
	if (t_1 <= -5e+186)
		tmp = Float64(Float64(z * t_0) / x);
	elseif (t_1 <= 4e+294)
		tmp = fma(Float64(x + -0.5), log(x), Float64(0.91893853320467 - Float64(x - Float64(0.083333333333333 / x))));
	else
		tmp = Float64(Float64(z * z) * Float64(Float64(y / x) + Float64(0.0007936500793651 / x)));
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(z * N[(t$95$0 - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+186], N[(N[(z * t$95$0), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$1, 4e+294], N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - N[(x - N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := z \cdot \left(y + 0.0007936500793651\right)\\
t_1 := \frac{z \cdot \left(t\_0 - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+186}:\\
\;\;\;\;\frac{z \cdot t\_0}{x}\\

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+294}:\\
\;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - \left(x - \frac{0.083333333333333}{x}\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -4.99999999999999954e186

    1. Initial program 94.2%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + \left(x \cdot \left(\frac{91893853320467}{100000000000000} + \left(\frac{-1}{2} \cdot \log x + x \cdot \left(\log x - 1\right)\right)\right) + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)\right)}{x}} \]
    4. Applied rewrites94.2%

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

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

        \[\leadsto \color{blue}{\frac{{z}^{2} \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)}{x}} \]
      2. unpow2N/A

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

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

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

        \[\leadsto \frac{z \cdot \color{blue}{\left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)\right)}}{x} \]
      6. lower-+.f6494.2

        \[\leadsto \frac{z \cdot \left(z \cdot \color{blue}{\left(0.0007936500793651 + y\right)}\right)}{x} \]
    7. Applied rewrites94.2%

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

    if -4.99999999999999954e186 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 4.00000000000000027e294

    1. Initial program 99.5%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. Applied rewrites99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x + -0.5, \log x, \left(-x\right) + \left(0.91893853320467 + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}\right)\right)} \]
    4. Taylor expanded in z around 0

      \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \color{blue}{\left(\frac{91893853320467}{100000000000000} + \frac{83333333333333}{1000000000000000} \cdot \frac{1}{x}\right) - x}\right) \]
    5. Step-by-step derivation
      1. associate--l+N/A

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

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

        \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \frac{91893853320467}{100000000000000} + \color{blue}{\left(\frac{83333333333333}{1000000000000000} \cdot \frac{1}{x} - x\right)}\right) \]
      4. associate-*r/N/A

        \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \frac{91893853320467}{100000000000000} + \left(\color{blue}{\frac{\frac{83333333333333}{1000000000000000} \cdot 1}{x}} - x\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \frac{91893853320467}{100000000000000} + \left(\frac{\color{blue}{\frac{83333333333333}{1000000000000000}}}{x} - x\right)\right) \]
      6. lower-/.f6486.8

        \[\leadsto \mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 + \left(\color{blue}{\frac{0.083333333333333}{x}} - x\right)\right) \]
    6. Applied rewrites86.8%

      \[\leadsto \mathsf{fma}\left(x + -0.5, \log x, \color{blue}{0.91893853320467 + \left(\frac{0.083333333333333}{x} - x\right)}\right) \]

    if 4.00000000000000027e294 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x))

    1. Initial program 82.2%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

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

        \[\leadsto \color{blue}{{z}^{2} \cdot \left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right)} \]
      2. unpow2N/A

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

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

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

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

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

        \[\leadsto \left(z \cdot z\right) \cdot \left(\color{blue}{\frac{\frac{7936500793651}{10000000000000000}}{x}} + \frac{y}{x}\right) \]
      8. lower-/.f6484.7

        \[\leadsto \left(z \cdot z\right) \cdot \left(\frac{0.0007936500793651}{x} + \color{blue}{\frac{y}{x}}\right) \]
    5. Applied rewrites84.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) \leq -5 \cdot 10^{+186}:\\ \;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right)\right)}{x}\\ \mathbf{elif}\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) \leq 4 \cdot 10^{+294}:\\ \;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - \left(x - \frac{0.083333333333333}{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 83.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(y + 0.0007936500793651\right)\\ t_1 := \frac{z \cdot \left(t\_0 - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+186}:\\ \;\;\;\;\frac{z \cdot t\_0}{x}\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+294}:\\ \;\;\;\;\mathsf{fma}\left(\log x, x + -0.5, \frac{0.083333333333333}{x}\right) + \left(0.91893853320467 - x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (+ y 0.0007936500793651)))
        (t_1
         (+
          (/ (+ (* z (- t_0 0.0027777777777778)) 0.083333333333333) x)
          (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)))))
   (if (<= t_1 -5e+186)
     (/ (* z t_0) x)
     (if (<= t_1 4e+294)
       (+
        (fma (log x) (+ x -0.5) (/ 0.083333333333333 x))
        (- 0.91893853320467 x))
       (* (* z z) (+ (/ y x) (/ 0.0007936500793651 x)))))))
double code(double x, double y, double z) {
	double t_0 = z * (y + 0.0007936500793651);
	double t_1 = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x));
	double tmp;
	if (t_1 <= -5e+186) {
		tmp = (z * t_0) / x;
	} else if (t_1 <= 4e+294) {
		tmp = fma(log(x), (x + -0.5), (0.083333333333333 / x)) + (0.91893853320467 - x);
	} else {
		tmp = (z * z) * ((y / x) + (0.0007936500793651 / x));
	}
	return tmp;
}
function code(x, y, z)
	t_0 = Float64(z * Float64(y + 0.0007936500793651))
	t_1 = Float64(Float64(Float64(Float64(z * Float64(t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)))
	tmp = 0.0
	if (t_1 <= -5e+186)
		tmp = Float64(Float64(z * t_0) / x);
	elseif (t_1 <= 4e+294)
		tmp = Float64(fma(log(x), Float64(x + -0.5), Float64(0.083333333333333 / x)) + Float64(0.91893853320467 - x));
	else
		tmp = Float64(Float64(z * z) * Float64(Float64(y / x) + Float64(0.0007936500793651 / x)));
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(z * N[(t$95$0 - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+186], N[(N[(z * t$95$0), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$1, 4e+294], N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := z \cdot \left(y + 0.0007936500793651\right)\\
t_1 := \frac{z \cdot \left(t\_0 - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+186}:\\
\;\;\;\;\frac{z \cdot t\_0}{x}\\

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+294}:\\
\;\;\;\;\mathsf{fma}\left(\log x, x + -0.5, \frac{0.083333333333333}{x}\right) + \left(0.91893853320467 - x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -4.99999999999999954e186

    1. Initial program 94.2%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + \left(x \cdot \left(\frac{91893853320467}{100000000000000} + \left(\frac{-1}{2} \cdot \log x + x \cdot \left(\log x - 1\right)\right)\right) + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)\right)}{x}} \]
    4. Applied rewrites94.2%

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

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

        \[\leadsto \color{blue}{\frac{{z}^{2} \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)}{x}} \]
      2. unpow2N/A

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

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

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

        \[\leadsto \frac{z \cdot \color{blue}{\left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)\right)}}{x} \]
      6. lower-+.f6494.2

        \[\leadsto \frac{z \cdot \left(z \cdot \color{blue}{\left(0.0007936500793651 + y\right)}\right)}{x} \]
    7. Applied rewrites94.2%

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

    if -4.99999999999999954e186 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 4.00000000000000027e294

    1. Initial program 99.5%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

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

        \[\leadsto \color{blue}{\left(\left(\frac{83333333333333}{1000000000000000} \cdot \frac{1}{x} + \log x \cdot \left(x - \frac{1}{2}\right)\right) + \frac{91893853320467}{100000000000000}\right)} - x \]
      2. associate--l+N/A

        \[\leadsto \color{blue}{\left(\frac{83333333333333}{1000000000000000} \cdot \frac{1}{x} + \log x \cdot \left(x - \frac{1}{2}\right)\right) + \left(\frac{91893853320467}{100000000000000} - x\right)} \]
      3. lower-+.f64N/A

        \[\leadsto \color{blue}{\left(\frac{83333333333333}{1000000000000000} \cdot \frac{1}{x} + \log x \cdot \left(x - \frac{1}{2}\right)\right) + \left(\frac{91893853320467}{100000000000000} - x\right)} \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\log x \cdot \left(x - \frac{1}{2}\right) + \frac{83333333333333}{1000000000000000} \cdot \frac{1}{x}\right)} + \left(\frac{91893853320467}{100000000000000} - x\right) \]
      5. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\log x}, x - \frac{1}{2}, \frac{83333333333333}{1000000000000000} \cdot \frac{1}{x}\right) + \left(\frac{91893853320467}{100000000000000} - x\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{fma}\left(\log x, \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, \frac{83333333333333}{1000000000000000} \cdot \frac{1}{x}\right) + \left(\frac{91893853320467}{100000000000000} - x\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\log x, x + \color{blue}{\frac{-1}{2}}, \frac{83333333333333}{1000000000000000} \cdot \frac{1}{x}\right) + \left(\frac{91893853320467}{100000000000000} - x\right) \]
      9. +-commutativeN/A

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

        \[\leadsto \mathsf{fma}\left(\log x, \color{blue}{\frac{-1}{2} + x}, \frac{83333333333333}{1000000000000000} \cdot \frac{1}{x}\right) + \left(\frac{91893853320467}{100000000000000} - x\right) \]
      11. associate-*r/N/A

        \[\leadsto \mathsf{fma}\left(\log x, \frac{-1}{2} + x, \color{blue}{\frac{\frac{83333333333333}{1000000000000000} \cdot 1}{x}}\right) + \left(\frac{91893853320467}{100000000000000} - x\right) \]
      12. metadata-evalN/A

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

        \[\leadsto \mathsf{fma}\left(\log x, \frac{-1}{2} + x, \color{blue}{\frac{\frac{83333333333333}{1000000000000000}}{x}}\right) + \left(\frac{91893853320467}{100000000000000} - x\right) \]
      14. lower--.f6486.7

        \[\leadsto \mathsf{fma}\left(\log x, -0.5 + x, \frac{0.083333333333333}{x}\right) + \color{blue}{\left(0.91893853320467 - x\right)} \]
    5. Applied rewrites86.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\log x, -0.5 + x, \frac{0.083333333333333}{x}\right) + \left(0.91893853320467 - x\right)} \]

    if 4.00000000000000027e294 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x))

    1. Initial program 82.2%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

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

        \[\leadsto \color{blue}{{z}^{2} \cdot \left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right)} \]
      2. unpow2N/A

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

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

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

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

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

        \[\leadsto \left(z \cdot z\right) \cdot \left(\color{blue}{\frac{\frac{7936500793651}{10000000000000000}}{x}} + \frac{y}{x}\right) \]
      8. lower-/.f6484.7

        \[\leadsto \left(z \cdot z\right) \cdot \left(\frac{0.0007936500793651}{x} + \color{blue}{\frac{y}{x}}\right) \]
    5. Applied rewrites84.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) \leq -5 \cdot 10^{+186}:\\ \;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right)\right)}{x}\\ \mathbf{elif}\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) \leq 4 \cdot 10^{+294}:\\ \;\;\;\;\mathsf{fma}\left(\log x, x + -0.5, \frac{0.083333333333333}{x}\right) + \left(0.91893853320467 - x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 83.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(y + 0.0007936500793651\right)\\ t_1 := \frac{z \cdot \left(t\_0 - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+186}:\\ \;\;\;\;\frac{z \cdot t\_0}{x}\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+294}:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(\mathsf{fma}\left(\log x, x + -0.5, 0.91893853320467\right) - x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (+ y 0.0007936500793651)))
        (t_1
         (+
          (/ (+ (* z (- t_0 0.0027777777777778)) 0.083333333333333) x)
          (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)))))
   (if (<= t_1 -5e+186)
     (/ (* z t_0) x)
     (if (<= t_1 4e+294)
       (+
        (/ 0.083333333333333 x)
        (- (fma (log x) (+ x -0.5) 0.91893853320467) x))
       (* (* z z) (+ (/ y x) (/ 0.0007936500793651 x)))))))
double code(double x, double y, double z) {
	double t_0 = z * (y + 0.0007936500793651);
	double t_1 = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x));
	double tmp;
	if (t_1 <= -5e+186) {
		tmp = (z * t_0) / x;
	} else if (t_1 <= 4e+294) {
		tmp = (0.083333333333333 / x) + (fma(log(x), (x + -0.5), 0.91893853320467) - x);
	} else {
		tmp = (z * z) * ((y / x) + (0.0007936500793651 / x));
	}
	return tmp;
}
function code(x, y, z)
	t_0 = Float64(z * Float64(y + 0.0007936500793651))
	t_1 = Float64(Float64(Float64(Float64(z * Float64(t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)))
	tmp = 0.0
	if (t_1 <= -5e+186)
		tmp = Float64(Float64(z * t_0) / x);
	elseif (t_1 <= 4e+294)
		tmp = Float64(Float64(0.083333333333333 / x) + Float64(fma(log(x), Float64(x + -0.5), 0.91893853320467) - x));
	else
		tmp = Float64(Float64(z * z) * Float64(Float64(y / x) + Float64(0.0007936500793651 / x)));
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(z * N[(t$95$0 - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+186], N[(N[(z * t$95$0), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$1, 4e+294], N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + 0.91893853320467), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := z \cdot \left(y + 0.0007936500793651\right)\\
t_1 := \frac{z \cdot \left(t\_0 - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+186}:\\
\;\;\;\;\frac{z \cdot t\_0}{x}\\

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+294}:\\
\;\;\;\;\frac{0.083333333333333}{x} + \left(\mathsf{fma}\left(\log x, x + -0.5, 0.91893853320467\right) - x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -4.99999999999999954e186

    1. Initial program 94.2%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + \left(x \cdot \left(\frac{91893853320467}{100000000000000} + \left(\frac{-1}{2} \cdot \log x + x \cdot \left(\log x - 1\right)\right)\right) + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)\right)}{x}} \]
    4. Applied rewrites94.2%

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

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

        \[\leadsto \color{blue}{\frac{{z}^{2} \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)}{x}} \]
      2. unpow2N/A

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

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

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

        \[\leadsto \frac{z \cdot \color{blue}{\left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)\right)}}{x} \]
      6. lower-+.f6494.2

        \[\leadsto \frac{z \cdot \left(z \cdot \color{blue}{\left(0.0007936500793651 + y\right)}\right)}{x} \]
    7. Applied rewrites94.2%

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

    if -4.99999999999999954e186 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 4.00000000000000027e294

    1. Initial program 99.5%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\color{blue}{\frac{83333333333333}{1000000000000000}}}{x} \]
    4. Step-by-step derivation
      1. Applied rewrites86.7%

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\color{blue}{0.083333333333333}}{x} \]
      2. Applied rewrites86.7%

        \[\leadsto \color{blue}{\frac{0.083333333333333}{x} + \left(\mathsf{fma}\left(\log x, x + -0.5, 0.91893853320467\right) - x\right)} \]

      if 4.00000000000000027e294 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x))

      1. Initial program 82.2%

        \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      2. Add Preprocessing
      3. Taylor expanded in z around inf

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

          \[\leadsto \color{blue}{{z}^{2} \cdot \left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right)} \]
        2. unpow2N/A

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

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

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

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

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

          \[\leadsto \left(z \cdot z\right) \cdot \left(\color{blue}{\frac{\frac{7936500793651}{10000000000000000}}{x}} + \frac{y}{x}\right) \]
        8. lower-/.f6484.7

          \[\leadsto \left(z \cdot z\right) \cdot \left(\frac{0.0007936500793651}{x} + \color{blue}{\frac{y}{x}}\right) \]
      5. Applied rewrites84.7%

        \[\leadsto \color{blue}{\left(z \cdot z\right) \cdot \left(\frac{0.0007936500793651}{x} + \frac{y}{x}\right)} \]
    5. Recombined 3 regimes into one program.
    6. Final simplification87.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) \leq -5 \cdot 10^{+186}:\\ \;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right)\right)}{x}\\ \mathbf{elif}\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) \leq 4 \cdot 10^{+294}:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(\mathsf{fma}\left(\log x, x + -0.5, 0.91893853320467\right) - x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\\ \end{array} \]
    7. Add Preprocessing

    Alternative 6: 82.7% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(y + 0.0007936500793651\right)\\ t_1 := \frac{z \cdot \left(t\_0 - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+186}:\\ \;\;\;\;\frac{z \cdot t\_0}{x}\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+294}:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (let* ((t_0 (* z (+ y 0.0007936500793651)))
            (t_1
             (+
              (/ (+ (* z (- t_0 0.0027777777777778)) 0.083333333333333) x)
              (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)))))
       (if (<= t_1 -5e+186)
         (/ (* z t_0) x)
         (if (<= t_1 4e+294)
           (+ (/ 0.083333333333333 x) (+ 0.91893853320467 (- (* x (log x)) x)))
           (* (* z z) (+ (/ y x) (/ 0.0007936500793651 x)))))))
    double code(double x, double y, double z) {
    	double t_0 = z * (y + 0.0007936500793651);
    	double t_1 = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x));
    	double tmp;
    	if (t_1 <= -5e+186) {
    		tmp = (z * t_0) / x;
    	} else if (t_1 <= 4e+294) {
    		tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * log(x)) - x));
    	} else {
    		tmp = (z * z) * ((y / x) + (0.0007936500793651 / 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) :: t_1
        real(8) :: tmp
        t_0 = z * (y + 0.0007936500793651d0)
        t_1 = (((z * (t_0 - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x))
        if (t_1 <= (-5d+186)) then
            tmp = (z * t_0) / x
        else if (t_1 <= 4d+294) then
            tmp = (0.083333333333333d0 / x) + (0.91893853320467d0 + ((x * log(x)) - x))
        else
            tmp = (z * z) * ((y / x) + (0.0007936500793651d0 / x))
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double t_0 = z * (y + 0.0007936500793651);
    	double t_1 = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x));
    	double tmp;
    	if (t_1 <= -5e+186) {
    		tmp = (z * t_0) / x;
    	} else if (t_1 <= 4e+294) {
    		tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * Math.log(x)) - x));
    	} else {
    		tmp = (z * z) * ((y / x) + (0.0007936500793651 / x));
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	t_0 = z * (y + 0.0007936500793651)
    	t_1 = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x))
    	tmp = 0
    	if t_1 <= -5e+186:
    		tmp = (z * t_0) / x
    	elif t_1 <= 4e+294:
    		tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * math.log(x)) - x))
    	else:
    		tmp = (z * z) * ((y / x) + (0.0007936500793651 / x))
    	return tmp
    
    function code(x, y, z)
    	t_0 = Float64(z * Float64(y + 0.0007936500793651))
    	t_1 = Float64(Float64(Float64(Float64(z * Float64(t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)))
    	tmp = 0.0
    	if (t_1 <= -5e+186)
    		tmp = Float64(Float64(z * t_0) / x);
    	elseif (t_1 <= 4e+294)
    		tmp = Float64(Float64(0.083333333333333 / x) + Float64(0.91893853320467 + Float64(Float64(x * log(x)) - x)));
    	else
    		tmp = Float64(Float64(z * z) * Float64(Float64(y / x) + Float64(0.0007936500793651 / x)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	t_0 = z * (y + 0.0007936500793651);
    	t_1 = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x));
    	tmp = 0.0;
    	if (t_1 <= -5e+186)
    		tmp = (z * t_0) / x;
    	elseif (t_1 <= 4e+294)
    		tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * log(x)) - x));
    	else
    		tmp = (z * z) * ((y / x) + (0.0007936500793651 / x));
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(z * N[(t$95$0 - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+186], N[(N[(z * t$95$0), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$1, 4e+294], N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := z \cdot \left(y + 0.0007936500793651\right)\\
    t_1 := \frac{z \cdot \left(t\_0 - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\
    \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+186}:\\
    \;\;\;\;\frac{z \cdot t\_0}{x}\\
    
    \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+294}:\\
    \;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -4.99999999999999954e186

      1. Initial program 94.2%

        \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      2. Add Preprocessing
      3. Taylor expanded in x around 0

        \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + \left(x \cdot \left(\frac{91893853320467}{100000000000000} + \left(\frac{-1}{2} \cdot \log x + x \cdot \left(\log x - 1\right)\right)\right) + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)\right)}{x}} \]
      4. Applied rewrites94.2%

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

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

          \[\leadsto \color{blue}{\frac{{z}^{2} \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)}{x}} \]
        2. unpow2N/A

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

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

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

          \[\leadsto \frac{z \cdot \color{blue}{\left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)\right)}}{x} \]
        6. lower-+.f6494.2

          \[\leadsto \frac{z \cdot \left(z \cdot \color{blue}{\left(0.0007936500793651 + y\right)}\right)}{x} \]
      7. Applied rewrites94.2%

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

      if -4.99999999999999954e186 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 4.00000000000000027e294

      1. Initial program 99.5%

        \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      2. Add Preprocessing
      3. Taylor expanded in z around 0

        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\color{blue}{\frac{83333333333333}{1000000000000000}}}{x} \]
      4. Step-by-step derivation
        1. Applied rewrites86.7%

          \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\color{blue}{0.083333333333333}}{x} \]
        2. Taylor expanded in x around inf

          \[\leadsto \left(\left(\color{blue}{-1 \cdot \left(x \cdot \log \left(\frac{1}{x}\right)\right)} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
        3. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \left(\left(\color{blue}{\left(\mathsf{neg}\left(x \cdot \log \left(\frac{1}{x}\right)\right)\right)} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
          2. distribute-rgt-neg-inN/A

            \[\leadsto \left(\left(\color{blue}{x \cdot \left(\mathsf{neg}\left(\log \left(\frac{1}{x}\right)\right)\right)} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
          3. mul-1-negN/A

            \[\leadsto \left(\left(x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right)\right)} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
          4. lower-*.f64N/A

            \[\leadsto \left(\left(\color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right)\right)} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
          5. mul-1-negN/A

            \[\leadsto \left(\left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{x}\right)\right)\right)} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
          6. log-recN/A

            \[\leadsto \left(\left(x \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log x\right)\right)}\right)\right) - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
          7. remove-double-negN/A

            \[\leadsto \left(\left(x \cdot \color{blue}{\log x} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
          8. lower-log.f6485.0

            \[\leadsto \left(\left(x \cdot \color{blue}{\log x} - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
        4. Applied rewrites85.0%

          \[\leadsto \left(\left(\color{blue}{x \cdot \log x} - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]

        if 4.00000000000000027e294 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x))

        1. Initial program 82.2%

          \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
        2. Add Preprocessing
        3. Taylor expanded in z around inf

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

            \[\leadsto \color{blue}{{z}^{2} \cdot \left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right)} \]
          2. unpow2N/A

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

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

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

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

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

            \[\leadsto \left(z \cdot z\right) \cdot \left(\color{blue}{\frac{\frac{7936500793651}{10000000000000000}}{x}} + \frac{y}{x}\right) \]
          8. lower-/.f6484.7

            \[\leadsto \left(z \cdot z\right) \cdot \left(\frac{0.0007936500793651}{x} + \color{blue}{\frac{y}{x}}\right) \]
        5. Applied rewrites84.7%

          \[\leadsto \color{blue}{\left(z \cdot z\right) \cdot \left(\frac{0.0007936500793651}{x} + \frac{y}{x}\right)} \]
      5. Recombined 3 regimes into one program.
      6. Final simplification86.2%

        \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) \leq -5 \cdot 10^{+186}:\\ \;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right)\right)}{x}\\ \mathbf{elif}\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) \leq 4 \cdot 10^{+294}:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\\ \end{array} \]
      7. Add Preprocessing

      Alternative 7: 57.4% accurate, 0.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) \leq -5 \cdot 10^{+186}:\\ \;\;\;\;y \cdot \frac{z \cdot z}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (if (<=
            (+
             (/
              (+
               (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
               0.083333333333333)
              x)
             (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)))
            -5e+186)
         (* y (/ (* z z) x))
         (/
          (fma z (fma z 0.0007936500793651 -0.0027777777777778) 0.083333333333333)
          x)))
      double code(double x, double y, double z) {
      	double tmp;
      	if (((((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x))) <= -5e+186) {
      		tmp = y * ((z * z) / x);
      	} else {
      		tmp = fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x;
      	}
      	return tmp;
      }
      
      function code(x, y, z)
      	tmp = 0.0
      	if (Float64(Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))) <= -5e+186)
      		tmp = Float64(y * Float64(Float64(z * z) / x));
      	else
      		tmp = Float64(fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x);
      	end
      	return tmp
      end
      
      code[x_, y_, z_] := If[LessEqual[N[(N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e+186], N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(z * 0.0007936500793651 + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) \leq -5 \cdot 10^{+186}:\\
      \;\;\;\;y \cdot \frac{z \cdot z}{x}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -4.99999999999999954e186

        1. Initial program 94.2%

          \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
        2. Add Preprocessing
        3. Taylor expanded in y around inf

          \[\leadsto \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
        4. Step-by-step derivation
          1. associate-/l*N/A

            \[\leadsto \color{blue}{y \cdot \frac{{z}^{2}}{x}} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{y \cdot \frac{{z}^{2}}{x}} \]
          3. lower-/.f64N/A

            \[\leadsto y \cdot \color{blue}{\frac{{z}^{2}}{x}} \]
          4. unpow2N/A

            \[\leadsto y \cdot \frac{\color{blue}{z \cdot z}}{x} \]
          5. lower-*.f6490.6

            \[\leadsto y \cdot \frac{\color{blue}{z \cdot z}}{x} \]
        5. Applied rewrites90.6%

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

        if -4.99999999999999954e186 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x))

        1. Initial program 93.8%

          \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
        2. Add Preprocessing
        3. Applied rewrites93.9%

          \[\leadsto \color{blue}{\mathsf{fma}\left(x + -0.5, \log x, \left(-x\right) + \left(0.91893853320467 + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}\right)\right)} \]
        4. Taylor expanded in y around 0

          \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right)}{x}}\right)\right) \]
        5. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right)}{x}}\right)\right) \]
          2. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{\color{blue}{z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}}{x}\right)\right) \]
          3. lower-fma.f64N/A

            \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{\color{blue}{\mathsf{fma}\left(z, \frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}, \frac{83333333333333}{1000000000000000}\right)}}{x}\right)\right) \]
          4. sub-negN/A

            \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{\mathsf{fma}\left(z, \color{blue}{\frac{7936500793651}{10000000000000000} \cdot z + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right)}, \frac{83333333333333}{1000000000000000}\right)}{x}\right)\right) \]
          5. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{\mathsf{fma}\left(z, \color{blue}{z \cdot \frac{7936500793651}{10000000000000000}} + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right), \frac{83333333333333}{1000000000000000}\right)}{x}\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{\mathsf{fma}\left(z, z \cdot \frac{7936500793651}{10000000000000000} + \color{blue}{\frac{-13888888888889}{5000000000000000}}, \frac{83333333333333}{1000000000000000}\right)}{x}\right)\right) \]
          7. lower-fma.f6488.5

            \[\leadsto \mathsf{fma}\left(x + -0.5, \log x, \left(-x\right) + \left(0.91893853320467 + \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)}, 0.083333333333333\right)}{x}\right)\right) \]
        6. Applied rewrites88.5%

          \[\leadsto \mathsf{fma}\left(x + -0.5, \log x, \left(-x\right) + \left(0.91893853320467 + \color{blue}{\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}}\right)\right) \]
        7. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right)}{x}} \]
        8. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right)}{x}} \]
          2. +-commutativeN/A

            \[\leadsto \frac{\color{blue}{z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}}{x} \]
          3. lower-fma.f64N/A

            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(z, \frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}, \frac{83333333333333}{1000000000000000}\right)}}{x} \]
          4. sub-negN/A

            \[\leadsto \frac{\mathsf{fma}\left(z, \color{blue}{\frac{7936500793651}{10000000000000000} \cdot z + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right)}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
          5. *-commutativeN/A

            \[\leadsto \frac{\mathsf{fma}\left(z, \color{blue}{z \cdot \frac{7936500793651}{10000000000000000}} + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right), \frac{83333333333333}{1000000000000000}\right)}{x} \]
          6. metadata-evalN/A

            \[\leadsto \frac{\mathsf{fma}\left(z, z \cdot \frac{7936500793651}{10000000000000000} + \color{blue}{\frac{-13888888888889}{5000000000000000}}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
          7. lower-fma.f6456.5

            \[\leadsto \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)}, 0.083333333333333\right)}{x} \]
        9. Applied rewrites56.5%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification61.2%

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

      Alternative 8: 98.6% accurate, 1.0× speedup?

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

        1. Initial program 99.7%

          \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
        2. Add Preprocessing
        3. Applied rewrites99.7%

          \[\leadsto \color{blue}{\left(x + -0.5\right) \cdot \log x - \left(\left(x + -0.91893853320467\right) - \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}\right)} \]

        if 2.85e6 < x

        1. Initial program 88.0%

          \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
        2. Add Preprocessing
        3. Taylor expanded in z around inf

          \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \color{blue}{\frac{{z}^{2} \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)}{x}} \]
        4. Step-by-step derivation
          1. associate-/l*N/A

            \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \color{blue}{{z}^{2} \cdot \frac{\frac{7936500793651}{10000000000000000} + y}{x}} \]
          2. unpow2N/A

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

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

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

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

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

            \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + z \cdot \frac{\color{blue}{z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)}}{x} \]
          8. lower-+.f6498.3

            \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + z \cdot \frac{z \cdot \color{blue}{\left(0.0007936500793651 + y\right)}}{x} \]
        5. Applied rewrites98.3%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2850000:\\ \;\;\;\;\log x \cdot \left(x + -0.5\right) + \left(\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} - \left(x + -0.91893853320467\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + z \cdot \frac{z \cdot \left(y + 0.0007936500793651\right)}{x}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 9: 98.4% accurate, 1.0× speedup?

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

        1. Initial program 99.7%

          \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
        2. Add Preprocessing
        3. Applied rewrites99.7%

          \[\leadsto \color{blue}{\mathsf{fma}\left(x + -0.5, \log x, \left(-x\right) + \left(0.91893853320467 + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}\right)\right)} \]

        if 8e51 < x

        1. Initial program 85.3%

          \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
        2. Add Preprocessing
        3. Taylor expanded in z around inf

          \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \color{blue}{\frac{{z}^{2} \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)}{x}} \]
        4. Step-by-step derivation
          1. associate-/l*N/A

            \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \color{blue}{{z}^{2} \cdot \frac{\frac{7936500793651}{10000000000000000} + y}{x}} \]
          2. unpow2N/A

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

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

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

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

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

            \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + z \cdot \frac{\color{blue}{z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)}}{x} \]
          8. lower-+.f6497.9

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

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

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

      Alternative 10: 97.8% accurate, 1.0× speedup?

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

        1. Initial program 99.7%

          \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
        2. Add Preprocessing
        3. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x}} \]
          2. +-commutativeN/A

            \[\leadsto \frac{\color{blue}{z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}}{x} \]
          3. lower-fma.f64N/A

            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(z, z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}, \frac{83333333333333}{1000000000000000}\right)}}{x} \]
          4. sub-negN/A

            \[\leadsto \frac{\mathsf{fma}\left(z, \color{blue}{z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right)}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
          5. metadata-evalN/A

            \[\leadsto \frac{\mathsf{fma}\left(z, z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) + \color{blue}{\frac{-13888888888889}{5000000000000000}}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
          6. lower-fma.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, \frac{7936500793651}{10000000000000000} + y, \frac{-13888888888889}{5000000000000000}\right)}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
          7. lower-+.f6499.0

            \[\leadsto \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{0.0007936500793651 + y}, -0.0027777777777778\right), 0.083333333333333\right)}{x} \]
        5. Applied rewrites99.0%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), 0.083333333333333\right)}{x}} \]

        if 0.0134999999999999998 < x

        1. Initial program 88.5%

          \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
        2. Add Preprocessing
        3. Taylor expanded in z around inf

          \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \color{blue}{\frac{{z}^{2} \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)}{x}} \]
        4. Step-by-step derivation
          1. associate-/l*N/A

            \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \color{blue}{{z}^{2} \cdot \frac{\frac{7936500793651}{10000000000000000} + y}{x}} \]
          2. unpow2N/A

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

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

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

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

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

            \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + z \cdot \frac{\color{blue}{z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)}}{x} \]
          8. lower-+.f6498.0

            \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + z \cdot \frac{z \cdot \color{blue}{\left(0.0007936500793651 + y\right)}}{x} \]
        5. Applied rewrites98.0%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.0135:\\ \;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + z \cdot \frac{z \cdot \left(y + 0.0007936500793651\right)}{x}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 11: 84.2% accurate, 1.3× speedup?

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

        1. Initial program 99.7%

          \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
        2. Add Preprocessing
        3. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x}} \]
          2. +-commutativeN/A

            \[\leadsto \frac{\color{blue}{z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}}{x} \]
          3. lower-fma.f64N/A

            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(z, z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}, \frac{83333333333333}{1000000000000000}\right)}}{x} \]
          4. sub-negN/A

            \[\leadsto \frac{\mathsf{fma}\left(z, \color{blue}{z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right)}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
          5. metadata-evalN/A

            \[\leadsto \frac{\mathsf{fma}\left(z, z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) + \color{blue}{\frac{-13888888888889}{5000000000000000}}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
          6. lower-fma.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, \frac{7936500793651}{10000000000000000} + y, \frac{-13888888888889}{5000000000000000}\right)}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
          7. lower-+.f6492.4

            \[\leadsto \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{0.0007936500793651 + y}, -0.0027777777777778\right), 0.083333333333333\right)}{x} \]
        5. Applied rewrites92.4%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), 0.083333333333333\right)}{x}} \]

        if 1.3500000000000001e46 < x

        1. Initial program 85.7%

          \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
        2. Add Preprocessing
        3. Taylor expanded in x around inf

          \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} \]
        4. Step-by-step derivation
          1. sub-negN/A

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

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

            \[\leadsto x \cdot \left(\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log x\right)\right)}\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right) \]
          4. remove-double-negN/A

            \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(\mathsf{neg}\left(1\right)\right)\right) \]
          5. metadata-evalN/A

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

            \[\leadsto \color{blue}{\log x \cdot x + -1 \cdot x} \]
          7. neg-mul-1N/A

            \[\leadsto \log x \cdot x + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
          8. *-commutativeN/A

            \[\leadsto \color{blue}{x \cdot \log x} + \left(\mathsf{neg}\left(x\right)\right) \]
          9. lower-fma.f64N/A

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

            \[\leadsto \mathsf{fma}\left(x, \color{blue}{\log x}, \mathsf{neg}\left(x\right)\right) \]
          11. lower-neg.f6468.2

            \[\leadsto \mathsf{fma}\left(x, \log x, \color{blue}{-x}\right) \]
        5. Applied rewrites68.2%

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

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

      Alternative 12: 84.2% accurate, 1.3× speedup?

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

        1. Initial program 99.7%

          \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
        2. Add Preprocessing
        3. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x}} \]
          2. +-commutativeN/A

            \[\leadsto \frac{\color{blue}{z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}}{x} \]
          3. lower-fma.f64N/A

            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(z, z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}, \frac{83333333333333}{1000000000000000}\right)}}{x} \]
          4. sub-negN/A

            \[\leadsto \frac{\mathsf{fma}\left(z, \color{blue}{z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right)}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
          5. metadata-evalN/A

            \[\leadsto \frac{\mathsf{fma}\left(z, z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) + \color{blue}{\frac{-13888888888889}{5000000000000000}}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
          6. lower-fma.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, \frac{7936500793651}{10000000000000000} + y, \frac{-13888888888889}{5000000000000000}\right)}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
          7. lower-+.f6492.4

            \[\leadsto \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{0.0007936500793651 + y}, -0.0027777777777778\right), 0.083333333333333\right)}{x} \]
        5. Applied rewrites92.4%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), 0.083333333333333\right)}{x}} \]

        if 1.3500000000000001e46 < x

        1. Initial program 85.7%

          \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
        2. Add Preprocessing
        3. Applied rewrites85.7%

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

          \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} \]
        5. Step-by-step derivation
          1. sub-negN/A

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

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

            \[\leadsto x \cdot \left(\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log x\right)\right)}\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right) \]
          4. remove-double-negN/A

            \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(\mathsf{neg}\left(1\right)\right)\right) \]
          5. metadata-evalN/A

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

            \[\leadsto \color{blue}{\log x \cdot x + -1 \cdot x} \]
          7. neg-mul-1N/A

            \[\leadsto \log x \cdot x + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
          8. *-commutativeN/A

            \[\leadsto \color{blue}{x \cdot \log x} + \left(\mathsf{neg}\left(x\right)\right) \]
          9. unsub-negN/A

            \[\leadsto \color{blue}{x \cdot \log x - x} \]
          10. lower--.f64N/A

            \[\leadsto \color{blue}{x \cdot \log x - x} \]
          11. lower-*.f64N/A

            \[\leadsto \color{blue}{x \cdot \log x} - x \]
          12. lower-log.f6468.1

            \[\leadsto x \cdot \color{blue}{\log x} - x \]
        6. Applied rewrites68.1%

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

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

      Alternative 13: 61.9% accurate, 2.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(y + 0.0007936500793651\right)\\ t_1 := \frac{z \cdot t\_0}{x}\\ t_2 := z \cdot \left(t\_0 - 0.0027777777777778\right) + 0.083333333333333\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+31}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+14}:\\ \;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (let* ((t_0 (* z (+ y 0.0007936500793651)))
              (t_1 (/ (* z t_0) x))
              (t_2 (+ (* z (- t_0 0.0027777777777778)) 0.083333333333333)))
         (if (<= t_2 -5e+31)
           t_1
           (if (<= t_2 2e+14)
             (/
              (fma
               z
               (fma z 0.0007936500793651 -0.0027777777777778)
               0.083333333333333)
              x)
             t_1))))
      double code(double x, double y, double z) {
      	double t_0 = z * (y + 0.0007936500793651);
      	double t_1 = (z * t_0) / x;
      	double t_2 = (z * (t_0 - 0.0027777777777778)) + 0.083333333333333;
      	double tmp;
      	if (t_2 <= -5e+31) {
      		tmp = t_1;
      	} else if (t_2 <= 2e+14) {
      		tmp = fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z)
      	t_0 = Float64(z * Float64(y + 0.0007936500793651))
      	t_1 = Float64(Float64(z * t_0) / x)
      	t_2 = Float64(Float64(z * Float64(t_0 - 0.0027777777777778)) + 0.083333333333333)
      	tmp = 0.0
      	if (t_2 <= -5e+31)
      		tmp = t_1;
      	elseif (t_2 <= 2e+14)
      		tmp = Float64(fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(z * t$95$0), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * N[(t$95$0 - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+31], t$95$1, If[LessEqual[t$95$2, 2e+14], N[(N[(z * N[(z * 0.0007936500793651 + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], t$95$1]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := z \cdot \left(y + 0.0007936500793651\right)\\
      t_1 := \frac{z \cdot t\_0}{x}\\
      t_2 := z \cdot \left(t\_0 - 0.0027777777777778\right) + 0.083333333333333\\
      \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+31}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+14}:\\
      \;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < -5.00000000000000027e31 or 2e14 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64))

        1. Initial program 89.8%

          \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
        2. Add Preprocessing
        3. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + \left(x \cdot \left(\frac{91893853320467}{100000000000000} + \left(\frac{-1}{2} \cdot \log x + x \cdot \left(\log x - 1\right)\right)\right) + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)\right)}{x}} \]
        4. Applied rewrites77.8%

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

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

            \[\leadsto \color{blue}{\frac{{z}^{2} \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)}{x}} \]
          2. unpow2N/A

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

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

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

            \[\leadsto \frac{z \cdot \color{blue}{\left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)\right)}}{x} \]
          6. lower-+.f6473.6

            \[\leadsto \frac{z \cdot \left(z \cdot \color{blue}{\left(0.0007936500793651 + y\right)}\right)}{x} \]
        7. Applied rewrites73.6%

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

        if -5.00000000000000027e31 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 2e14

        1. Initial program 99.5%

          \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
        2. Add Preprocessing
        3. Applied rewrites99.6%

          \[\leadsto \color{blue}{\mathsf{fma}\left(x + -0.5, \log x, \left(-x\right) + \left(0.91893853320467 + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}\right)\right)} \]
        4. Taylor expanded in y around 0

          \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right)}{x}}\right)\right) \]
        5. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right)}{x}}\right)\right) \]
          2. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{\color{blue}{z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}}{x}\right)\right) \]
          3. lower-fma.f64N/A

            \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{\color{blue}{\mathsf{fma}\left(z, \frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}, \frac{83333333333333}{1000000000000000}\right)}}{x}\right)\right) \]
          4. sub-negN/A

            \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{\mathsf{fma}\left(z, \color{blue}{\frac{7936500793651}{10000000000000000} \cdot z + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right)}, \frac{83333333333333}{1000000000000000}\right)}{x}\right)\right) \]
          5. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{\mathsf{fma}\left(z, \color{blue}{z \cdot \frac{7936500793651}{10000000000000000}} + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right), \frac{83333333333333}{1000000000000000}\right)}{x}\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{\mathsf{fma}\left(z, z \cdot \frac{7936500793651}{10000000000000000} + \color{blue}{\frac{-13888888888889}{5000000000000000}}, \frac{83333333333333}{1000000000000000}\right)}{x}\right)\right) \]
          7. lower-fma.f6499.0

            \[\leadsto \mathsf{fma}\left(x + -0.5, \log x, \left(-x\right) + \left(0.91893853320467 + \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)}, 0.083333333333333\right)}{x}\right)\right) \]
        6. Applied rewrites99.0%

          \[\leadsto \mathsf{fma}\left(x + -0.5, \log x, \left(-x\right) + \left(0.91893853320467 + \color{blue}{\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}}\right)\right) \]
        7. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right)}{x}} \]
        8. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right)}{x}} \]
          2. +-commutativeN/A

            \[\leadsto \frac{\color{blue}{z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}}{x} \]
          3. lower-fma.f64N/A

            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(z, \frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}, \frac{83333333333333}{1000000000000000}\right)}}{x} \]
          4. sub-negN/A

            \[\leadsto \frac{\mathsf{fma}\left(z, \color{blue}{\frac{7936500793651}{10000000000000000} \cdot z + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right)}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
          5. *-commutativeN/A

            \[\leadsto \frac{\mathsf{fma}\left(z, \color{blue}{z \cdot \frac{7936500793651}{10000000000000000}} + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right), \frac{83333333333333}{1000000000000000}\right)}{x} \]
          6. metadata-evalN/A

            \[\leadsto \frac{\mathsf{fma}\left(z, z \cdot \frac{7936500793651}{10000000000000000} + \color{blue}{\frac{-13888888888889}{5000000000000000}}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
          7. lower-fma.f6455.7

            \[\leadsto \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)}, 0.083333333333333\right)}{x} \]
        9. Applied rewrites55.7%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification66.0%

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333 \leq -5 \cdot 10^{+31}:\\ \;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right)\right)}{x}\\ \mathbf{elif}\;z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333 \leq 2 \cdot 10^{+14}:\\ \;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right)\right)}{x}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 14: 57.8% accurate, 2.2× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+31}:\\ \;\;\;\;y \cdot \frac{z \cdot z}{x}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-6}:\\ \;\;\;\;0.91893853320467 + \frac{0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.0007936500793651 \cdot \left(z \cdot z\right)}{x}\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (let* ((t_0 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
         (if (<= t_0 -5e+31)
           (* y (/ (* z z) x))
           (if (<= t_0 5e-6)
             (+ 0.91893853320467 (/ 0.083333333333333 x))
             (/ (* 0.0007936500793651 (* z z)) x)))))
      double code(double x, double y, double z) {
      	double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
      	double tmp;
      	if (t_0 <= -5e+31) {
      		tmp = y * ((z * z) / x);
      	} else if (t_0 <= 5e-6) {
      		tmp = 0.91893853320467 + (0.083333333333333 / x);
      	} else {
      		tmp = (0.0007936500793651 * (z * z)) / 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 = z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)
          if (t_0 <= (-5d+31)) then
              tmp = y * ((z * z) / x)
          else if (t_0 <= 5d-6) then
              tmp = 0.91893853320467d0 + (0.083333333333333d0 / x)
          else
              tmp = (0.0007936500793651d0 * (z * z)) / x
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
      	double tmp;
      	if (t_0 <= -5e+31) {
      		tmp = y * ((z * z) / x);
      	} else if (t_0 <= 5e-6) {
      		tmp = 0.91893853320467 + (0.083333333333333 / x);
      	} else {
      		tmp = (0.0007936500793651 * (z * z)) / x;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)
      	tmp = 0
      	if t_0 <= -5e+31:
      		tmp = y * ((z * z) / x)
      	elif t_0 <= 5e-6:
      		tmp = 0.91893853320467 + (0.083333333333333 / x)
      	else:
      		tmp = (0.0007936500793651 * (z * z)) / x
      	return tmp
      
      function code(x, y, z)
      	t_0 = Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))
      	tmp = 0.0
      	if (t_0 <= -5e+31)
      		tmp = Float64(y * Float64(Float64(z * z) / x));
      	elseif (t_0 <= 5e-6)
      		tmp = Float64(0.91893853320467 + Float64(0.083333333333333 / x));
      	else
      		tmp = Float64(Float64(0.0007936500793651 * Float64(z * z)) / x);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
      	tmp = 0.0;
      	if (t_0 <= -5e+31)
      		tmp = y * ((z * z) / x);
      	elseif (t_0 <= 5e-6)
      		tmp = 0.91893853320467 + (0.083333333333333 / x);
      	else
      		tmp = (0.0007936500793651 * (z * z)) / x;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+31], N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-6], N[(0.91893853320467 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.0007936500793651 * N[(z * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\
      \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+31}:\\
      \;\;\;\;y \cdot \frac{z \cdot z}{x}\\
      
      \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-6}:\\
      \;\;\;\;0.91893853320467 + \frac{0.083333333333333}{x}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{0.0007936500793651 \cdot \left(z \cdot z\right)}{x}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -5.00000000000000027e31

        1. Initial program 95.0%

          \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
        2. Add Preprocessing
        3. Taylor expanded in y around inf

          \[\leadsto \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
        4. Step-by-step derivation
          1. associate-/l*N/A

            \[\leadsto \color{blue}{y \cdot \frac{{z}^{2}}{x}} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{y \cdot \frac{{z}^{2}}{x}} \]
          3. lower-/.f64N/A

            \[\leadsto y \cdot \color{blue}{\frac{{z}^{2}}{x}} \]
          4. unpow2N/A

            \[\leadsto y \cdot \frac{\color{blue}{z \cdot z}}{x} \]
          5. lower-*.f6477.5

            \[\leadsto y \cdot \frac{\color{blue}{z \cdot z}}{x} \]
        5. Applied rewrites77.5%

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

        if -5.00000000000000027e31 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 5.00000000000000041e-6

        1. Initial program 99.5%

          \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
        2. Add Preprocessing
        3. Taylor expanded in z around 0

          \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\color{blue}{\frac{83333333333333}{1000000000000000}}}{x} \]
        4. Step-by-step derivation
          1. Applied rewrites98.7%

            \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\color{blue}{0.083333333333333}}{x} \]
          2. Applied rewrites98.6%

            \[\leadsto \left(\left(\color{blue}{\frac{1}{\frac{1}{\log x \cdot \left(x + -0.5\right)}}} - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
          3. Taylor expanded in x around inf

            \[\leadsto \left(\left(\frac{1}{\color{blue}{\frac{-1}{x \cdot \log \left(\frac{1}{x}\right)}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
          4. Step-by-step derivation
            1. metadata-evalN/A

              \[\leadsto \left(\left(\frac{1}{\frac{\color{blue}{\mathsf{neg}\left(1\right)}}{x \cdot \log \left(\frac{1}{x}\right)}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
            2. distribute-neg-fracN/A

              \[\leadsto \left(\left(\frac{1}{\color{blue}{\mathsf{neg}\left(\frac{1}{x \cdot \log \left(\frac{1}{x}\right)}\right)}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
            3. distribute-neg-frac2N/A

              \[\leadsto \left(\left(\frac{1}{\color{blue}{\frac{1}{\mathsf{neg}\left(x \cdot \log \left(\frac{1}{x}\right)\right)}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
            4. distribute-rgt-neg-inN/A

              \[\leadsto \left(\left(\frac{1}{\frac{1}{\color{blue}{x \cdot \left(\mathsf{neg}\left(\log \left(\frac{1}{x}\right)\right)\right)}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
            5. log-recN/A

              \[\leadsto \left(\left(\frac{1}{\frac{1}{x \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log x\right)\right)}\right)\right)}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
            6. remove-double-negN/A

              \[\leadsto \left(\left(\frac{1}{\frac{1}{x \cdot \color{blue}{\log x}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
            7. lower-/.f64N/A

              \[\leadsto \left(\left(\frac{1}{\color{blue}{\frac{1}{x \cdot \log x}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
            8. lower-*.f64N/A

              \[\leadsto \left(\left(\frac{1}{\frac{1}{\color{blue}{x \cdot \log x}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
            9. lower-log.f6496.7

              \[\leadsto \left(\left(\frac{1}{\frac{1}{x \cdot \color{blue}{\log x}}} - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
          5. Applied rewrites96.7%

            \[\leadsto \left(\left(\frac{1}{\color{blue}{\frac{1}{x \cdot \log x}}} - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
          6. Taylor expanded in x around 0

            \[\leadsto \color{blue}{\frac{91893853320467}{100000000000000}} + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
          7. Step-by-step derivation
            1. Applied rewrites56.2%

              \[\leadsto \color{blue}{0.91893853320467} + \frac{0.083333333333333}{x} \]

            if 5.00000000000000041e-6 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z)

            1. Initial program 88.3%

              \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
            2. Add Preprocessing
            3. Applied rewrites88.3%

              \[\leadsto \color{blue}{\mathsf{fma}\left(x + -0.5, \log x, \left(-x\right) + \left(0.91893853320467 + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}\right)\right)} \]
            4. Taylor expanded in y around 0

              \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right)}{x}}\right)\right) \]
            5. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right)}{x}}\right)\right) \]
              2. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{\color{blue}{z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}}{x}\right)\right) \]
              3. lower-fma.f64N/A

                \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{\color{blue}{\mathsf{fma}\left(z, \frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}, \frac{83333333333333}{1000000000000000}\right)}}{x}\right)\right) \]
              4. sub-negN/A

                \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{\mathsf{fma}\left(z, \color{blue}{\frac{7936500793651}{10000000000000000} \cdot z + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right)}, \frac{83333333333333}{1000000000000000}\right)}{x}\right)\right) \]
              5. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{\mathsf{fma}\left(z, \color{blue}{z \cdot \frac{7936500793651}{10000000000000000}} + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right), \frac{83333333333333}{1000000000000000}\right)}{x}\right)\right) \]
              6. metadata-evalN/A

                \[\leadsto \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \left(\mathsf{neg}\left(x\right)\right) + \left(\frac{91893853320467}{100000000000000} + \frac{\mathsf{fma}\left(z, z \cdot \frac{7936500793651}{10000000000000000} + \color{blue}{\frac{-13888888888889}{5000000000000000}}, \frac{83333333333333}{1000000000000000}\right)}{x}\right)\right) \]
              7. lower-fma.f6478.2

                \[\leadsto \mathsf{fma}\left(x + -0.5, \log x, \left(-x\right) + \left(0.91893853320467 + \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)}, 0.083333333333333\right)}{x}\right)\right) \]
            6. Applied rewrites78.2%

              \[\leadsto \mathsf{fma}\left(x + -0.5, \log x, \left(-x\right) + \left(0.91893853320467 + \color{blue}{\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}}\right)\right) \]
            7. Taylor expanded in z around inf

              \[\leadsto \color{blue}{\frac{7936500793651}{10000000000000000} \cdot \frac{{z}^{2}}{x}} \]
            8. Step-by-step derivation
              1. associate-*r/N/A

                \[\leadsto \color{blue}{\frac{\frac{7936500793651}{10000000000000000} \cdot {z}^{2}}{x}} \]
              2. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{\frac{7936500793651}{10000000000000000} \cdot {z}^{2}}{x}} \]
              3. lower-*.f64N/A

                \[\leadsto \frac{\color{blue}{\frac{7936500793651}{10000000000000000} \cdot {z}^{2}}}{x} \]
              4. unpow2N/A

                \[\leadsto \frac{\frac{7936500793651}{10000000000000000} \cdot \color{blue}{\left(z \cdot z\right)}}{x} \]
              5. lower-*.f6459.0

                \[\leadsto \frac{0.0007936500793651 \cdot \color{blue}{\left(z \cdot z\right)}}{x} \]
            9. Applied rewrites59.0%

              \[\leadsto \color{blue}{\frac{0.0007936500793651 \cdot \left(z \cdot z\right)}{x}} \]
          8. Recombined 3 regimes into one program.
          9. Final simplification60.8%

            \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) \leq -5 \cdot 10^{+31}:\\ \;\;\;\;y \cdot \frac{z \cdot z}{x}\\ \mathbf{elif}\;z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) \leq 5 \cdot 10^{-6}:\\ \;\;\;\;0.91893853320467 + \frac{0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.0007936500793651 \cdot \left(z \cdot z\right)}{x}\\ \end{array} \]
          10. Add Preprocessing

          Alternative 15: 52.0% accurate, 2.2× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+31}:\\ \;\;\;\;y \cdot \frac{z \cdot z}{x}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+26}:\\ \;\;\;\;0.91893853320467 + \frac{0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(z \cdot \frac{z}{x}\right)\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (let* ((t_0 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
             (if (<= t_0 -5e+31)
               (* y (/ (* z z) x))
               (if (<= t_0 5e+26)
                 (+ 0.91893853320467 (/ 0.083333333333333 x))
                 (* y (* z (/ z x)))))))
          double code(double x, double y, double z) {
          	double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
          	double tmp;
          	if (t_0 <= -5e+31) {
          		tmp = y * ((z * z) / x);
          	} else if (t_0 <= 5e+26) {
          		tmp = 0.91893853320467 + (0.083333333333333 / x);
          	} else {
          		tmp = y * (z * (z / 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 = z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)
              if (t_0 <= (-5d+31)) then
                  tmp = y * ((z * z) / x)
              else if (t_0 <= 5d+26) then
                  tmp = 0.91893853320467d0 + (0.083333333333333d0 / x)
              else
                  tmp = y * (z * (z / x))
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z) {
          	double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
          	double tmp;
          	if (t_0 <= -5e+31) {
          		tmp = y * ((z * z) / x);
          	} else if (t_0 <= 5e+26) {
          		tmp = 0.91893853320467 + (0.083333333333333 / x);
          	} else {
          		tmp = y * (z * (z / x));
          	}
          	return tmp;
          }
          
          def code(x, y, z):
          	t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)
          	tmp = 0
          	if t_0 <= -5e+31:
          		tmp = y * ((z * z) / x)
          	elif t_0 <= 5e+26:
          		tmp = 0.91893853320467 + (0.083333333333333 / x)
          	else:
          		tmp = y * (z * (z / x))
          	return tmp
          
          function code(x, y, z)
          	t_0 = Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))
          	tmp = 0.0
          	if (t_0 <= -5e+31)
          		tmp = Float64(y * Float64(Float64(z * z) / x));
          	elseif (t_0 <= 5e+26)
          		tmp = Float64(0.91893853320467 + Float64(0.083333333333333 / x));
          	else
          		tmp = Float64(y * Float64(z * Float64(z / x)));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z)
          	t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
          	tmp = 0.0;
          	if (t_0 <= -5e+31)
          		tmp = y * ((z * z) / x);
          	elseif (t_0 <= 5e+26)
          		tmp = 0.91893853320467 + (0.083333333333333 / x);
          	else
          		tmp = y * (z * (z / x));
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+31], N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+26], N[(0.91893853320467 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\
          \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+31}:\\
          \;\;\;\;y \cdot \frac{z \cdot z}{x}\\
          
          \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+26}:\\
          \;\;\;\;0.91893853320467 + \frac{0.083333333333333}{x}\\
          
          \mathbf{else}:\\
          \;\;\;\;y \cdot \left(z \cdot \frac{z}{x}\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -5.00000000000000027e31

            1. Initial program 95.0%

              \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
            2. Add Preprocessing
            3. Taylor expanded in y around inf

              \[\leadsto \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
            4. Step-by-step derivation
              1. associate-/l*N/A

                \[\leadsto \color{blue}{y \cdot \frac{{z}^{2}}{x}} \]
              2. lower-*.f64N/A

                \[\leadsto \color{blue}{y \cdot \frac{{z}^{2}}{x}} \]
              3. lower-/.f64N/A

                \[\leadsto y \cdot \color{blue}{\frac{{z}^{2}}{x}} \]
              4. unpow2N/A

                \[\leadsto y \cdot \frac{\color{blue}{z \cdot z}}{x} \]
              5. lower-*.f6477.5

                \[\leadsto y \cdot \frac{\color{blue}{z \cdot z}}{x} \]
            5. Applied rewrites77.5%

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

            if -5.00000000000000027e31 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 5.0000000000000001e26

            1. Initial program 99.4%

              \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
            2. Add Preprocessing
            3. Taylor expanded in z around 0

              \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\color{blue}{\frac{83333333333333}{1000000000000000}}}{x} \]
            4. Step-by-step derivation
              1. Applied rewrites96.6%

                \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\color{blue}{0.083333333333333}}{x} \]
              2. Applied rewrites96.6%

                \[\leadsto \left(\left(\color{blue}{\frac{1}{\frac{1}{\log x \cdot \left(x + -0.5\right)}}} - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
              3. Taylor expanded in x around inf

                \[\leadsto \left(\left(\frac{1}{\color{blue}{\frac{-1}{x \cdot \log \left(\frac{1}{x}\right)}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
              4. Step-by-step derivation
                1. metadata-evalN/A

                  \[\leadsto \left(\left(\frac{1}{\frac{\color{blue}{\mathsf{neg}\left(1\right)}}{x \cdot \log \left(\frac{1}{x}\right)}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                2. distribute-neg-fracN/A

                  \[\leadsto \left(\left(\frac{1}{\color{blue}{\mathsf{neg}\left(\frac{1}{x \cdot \log \left(\frac{1}{x}\right)}\right)}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                3. distribute-neg-frac2N/A

                  \[\leadsto \left(\left(\frac{1}{\color{blue}{\frac{1}{\mathsf{neg}\left(x \cdot \log \left(\frac{1}{x}\right)\right)}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                4. distribute-rgt-neg-inN/A

                  \[\leadsto \left(\left(\frac{1}{\frac{1}{\color{blue}{x \cdot \left(\mathsf{neg}\left(\log \left(\frac{1}{x}\right)\right)\right)}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                5. log-recN/A

                  \[\leadsto \left(\left(\frac{1}{\frac{1}{x \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log x\right)\right)}\right)\right)}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                6. remove-double-negN/A

                  \[\leadsto \left(\left(\frac{1}{\frac{1}{x \cdot \color{blue}{\log x}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                7. lower-/.f64N/A

                  \[\leadsto \left(\left(\frac{1}{\color{blue}{\frac{1}{x \cdot \log x}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                8. lower-*.f64N/A

                  \[\leadsto \left(\left(\frac{1}{\frac{1}{\color{blue}{x \cdot \log x}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                9. lower-log.f6494.3

                  \[\leadsto \left(\left(\frac{1}{\frac{1}{x \cdot \color{blue}{\log x}}} - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
              5. Applied rewrites94.3%

                \[\leadsto \left(\left(\frac{1}{\color{blue}{\frac{1}{x \cdot \log x}}} - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
              6. Taylor expanded in x around 0

                \[\leadsto \color{blue}{\frac{91893853320467}{100000000000000}} + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
              7. Step-by-step derivation
                1. Applied rewrites53.7%

                  \[\leadsto \color{blue}{0.91893853320467} + \frac{0.083333333333333}{x} \]

                if 5.0000000000000001e26 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z)

                1. Initial program 87.6%

                  \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
                2. Add Preprocessing
                3. Taylor expanded in y around inf

                  \[\leadsto \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
                4. Step-by-step derivation
                  1. associate-/l*N/A

                    \[\leadsto \color{blue}{y \cdot \frac{{z}^{2}}{x}} \]
                  2. lower-*.f64N/A

                    \[\leadsto \color{blue}{y \cdot \frac{{z}^{2}}{x}} \]
                  3. lower-/.f64N/A

                    \[\leadsto y \cdot \color{blue}{\frac{{z}^{2}}{x}} \]
                  4. unpow2N/A

                    \[\leadsto y \cdot \frac{\color{blue}{z \cdot z}}{x} \]
                  5. lower-*.f6450.0

                    \[\leadsto y \cdot \frac{\color{blue}{z \cdot z}}{x} \]
                5. Applied rewrites50.0%

                  \[\leadsto \color{blue}{y \cdot \frac{z \cdot z}{x}} \]
                6. Step-by-step derivation
                  1. associate-/l*N/A

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

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

                    \[\leadsto y \cdot \color{blue}{\left(\frac{z}{x} \cdot z\right)} \]
                  4. lower-/.f6450.6

                    \[\leadsto y \cdot \left(\color{blue}{\frac{z}{x}} \cdot z\right) \]
                7. Applied rewrites50.6%

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) \leq -5 \cdot 10^{+31}:\\ \;\;\;\;y \cdot \frac{z \cdot z}{x}\\ \mathbf{elif}\;z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) \leq 5 \cdot 10^{+26}:\\ \;\;\;\;0.91893853320467 + \frac{0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(z \cdot \frac{z}{x}\right)\\ \end{array} \]
              10. Add Preprocessing

              Alternative 16: 52.2% accurate, 2.2× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\ t_1 := y \cdot \left(z \cdot \frac{z}{x}\right)\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+31}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+26}:\\ \;\;\;\;0.91893853320467 + \frac{0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
              (FPCore (x y z)
               :precision binary64
               (let* ((t_0 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
                      (t_1 (* y (* z (/ z x)))))
                 (if (<= t_0 -5e+31)
                   t_1
                   (if (<= t_0 5e+26) (+ 0.91893853320467 (/ 0.083333333333333 x)) t_1))))
              double code(double x, double y, double z) {
              	double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
              	double t_1 = y * (z * (z / x));
              	double tmp;
              	if (t_0 <= -5e+31) {
              		tmp = t_1;
              	} else if (t_0 <= 5e+26) {
              		tmp = 0.91893853320467 + (0.083333333333333 / x);
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              real(8) function code(x, y, z)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8) :: t_0
                  real(8) :: t_1
                  real(8) :: tmp
                  t_0 = z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)
                  t_1 = y * (z * (z / x))
                  if (t_0 <= (-5d+31)) then
                      tmp = t_1
                  else if (t_0 <= 5d+26) then
                      tmp = 0.91893853320467d0 + (0.083333333333333d0 / x)
                  else
                      tmp = t_1
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z) {
              	double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
              	double t_1 = y * (z * (z / x));
              	double tmp;
              	if (t_0 <= -5e+31) {
              		tmp = t_1;
              	} else if (t_0 <= 5e+26) {
              		tmp = 0.91893853320467 + (0.083333333333333 / x);
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              def code(x, y, z):
              	t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)
              	t_1 = y * (z * (z / x))
              	tmp = 0
              	if t_0 <= -5e+31:
              		tmp = t_1
              	elif t_0 <= 5e+26:
              		tmp = 0.91893853320467 + (0.083333333333333 / x)
              	else:
              		tmp = t_1
              	return tmp
              
              function code(x, y, z)
              	t_0 = Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))
              	t_1 = Float64(y * Float64(z * Float64(z / x)))
              	tmp = 0.0
              	if (t_0 <= -5e+31)
              		tmp = t_1;
              	elseif (t_0 <= 5e+26)
              		tmp = Float64(0.91893853320467 + Float64(0.083333333333333 / x));
              	else
              		tmp = t_1;
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z)
              	t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
              	t_1 = y * (z * (z / x));
              	tmp = 0.0;
              	if (t_0 <= -5e+31)
              		tmp = t_1;
              	elseif (t_0 <= 5e+26)
              		tmp = 0.91893853320467 + (0.083333333333333 / x);
              	else
              		tmp = t_1;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+31], t$95$1, If[LessEqual[t$95$0, 5e+26], N[(0.91893853320467 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\
              t_1 := y \cdot \left(z \cdot \frac{z}{x}\right)\\
              \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+31}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+26}:\\
              \;\;\;\;0.91893853320467 + \frac{0.083333333333333}{x}\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_1\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -5.00000000000000027e31 or 5.0000000000000001e26 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z)

                1. Initial program 89.7%

                  \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
                2. Add Preprocessing
                3. Taylor expanded in y around inf

                  \[\leadsto \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
                4. Step-by-step derivation
                  1. associate-/l*N/A

                    \[\leadsto \color{blue}{y \cdot \frac{{z}^{2}}{x}} \]
                  2. lower-*.f64N/A

                    \[\leadsto \color{blue}{y \cdot \frac{{z}^{2}}{x}} \]
                  3. lower-/.f64N/A

                    \[\leadsto y \cdot \color{blue}{\frac{{z}^{2}}{x}} \]
                  4. unpow2N/A

                    \[\leadsto y \cdot \frac{\color{blue}{z \cdot z}}{x} \]
                  5. lower-*.f6457.7

                    \[\leadsto y \cdot \frac{\color{blue}{z \cdot z}}{x} \]
                5. Applied rewrites57.7%

                  \[\leadsto \color{blue}{y \cdot \frac{z \cdot z}{x}} \]
                6. Step-by-step derivation
                  1. associate-/l*N/A

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

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

                    \[\leadsto y \cdot \color{blue}{\left(\frac{z}{x} \cdot z\right)} \]
                  4. lower-/.f6458.2

                    \[\leadsto y \cdot \left(\color{blue}{\frac{z}{x}} \cdot z\right) \]
                7. Applied rewrites58.2%

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

                if -5.00000000000000027e31 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 5.0000000000000001e26

                1. Initial program 99.4%

                  \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
                2. Add Preprocessing
                3. Taylor expanded in z around 0

                  \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\color{blue}{\frac{83333333333333}{1000000000000000}}}{x} \]
                4. Step-by-step derivation
                  1. Applied rewrites96.6%

                    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\color{blue}{0.083333333333333}}{x} \]
                  2. Applied rewrites96.6%

                    \[\leadsto \left(\left(\color{blue}{\frac{1}{\frac{1}{\log x \cdot \left(x + -0.5\right)}}} - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
                  3. Taylor expanded in x around inf

                    \[\leadsto \left(\left(\frac{1}{\color{blue}{\frac{-1}{x \cdot \log \left(\frac{1}{x}\right)}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                  4. Step-by-step derivation
                    1. metadata-evalN/A

                      \[\leadsto \left(\left(\frac{1}{\frac{\color{blue}{\mathsf{neg}\left(1\right)}}{x \cdot \log \left(\frac{1}{x}\right)}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                    2. distribute-neg-fracN/A

                      \[\leadsto \left(\left(\frac{1}{\color{blue}{\mathsf{neg}\left(\frac{1}{x \cdot \log \left(\frac{1}{x}\right)}\right)}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                    3. distribute-neg-frac2N/A

                      \[\leadsto \left(\left(\frac{1}{\color{blue}{\frac{1}{\mathsf{neg}\left(x \cdot \log \left(\frac{1}{x}\right)\right)}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                    4. distribute-rgt-neg-inN/A

                      \[\leadsto \left(\left(\frac{1}{\frac{1}{\color{blue}{x \cdot \left(\mathsf{neg}\left(\log \left(\frac{1}{x}\right)\right)\right)}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                    5. log-recN/A

                      \[\leadsto \left(\left(\frac{1}{\frac{1}{x \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log x\right)\right)}\right)\right)}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                    6. remove-double-negN/A

                      \[\leadsto \left(\left(\frac{1}{\frac{1}{x \cdot \color{blue}{\log x}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                    7. lower-/.f64N/A

                      \[\leadsto \left(\left(\frac{1}{\color{blue}{\frac{1}{x \cdot \log x}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                    8. lower-*.f64N/A

                      \[\leadsto \left(\left(\frac{1}{\frac{1}{\color{blue}{x \cdot \log x}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                    9. lower-log.f6494.3

                      \[\leadsto \left(\left(\frac{1}{\frac{1}{x \cdot \color{blue}{\log x}}} - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
                  5. Applied rewrites94.3%

                    \[\leadsto \left(\left(\frac{1}{\color{blue}{\frac{1}{x \cdot \log x}}} - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
                  6. Taylor expanded in x around 0

                    \[\leadsto \color{blue}{\frac{91893853320467}{100000000000000}} + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                  7. Step-by-step derivation
                    1. Applied rewrites53.7%

                      \[\leadsto \color{blue}{0.91893853320467} + \frac{0.083333333333333}{x} \]
                  8. Recombined 2 regimes into one program.
                  9. Final simplification56.3%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) \leq -5 \cdot 10^{+31}:\\ \;\;\;\;y \cdot \left(z \cdot \frac{z}{x}\right)\\ \mathbf{elif}\;z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) \leq 5 \cdot 10^{+26}:\\ \;\;\;\;0.91893853320467 + \frac{0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(z \cdot \frac{z}{x}\right)\\ \end{array} \]
                  10. Add Preprocessing

                  Alternative 17: 62.7% accurate, 5.5× speedup?

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

                    \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
                  2. Add Preprocessing
                  3. Taylor expanded in x around 0

                    \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x}} \]
                  4. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x}} \]
                    2. +-commutativeN/A

                      \[\leadsto \frac{\color{blue}{z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}}{x} \]
                    3. lower-fma.f64N/A

                      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(z, z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}, \frac{83333333333333}{1000000000000000}\right)}}{x} \]
                    4. sub-negN/A

                      \[\leadsto \frac{\mathsf{fma}\left(z, \color{blue}{z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right)}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
                    5. metadata-evalN/A

                      \[\leadsto \frac{\mathsf{fma}\left(z, z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) + \color{blue}{\frac{-13888888888889}{5000000000000000}}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
                    6. lower-fma.f64N/A

                      \[\leadsto \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, \frac{7936500793651}{10000000000000000} + y, \frac{-13888888888889}{5000000000000000}\right)}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
                    7. lower-+.f6466.3

                      \[\leadsto \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{0.0007936500793651 + y}, -0.0027777777777778\right), 0.083333333333333\right)}{x} \]
                  5. Applied rewrites66.3%

                    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), 0.083333333333333\right)}{x}} \]
                  6. Final simplification66.3%

                    \[\leadsto \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x} \]
                  7. Add Preprocessing

                  Alternative 18: 23.0% accurate, 9.9× speedup?

                  \[\begin{array}{l} \\ 0.91893853320467 + \frac{0.083333333333333}{x} \end{array} \]
                  (FPCore (x y z)
                   :precision binary64
                   (+ 0.91893853320467 (/ 0.083333333333333 x)))
                  double code(double x, double y, double z) {
                  	return 0.91893853320467 + (0.083333333333333 / 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.91893853320467d0 + (0.083333333333333d0 / x)
                  end function
                  
                  public static double code(double x, double y, double z) {
                  	return 0.91893853320467 + (0.083333333333333 / x);
                  }
                  
                  def code(x, y, z):
                  	return 0.91893853320467 + (0.083333333333333 / x)
                  
                  function code(x, y, z)
                  	return Float64(0.91893853320467 + Float64(0.083333333333333 / x))
                  end
                  
                  function tmp = code(x, y, z)
                  	tmp = 0.91893853320467 + (0.083333333333333 / x);
                  end
                  
                  code[x_, y_, z_] := N[(0.91893853320467 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  0.91893853320467 + \frac{0.083333333333333}{x}
                  \end{array}
                  
                  Derivation
                  1. Initial program 93.9%

                    \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
                  2. Add Preprocessing
                  3. Taylor expanded in z around 0

                    \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\color{blue}{\frac{83333333333333}{1000000000000000}}}{x} \]
                  4. Step-by-step derivation
                    1. Applied rewrites55.7%

                      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\color{blue}{0.083333333333333}}{x} \]
                    2. Applied rewrites55.7%

                      \[\leadsto \left(\left(\color{blue}{\frac{1}{\frac{1}{\log x \cdot \left(x + -0.5\right)}}} - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
                    3. Taylor expanded in x around inf

                      \[\leadsto \left(\left(\frac{1}{\color{blue}{\frac{-1}{x \cdot \log \left(\frac{1}{x}\right)}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                    4. Step-by-step derivation
                      1. metadata-evalN/A

                        \[\leadsto \left(\left(\frac{1}{\frac{\color{blue}{\mathsf{neg}\left(1\right)}}{x \cdot \log \left(\frac{1}{x}\right)}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                      2. distribute-neg-fracN/A

                        \[\leadsto \left(\left(\frac{1}{\color{blue}{\mathsf{neg}\left(\frac{1}{x \cdot \log \left(\frac{1}{x}\right)}\right)}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                      3. distribute-neg-frac2N/A

                        \[\leadsto \left(\left(\frac{1}{\color{blue}{\frac{1}{\mathsf{neg}\left(x \cdot \log \left(\frac{1}{x}\right)\right)}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                      4. distribute-rgt-neg-inN/A

                        \[\leadsto \left(\left(\frac{1}{\frac{1}{\color{blue}{x \cdot \left(\mathsf{neg}\left(\log \left(\frac{1}{x}\right)\right)\right)}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                      5. log-recN/A

                        \[\leadsto \left(\left(\frac{1}{\frac{1}{x \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log x\right)\right)}\right)\right)}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                      6. remove-double-negN/A

                        \[\leadsto \left(\left(\frac{1}{\frac{1}{x \cdot \color{blue}{\log x}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                      7. lower-/.f64N/A

                        \[\leadsto \left(\left(\frac{1}{\color{blue}{\frac{1}{x \cdot \log x}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                      8. lower-*.f64N/A

                        \[\leadsto \left(\left(\frac{1}{\frac{1}{\color{blue}{x \cdot \log x}}} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                      9. lower-log.f6454.7

                        \[\leadsto \left(\left(\frac{1}{\frac{1}{x \cdot \color{blue}{\log x}}} - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
                    5. Applied rewrites54.7%

                      \[\leadsto \left(\left(\frac{1}{\color{blue}{\frac{1}{x \cdot \log x}}} - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
                    6. Taylor expanded in x around 0

                      \[\leadsto \color{blue}{\frac{91893853320467}{100000000000000}} + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                    7. Step-by-step derivation
                      1. Applied rewrites25.1%

                        \[\leadsto \color{blue}{0.91893853320467} + \frac{0.083333333333333}{x} \]
                      2. Add Preprocessing

                      Alternative 19: 22.4% accurate, 12.3× speedup?

                      \[\begin{array}{l} \\ \frac{0.083333333333333}{x} \end{array} \]
                      (FPCore (x y z) :precision binary64 (/ 0.083333333333333 x))
                      double code(double x, double y, double z) {
                      	return 0.083333333333333 / 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.083333333333333d0 / x
                      end function
                      
                      public static double code(double x, double y, double z) {
                      	return 0.083333333333333 / x;
                      }
                      
                      def code(x, y, z):
                      	return 0.083333333333333 / x
                      
                      function code(x, y, z)
                      	return Float64(0.083333333333333 / x)
                      end
                      
                      function tmp = code(x, y, z)
                      	tmp = 0.083333333333333 / x;
                      end
                      
                      code[x_, y_, z_] := N[(0.083333333333333 / x), $MachinePrecision]
                      
                      \begin{array}{l}
                      
                      \\
                      \frac{0.083333333333333}{x}
                      \end{array}
                      
                      Derivation
                      1. Initial program 93.9%

                        \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
                      2. Add Preprocessing
                      3. Taylor expanded in z around 0

                        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\color{blue}{\frac{83333333333333}{1000000000000000}}}{x} \]
                      4. Step-by-step derivation
                        1. Applied rewrites55.7%

                          \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\color{blue}{0.083333333333333}}{x} \]
                        2. Taylor expanded in x around 0

                          \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000}}{x}} \]
                        3. Step-by-step derivation
                          1. lower-/.f6424.5

                            \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
                        4. Applied rewrites24.5%

                          \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
                        5. Add Preprocessing

                        Alternative 20: 1.3% accurate, 49.3× speedup?

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

                          \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
                        2. Add Preprocessing
                        3. Taylor expanded in z around 0

                          \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\color{blue}{\frac{83333333333333}{1000000000000000}}}{x} \]
                        4. Step-by-step derivation
                          1. Applied rewrites55.7%

                            \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\color{blue}{0.083333333333333}}{x} \]
                          2. Applied rewrites55.7%

                            \[\leadsto \color{blue}{\frac{0.083333333333333}{x} + \left(\mathsf{fma}\left(\log x, x + -0.5, 0.91893853320467\right) - x\right)} \]
                          3. Taylor expanded in x around 0

                            \[\leadsto \frac{\frac{83333333333333}{1000000000000000}}{x} + \left(\mathsf{fma}\left(\log x, \color{blue}{\frac{-1}{2}}, \frac{91893853320467}{100000000000000}\right) - x\right) \]
                          4. Step-by-step derivation
                            1. Applied rewrites23.7%

                              \[\leadsto \frac{0.083333333333333}{x} + \left(\mathsf{fma}\left(\log x, \color{blue}{-0.5}, 0.91893853320467\right) - x\right) \]
                            2. Taylor expanded in x around inf

                              \[\leadsto \color{blue}{-1 \cdot x} \]
                            3. Step-by-step derivation
                              1. mul-1-negN/A

                                \[\leadsto \color{blue}{\mathsf{neg}\left(x\right)} \]
                              2. lower-neg.f641.2

                                \[\leadsto \color{blue}{-x} \]
                            4. Applied rewrites1.2%

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

                            Developer Target 1: 98.6% accurate, 0.9× speedup?

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

                            Reproduce

                            ?
                            herbie shell --seed 2024216 
                            (FPCore (x y z)
                              :name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
                              :precision binary64
                            
                              :alt
                              (! :herbie-platform default (+ (+ (+ (* (- x 1/2) (log x)) (- 91893853320467/100000000000000 x)) (/ 83333333333333/1000000000000000 x)) (* (/ z x) (- (* z (+ y 7936500793651/10000000000000000)) 13888888888889/5000000000000000))))
                            
                              (+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))