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

Percentage Accurate: 94.1% → 98.5%
Time: 16.9s
Alternatives: 17
Speedup: 1.1×

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 17 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: 94.1% 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: 98.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 5 \cdot 10^{+36}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, \mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\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 5e+36)
   (fma
    (fma
     z
     (fma (+ y 0.0007936500793651) z -0.0027777777777778)
     0.083333333333333)
    (/ 1.0 x)
    (fma (+ x -0.5) (log x) (- 0.91893853320467 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 <= 5e+36) {
		tmp = fma(fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333), (1.0 / x), fma((x + -0.5), log(x), (0.91893853320467 - 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 <= 5e+36)
		tmp = fma(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333), Float64(1.0 / x), fma(Float64(x + -0.5), log(x), Float64(0.91893853320467 - 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, 5e+36], N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] * N[(1.0 / x), $MachinePrecision] + N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - x), $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 5 \cdot 10^{+36}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, \mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\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 < 4.99999999999999977e36

    1. Initial program 99.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. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999977e36 < x

    1. Initial program 86.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 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. *-lowering-*.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. /-lowering-/.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. *-lowering-*.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. +-lowering-+.f6497.2

        \[\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. Simplified97.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 5 \cdot 10^{+36}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, \mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\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 2: 59.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} \leq -5 \cdot 10^{+55}:\\ \;\;\;\;\left(z \cdot y\right) \cdot \frac{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 (<=
      (+
       (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
       (/
        (+
         0.083333333333333
         (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
        x))
      -5e+55)
   (* (* z y) (/ z x))
   (/
    (fma z (fma z 0.0007936500793651 -0.0027777777777778) 0.083333333333333)
    x)))
double code(double x, double y, double z) {
	double tmp;
	if (((0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x)) <= -5e+55) {
		tmp = (z * y) * (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(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x)) <= -5e+55)
		tmp = Float64(Float64(z * y) * Float64(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[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], -5e+55], N[(N[(z * y), $MachinePrecision] * N[(z / 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}\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} \leq -5 \cdot 10^{+55}:\\
\;\;\;\;\left(z \cdot y\right) \cdot \frac{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)) < -5.00000000000000046e55

    1. Initial program 83.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 inf

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

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

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

        \[\leadsto \frac{y \cdot \color{blue}{\left(z \cdot z\right)}}{x} \]
      4. *-lowering-*.f6484.0

        \[\leadsto \frac{y \cdot \color{blue}{\left(z \cdot z\right)}}{x} \]
    5. Simplified84.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(z \cdot y\right)} \cdot \frac{z}{x} \]
      6. /-lowering-/.f6489.3

        \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{\frac{z}{x}} \]
    7. Applied egg-rr89.3%

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

    if -5.00000000000000046e55 < (+.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 95.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) + \frac{z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right)}{x}\right)\right)\right) - x} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\log x, -0.5 + x, \mathsf{fma}\left(z, \frac{\mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)}{x}, \frac{0.083333333333333}{x}\right)\right) + \left(0.91893853320467 - x\right)} \]
    6. 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}} \]
    7. Step-by-step derivation
      1. /-lowering-/.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. accelerator-lowering-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. accelerator-lowering-fma.f6454.2

        \[\leadsto \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)}, 0.083333333333333\right)}{x} \]
    8. Simplified54.2%

      \[\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 simplification59.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} \leq -5 \cdot 10^{+55}:\\ \;\;\;\;\left(z \cdot y\right) \cdot \frac{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 3: 97.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1.8 \cdot 10^{-19}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, x \cdot \left(\log x + -1\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 1.8e-19)
   (fma
    (fma
     z
     (fma (+ y 0.0007936500793651) z -0.0027777777777778)
     0.083333333333333)
    (/ 1.0 x)
    (* x (+ (log x) -1.0)))
   (+
    (+ 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 <= 1.8e-19) {
		tmp = fma(fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333), (1.0 / x), (x * (log(x) + -1.0)));
	} 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 <= 1.8e-19)
		tmp = fma(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333), Float64(1.0 / x), Float64(x * Float64(log(x) + -1.0)));
	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, 1.8e-19], N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] * N[(1.0 / x), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $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 1.8 \cdot 10^{-19}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, x \cdot \left(\log x + -1\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 < 1.8000000000000001e-19

    1. Initial program 99.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. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right), \frac{1}{x}, 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)\right) \]
      3. distribute-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, x \cdot \left(-1 + \color{blue}{\log x}\right)\right) \]
    7. Simplified99.7%

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

    if 1.8000000000000001e-19 < x

    1. Initial program 88.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 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. *-lowering-*.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. /-lowering-/.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. *-lowering-*.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. +-lowering-+.f6497.4

        \[\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. Simplified97.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.8 \cdot 10^{-19}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, x \cdot \left(\log x + -1\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 4: 94.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := \log x + -1\\
\mathbf{if}\;x \leq 100000000000:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, x \cdot t\_0\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, x, \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\right)\\


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

    1. Initial program 99.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. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right), \frac{1}{x}, 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)\right) \]
      3. distribute-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right), \frac{1}{x}, x \cdot \left(-1 + \color{blue}{\log x}\right)\right) \]
      17. log-lowering-log.f6499.5

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, x \cdot \left(-1 + \color{blue}{\log x}\right)\right) \]
    7. Simplified99.5%

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

    if 1e11 < x

    1. Initial program 87.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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right), \frac{1}{x}, \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \color{blue}{\left(0 - x\right)} + \frac{91893853320467}{100000000000000}\right)\right) \]
      20. --lowering--.f6487.8

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, \mathsf{fma}\left(x + -0.5, \log x, \color{blue}{\left(0 - x\right)} + 0.91893853320467\right)\right) \]
    4. Applied egg-rr87.8%

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right), \frac{1}{x}, 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)\right) \]
      3. distribute-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right), \frac{1}{x}, x \cdot \left(-1 + \color{blue}{\log x}\right)\right) \]
      17. log-lowering-log.f6487.8

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, x \cdot \left(-1 + \color{blue}{\log x}\right)\right) \]
    7. Simplified87.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-1 + \log x, x, \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, y + \frac{7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right)}, \frac{83333333333333}{1000000000000000}\right)}{x}\right) \]
      11. +-lowering-+.f6487.8

        \[\leadsto \mathsf{fma}\left(-1 + \log x, x, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{y + 0.0007936500793651}, -0.0027777777777778\right), 0.083333333333333\right)}{x}\right) \]
    9. Applied egg-rr87.8%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-1 + \log x, x, \left(\frac{7936500793651}{10000000000000000} + y\right) \cdot \frac{\color{blue}{z \cdot z}}{x}\right) \]
      7. *-lowering-*.f6493.4

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

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

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

Alternative 5: 94.8% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 3 \cdot 10^{-6}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log x + -1, x, \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\right)\\


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

    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. /-lowering-/.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. accelerator-lowering-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. accelerator-lowering-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. +-lowering-+.f6499.7

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

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

    if 3.0000000000000001e-6 < x

    1. Initial program 88.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. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right), \frac{1}{x}, \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \color{blue}{\left(0 - x\right)} + \frac{91893853320467}{100000000000000}\right)\right) \]
      20. --lowering--.f6488.3

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, \mathsf{fma}\left(x + -0.5, \log x, \color{blue}{\left(0 - x\right)} + 0.91893853320467\right)\right) \]
    4. Applied egg-rr88.3%

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right), \frac{1}{x}, 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)\right) \]
      3. distribute-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right), \frac{1}{x}, x \cdot \left(-1 + \color{blue}{\log x}\right)\right) \]
      17. log-lowering-log.f6488.1

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, x \cdot \left(-1 + \color{blue}{\log x}\right)\right) \]
    7. Simplified88.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-1 + \log x, x, \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, y + \frac{7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right)}, \frac{83333333333333}{1000000000000000}\right)}{x}\right) \]
      11. +-lowering-+.f6488.0

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-1 + \log x, x, \left(\frac{7936500793651}{10000000000000000} + y\right) \cdot \frac{\color{blue}{z \cdot z}}{x}\right) \]
      7. *-lowering-*.f6493.5

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

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

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

Alternative 6: 88.9% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 114:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\

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


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

    1. Initial program 99.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 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. /-lowering-/.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. accelerator-lowering-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. accelerator-lowering-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. +-lowering-+.f6499.6

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

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

    if 114 < 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. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right), \frac{1}{x}, \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \color{blue}{\left(0 - x\right)} + \frac{91893853320467}{100000000000000}\right)\right) \]
      20. --lowering--.f6488.1

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right), \frac{1}{x}, 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)\right) \]
      3. distribute-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right), \frac{1}{x}, x \cdot \left(-1 + \color{blue}{\log x}\right)\right) \]
      17. log-lowering-log.f6487.9

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, x \cdot \left(-1 + \color{blue}{\log x}\right)\right) \]
    7. Simplified87.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-1 + \log x, x, \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, y + \frac{7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right)}, \frac{83333333333333}{1000000000000000}\right)}{x}\right) \]
      11. +-lowering-+.f6487.9

        \[\leadsto \mathsf{fma}\left(-1 + \log x, x, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{y + 0.0007936500793651}, -0.0027777777777778\right), 0.083333333333333\right)}{x}\right) \]
    9. Applied egg-rr87.9%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-1 + \log x, x, \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) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-1 + \log x, x, \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) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(-1 + \log x, x, \frac{\mathsf{fma}\left(z, z \cdot \frac{7936500793651}{10000000000000000} + \color{blue}{\frac{-13888888888889}{5000000000000000}}, \frac{83333333333333}{1000000000000000}\right)}{x}\right) \]
      7. accelerator-lowering-fma.f6486.9

        \[\leadsto \mathsf{fma}\left(-1 + \log x, x, \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)}, 0.083333333333333\right)}{x}\right) \]
    12. Simplified86.9%

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

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

Alternative 7: 89.6% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.7 \cdot 10^{+27}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log x + -1, x, \frac{y \cdot \left(z \cdot z\right)}{x}\right)\\


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

    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. /-lowering-/.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. accelerator-lowering-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. accelerator-lowering-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. +-lowering-+.f6498.4

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

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

    if 4.69999999999999976e27 < x

    1. Initial program 87.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. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right), \frac{1}{x}, \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \color{blue}{\left(0 - x\right)} + \frac{91893853320467}{100000000000000}\right)\right) \]
      20. --lowering--.f6487.3

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, \mathsf{fma}\left(x + -0.5, \log x, \color{blue}{\left(0 - x\right)} + 0.91893853320467\right)\right) \]
    4. Applied egg-rr87.3%

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right), \frac{1}{x}, 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)\right) \]
      3. distribute-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right), \frac{1}{x}, x \cdot \left(-1 + \color{blue}{\log x}\right)\right) \]
      17. log-lowering-log.f6487.3

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, x \cdot \left(-1 + \color{blue}{\log x}\right)\right) \]
    7. Simplified87.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-1 + \log x, x, \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, y + \frac{7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right)}, \frac{83333333333333}{1000000000000000}\right)}{x}\right) \]
      11. +-lowering-+.f6487.3

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-1 + \log x, x, \frac{y \cdot \color{blue}{\left(z \cdot z\right)}}{x}\right) \]
      4. *-lowering-*.f6484.7

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

      \[\leadsto \mathsf{fma}\left(-1 + \log x, x, \color{blue}{\frac{y \cdot \left(z \cdot z\right)}{x}}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.3%

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

Alternative 8: 84.8% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.7 \cdot 10^{+35}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\

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


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

    1. Initial program 99.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 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. /-lowering-/.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. accelerator-lowering-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. accelerator-lowering-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. +-lowering-+.f6497.7

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

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

    if 1.7000000000000001e35 < x

    1. Initial program 87.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 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. mul-1-negN/A

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

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

        \[\leadsto x \cdot \left(\color{blue}{\log x} - 1\right) \]
      4. *-lowering-*.f64N/A

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

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

        \[\leadsto x \cdot \left(\log x + \color{blue}{-1}\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\log x + -1\right)} \]
      8. log-lowering-log.f6480.9

        \[\leadsto x \cdot \left(\color{blue}{\log x} + -1\right) \]
    5. Simplified80.9%

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

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

Alternative 9: 62.9% accurate, 2.0× speedup?

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

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

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+82}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 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)) < -4.99999999999999977e36

    1. Initial program 86.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 y around inf

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

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

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

        \[\leadsto \frac{y \cdot \color{blue}{\left(z \cdot z\right)}}{x} \]
      4. *-lowering-*.f6469.0

        \[\leadsto \frac{y \cdot \color{blue}{\left(z \cdot z\right)}}{x} \]
    5. Simplified69.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(z \cdot y\right)} \cdot \frac{z}{x} \]
      6. /-lowering-/.f6473.2

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

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

    if -4.99999999999999977e36 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 1.9999999999999999e82

    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 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) + \frac{z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right)}{x}\right)\right)\right) - x} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\log x, -0.5 + x, \mathsf{fma}\left(z, \frac{\mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)}{x}, \frac{0.083333333333333}{x}\right)\right) + \left(0.91893853320467 - x\right)} \]
    6. 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}} \]
    7. Step-by-step derivation
      1. /-lowering-/.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. accelerator-lowering-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. accelerator-lowering-fma.f6451.2

        \[\leadsto \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)}, 0.083333333333333\right)}{x} \]
    8. Simplified51.2%

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

    if 1.9999999999999999e82 < (+.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 90.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. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right), \frac{1}{x}, \mathsf{fma}\left(x + \frac{-1}{2}, \log x, \color{blue}{\left(0 - x\right)} + \frac{91893853320467}{100000000000000}\right)\right) \]
      20. --lowering--.f6490.3

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, \mathsf{fma}\left(x + -0.5, \log x, \color{blue}{\left(0 - x\right)} + 0.91893853320467\right)\right) \]
    4. Applied egg-rr90.3%

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right), \frac{1}{x}, 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)\right) \]
      3. distribute-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right), \frac{1}{x}, x \cdot \left(-1 + \color{blue}{\log x}\right)\right) \]
      17. log-lowering-log.f6490.3

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, x \cdot \left(-1 + \color{blue}{\log x}\right)\right) \]
    7. Simplified90.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-1 + \log x, x, \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, y + \frac{7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right)}, \frac{83333333333333}{1000000000000000}\right)}{x}\right) \]
      11. +-lowering-+.f6490.3

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{7936500793651}{10000000000000000} \cdot 1}{x}} \cdot {z}^{2} + \frac{y \cdot {z}^{2}}{x} \]
      4. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{\frac{7936500793651}{10000000000000000}}}{x} \cdot {z}^{2} + \frac{y \cdot {z}^{2}}{x} \]
      5. associate-*l/N/A

        \[\leadsto \color{blue}{\frac{\frac{7936500793651}{10000000000000000} \cdot {z}^{2}}{x}} + \frac{y \cdot {z}^{2}}{x} \]
      6. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{7936500793651}{10000000000000000} \cdot \frac{{z}^{2}}{x}} + \frac{y \cdot {z}^{2}}{x} \]
      7. associate-/l*N/A

        \[\leadsto \frac{7936500793651}{10000000000000000} \cdot \frac{{z}^{2}}{x} + \color{blue}{y \cdot \frac{{z}^{2}}{x}} \]
      8. distribute-rgt-outN/A

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

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

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

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

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

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

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

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

Alternative 10: 58.9% accurate, 2.1× speedup?

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

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

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+23}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{x}, 0.083333333333333, 0.91893853320467\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 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)) < -4.99999999999999977e36

    1. Initial program 86.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 y around inf

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

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

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

        \[\leadsto \frac{y \cdot \color{blue}{\left(z \cdot z\right)}}{x} \]
      4. *-lowering-*.f6469.0

        \[\leadsto \frac{y \cdot \color{blue}{\left(z \cdot z\right)}}{x} \]
    5. Simplified69.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(z \cdot y\right)} \cdot \frac{z}{x} \]
      6. /-lowering-/.f6473.2

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

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

    if -4.99999999999999977e36 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 4.9999999999999999e23

    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 \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. associate--l+N/A

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

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

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

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

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

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

        \[\leadsto \frac{91893853320467}{100000000000000} + \left(\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) - x\right) \]
      8. metadata-evalN/A

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

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

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

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

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

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

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

      \[\leadsto \frac{91893853320467}{100000000000000} + \color{blue}{\frac{\frac{83333333333333}{1000000000000000}}{x}} \]
    7. Step-by-step derivation
      1. /-lowering-/.f6450.1

        \[\leadsto 0.91893853320467 + \color{blue}{\frac{0.083333333333333}{x}} \]
    8. Simplified50.1%

      \[\leadsto 0.91893853320467 + \color{blue}{\frac{0.083333333333333}{x}} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000}}{x} + \frac{91893853320467}{100000000000000}} \]
      2. clear-numN/A

        \[\leadsto \color{blue}{\frac{1}{\frac{x}{\frac{83333333333333}{1000000000000000}}}} + \frac{91893853320467}{100000000000000} \]
      3. associate-/r/N/A

        \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{83333333333333}{1000000000000000}} + \frac{91893853320467}{100000000000000} \]
      4. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{x}, \frac{83333333333333}{1000000000000000}, \frac{91893853320467}{100000000000000}\right)} \]
      5. /-lowering-/.f6450.1

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{x}}, 0.083333333333333, 0.91893853320467\right) \]
    10. Applied egg-rr50.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{x}, 0.083333333333333, 0.91893853320467\right)} \]

    if 4.9999999999999999e23 < (+.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 90.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 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) + \frac{z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right)}{x}\right)\right)\right) - x} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

      \[\leadsto \color{blue}{{z}^{2} \cdot \left(-1 \cdot \frac{-1 \cdot \frac{\log x \cdot \left(x - \frac{1}{2}\right) + \frac{83333333333333}{1000000000000000} \cdot \frac{1}{x}}{z} + \frac{13888888888889}{5000000000000000} \cdot \frac{1}{x}}{z} + \frac{7936500793651}{10000000000000000} \cdot \frac{1}{x}\right)} + \left(\frac{91893853320467}{100000000000000} - x\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{z}^{2}}{x} \cdot \frac{7936500793651}{10000000000000000}} \]
      2. associate-*l/N/A

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\frac{z \cdot \frac{7936500793651}{10000000000000000}}{x}} \]
      11. *-commutativeN/A

        \[\leadsto z \cdot \frac{\color{blue}{\frac{7936500793651}{10000000000000000} \cdot z}}{x} \]
      12. associate-*r/N/A

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

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

        \[\leadsto z \cdot \color{blue}{\left(\frac{7936500793651}{10000000000000000} \cdot \frac{z}{x}\right)} \]
      15. /-lowering-/.f6464.8

        \[\leadsto z \cdot \left(0.0007936500793651 \cdot \color{blue}{\frac{z}{x}}\right) \]
    11. Simplified64.8%

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

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

Alternative 11: 47.3% accurate, 3.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) \leq 5 \cdot 10^{+23}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{x}, 0.083333333333333, 0.91893853320467\right)\\

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


\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) < 4.9999999999999999e23

    1. Initial program 96.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 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. associate--l+N/A

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

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

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

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

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

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

        \[\leadsto \frac{91893853320467}{100000000000000} + \left(\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) - x\right) \]
      8. metadata-evalN/A

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

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

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

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

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

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

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

      \[\leadsto \frac{91893853320467}{100000000000000} + \color{blue}{\frac{\frac{83333333333333}{1000000000000000}}{x}} \]
    7. Step-by-step derivation
      1. /-lowering-/.f6437.1

        \[\leadsto 0.91893853320467 + \color{blue}{\frac{0.083333333333333}{x}} \]
    8. Simplified37.1%

      \[\leadsto 0.91893853320467 + \color{blue}{\frac{0.083333333333333}{x}} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000}}{x} + \frac{91893853320467}{100000000000000}} \]
      2. clear-numN/A

        \[\leadsto \color{blue}{\frac{1}{\frac{x}{\frac{83333333333333}{1000000000000000}}}} + \frac{91893853320467}{100000000000000} \]
      3. associate-/r/N/A

        \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{83333333333333}{1000000000000000}} + \frac{91893853320467}{100000000000000} \]
      4. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{x}, \frac{83333333333333}{1000000000000000}, \frac{91893853320467}{100000000000000}\right)} \]
      5. /-lowering-/.f6437.1

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{x}}, 0.083333333333333, 0.91893853320467\right) \]
    10. Applied egg-rr37.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{x}, 0.083333333333333, 0.91893853320467\right)} \]

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

    1. Initial program 90.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 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) + \frac{z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right)}{x}\right)\right)\right) - x} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

      \[\leadsto \color{blue}{{z}^{2} \cdot \left(-1 \cdot \frac{-1 \cdot \frac{\log x \cdot \left(x - \frac{1}{2}\right) + \frac{83333333333333}{1000000000000000} \cdot \frac{1}{x}}{z} + \frac{13888888888889}{5000000000000000} \cdot \frac{1}{x}}{z} + \frac{7936500793651}{10000000000000000} \cdot \frac{1}{x}\right)} + \left(\frac{91893853320467}{100000000000000} - x\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{z}^{2}}{x} \cdot \frac{7936500793651}{10000000000000000}} \]
      2. associate-*l/N/A

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\frac{z \cdot \frac{7936500793651}{10000000000000000}}{x}} \]
      11. *-commutativeN/A

        \[\leadsto z \cdot \frac{\color{blue}{\frac{7936500793651}{10000000000000000} \cdot z}}{x} \]
      12. associate-*r/N/A

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

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

        \[\leadsto z \cdot \color{blue}{\left(\frac{7936500793651}{10000000000000000} \cdot \frac{z}{x}\right)} \]
      15. /-lowering-/.f6464.8

        \[\leadsto z \cdot \left(0.0007936500793651 \cdot \color{blue}{\frac{z}{x}}\right) \]
    11. Simplified64.8%

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

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

Alternative 12: 65.5% accurate, 3.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 7 \cdot 10^{+103}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\

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


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

    1. Initial program 99.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 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. /-lowering-/.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. accelerator-lowering-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. accelerator-lowering-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. +-lowering-+.f6489.9

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

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

    if 7e103 < x

    1. Initial program 84.1%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 63.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 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} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x}} \]
  4. Step-by-step derivation
    1. /-lowering-/.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. accelerator-lowering-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. accelerator-lowering-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. +-lowering-+.f6461.8

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

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

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

Alternative 14: 24.9% accurate, 8.2× speedup?

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

\\
\mathsf{fma}\left(\frac{1}{x}, 0.083333333333333, 0.91893853320467\right)
\end{array}
Derivation
  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 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. associate--l+N/A

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

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

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

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

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

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

      \[\leadsto \frac{91893853320467}{100000000000000} + \left(\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) - x\right) \]
    8. metadata-evalN/A

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

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

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

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

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

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

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

    \[\leadsto \frac{91893853320467}{100000000000000} + \color{blue}{\frac{\frac{83333333333333}{1000000000000000}}{x}} \]
  7. Step-by-step derivation
    1. /-lowering-/.f6425.6

      \[\leadsto 0.91893853320467 + \color{blue}{\frac{0.083333333333333}{x}} \]
  8. Simplified25.6%

    \[\leadsto 0.91893853320467 + \color{blue}{\frac{0.083333333333333}{x}} \]
  9. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000}}{x} + \frac{91893853320467}{100000000000000}} \]
    2. clear-numN/A

      \[\leadsto \color{blue}{\frac{1}{\frac{x}{\frac{83333333333333}{1000000000000000}}}} + \frac{91893853320467}{100000000000000} \]
    3. associate-/r/N/A

      \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{83333333333333}{1000000000000000}} + \frac{91893853320467}{100000000000000} \]
    4. accelerator-lowering-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{x}, \frac{83333333333333}{1000000000000000}, \frac{91893853320467}{100000000000000}\right)} \]
    5. /-lowering-/.f6425.6

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{x}}, 0.083333333333333, 0.91893853320467\right) \]
  10. Applied egg-rr25.6%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{x}, 0.083333333333333, 0.91893853320467\right)} \]
  11. Add Preprocessing

Alternative 15: 24.9% 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 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 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. associate--l+N/A

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

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

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

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

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

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

      \[\leadsto \frac{91893853320467}{100000000000000} + \left(\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) - x\right) \]
    8. metadata-evalN/A

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

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

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

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

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

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

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

    \[\leadsto \frac{91893853320467}{100000000000000} + \color{blue}{\frac{\frac{83333333333333}{1000000000000000}}{x}} \]
  7. Step-by-step derivation
    1. /-lowering-/.f6425.6

      \[\leadsto 0.91893853320467 + \color{blue}{\frac{0.083333333333333}{x}} \]
  8. Simplified25.6%

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

Alternative 16: 24.3% 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 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 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. associate--l+N/A

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

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

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

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

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

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

      \[\leadsto \frac{91893853320467}{100000000000000} + \left(\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) - x\right) \]
    8. metadata-evalN/A

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000}}{x}} \]
  7. Step-by-step derivation
    1. /-lowering-/.f6425.0

      \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
  8. Simplified25.0%

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

Alternative 17: 4.0% accurate, 148.0× speedup?

\[\begin{array}{l} \\ 0.91893853320467 \end{array} \]
(FPCore (x y z) :precision binary64 0.91893853320467)
double code(double x, double y, double z) {
	return 0.91893853320467;
}
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
end function
public static double code(double x, double y, double z) {
	return 0.91893853320467;
}
def code(x, y, z):
	return 0.91893853320467
function code(x, y, z)
	return 0.91893853320467
end
function tmp = code(x, y, z)
	tmp = 0.91893853320467;
end
code[x_, y_, z_] := 0.91893853320467
\begin{array}{l}

\\
0.91893853320467
\end{array}
Derivation
  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 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. associate--l+N/A

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

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

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

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

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

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

      \[\leadsto \frac{91893853320467}{100000000000000} + \left(\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) - x\right) \]
    8. metadata-evalN/A

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

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

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

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

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

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

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

    \[\leadsto \frac{91893853320467}{100000000000000} + \color{blue}{\frac{\frac{83333333333333}{1000000000000000}}{x}} \]
  7. Step-by-step derivation
    1. /-lowering-/.f6425.6

      \[\leadsto 0.91893853320467 + \color{blue}{\frac{0.083333333333333}{x}} \]
  8. Simplified25.6%

    \[\leadsto 0.91893853320467 + \color{blue}{\frac{0.083333333333333}{x}} \]
  9. Taylor expanded in x around inf

    \[\leadsto \color{blue}{\frac{91893853320467}{100000000000000}} \]
  10. Step-by-step derivation
    1. Simplified3.8%

      \[\leadsto \color{blue}{0.91893853320467} \]
    2. 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 2024195 
    (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)))