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

Percentage Accurate: 93.9% → 99.4%
Time: 14.5s
Alternatives: 20
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 20 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 93.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 4 \cdot 10^{-56}:\\
\;\;\;\;\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(-0.5, \log x, 0.91893853320467\right)\right)\\

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


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

    1. Initial program 99.8%

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

      \[\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(-x\right) + 0.91893853320467\right)\right)} \]
    4. Taylor expanded in x around 0

      \[\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}{\frac{91893853320467}{100000000000000} + \frac{-1}{2} \cdot \log x}\right) \]
    5. Step-by-step derivation
      1. +-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}, \color{blue}{\frac{-1}{2} \cdot \log x + \frac{91893853320467}{100000000000000}}\right) \]
      2. 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}, \frac{-1}{2} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log x\right)\right)\right)\right)} + \frac{91893853320467}{100000000000000}\right) \]
      3. 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}, \frac{-1}{2} \cdot \left(\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{x}\right)}\right)\right) + \frac{91893853320467}{100000000000000}\right) \]
      4. 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}, \frac{-1}{2} \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right)\right)} + \frac{91893853320467}{100000000000000}\right) \]
      5. lower-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(\frac{-1}{2}, -1 \cdot \log \left(\frac{1}{x}\right), \frac{91893853320467}{100000000000000}\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}, \mathsf{fma}\left(\frac{-1}{2}, \color{blue}{\mathsf{neg}\left(\log \left(\frac{1}{x}\right)\right)}, \frac{91893853320467}{100000000000000}\right)\right) \]
      7. 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}, \mathsf{fma}\left(\frac{-1}{2}, \mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log x\right)\right)}\right), \frac{91893853320467}{100000000000000}\right)\right) \]
      8. 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}, \mathsf{fma}\left(\frac{-1}{2}, \color{blue}{\log x}, \frac{91893853320467}{100000000000000}\right)\right) \]
      9. lower-log.f6499.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}, \mathsf{fma}\left(-0.5, \color{blue}{\log x}, 0.91893853320467\right)\right) \]
    6. Applied rewrites99.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}{\mathsf{fma}\left(-0.5, \log x, 0.91893853320467\right)}\right) \]

    if 4.0000000000000002e-56 < x

    1. Initial program 88.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 y around 0

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

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

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

Alternative 2: 86.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_0 := z \cdot \left(y + 0.0007936500793651\right)\\
t_1 := z \cdot \left(t\_0 - 0.0027777777777778\right)\\
t_2 := \mathsf{fma}\left(t\_0, z \cdot \frac{1}{x}, \mathsf{fma}\left(-0.5, \log x, 0.91893853320467\right)\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+74}:\\
\;\;\;\;t\_2\\

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

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


\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) < -1.9999999999999999e74 or 9.99999999999999953e67 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z)

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

      \[\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}} \]
    6. Applied rewrites98.5%

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

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

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

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

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

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

    if -1.9999999999999999e74 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 9.99999999999999953e67

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{x}, 0.083333333333333, \mathsf{fma}\left(\log x, x + -0.5, 0.91893853320467 - x\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification91.0%

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

Alternative 3: 86.1% accurate, 0.9× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;z \cdot \frac{t\_0}{x}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -1.9999999999999999e74

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e74 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 9.99999999999999953e67

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 85.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 z around inf

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + z \cdot \frac{\color{blue}{z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)}}{x} \]
      8. lower-+.f6497.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. Applied rewrites97.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}} \]
    6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 86.0% accurate, 0.9× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;z \cdot \frac{t\_0}{x}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -1.9999999999999999e74

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e74 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 9.99999999999999953e67

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.91893853320467 - \color{blue}{\left(x - \mathsf{fma}\left(\log x, -0.5 + x, \frac{0.083333333333333}{x}\right)\right)} \]
      17. lift-+.f64N/A

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

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

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

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

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

    1. Initial program 85.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 z around inf

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + z \cdot \frac{\color{blue}{z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)}}{x} \]
      8. lower-+.f6497.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. Applied rewrites97.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}} \]
    6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 86.0% accurate, 0.9× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;z \cdot \frac{t\_0}{x}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -1.9999999999999999e74

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e74 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 9.99999999999999953e67

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 85.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 z around inf

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + z \cdot \frac{\color{blue}{z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)}}{x} \]
      8. lower-+.f6497.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. Applied rewrites97.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}} \]
    6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 85.0% accurate, 0.9× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;z \cdot \frac{t\_0}{x}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -1.9999999999999999e74

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e74 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 9.99999999999999953e67

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\log x, \frac{-1}{2} + x, \frac{\frac{83333333333333}{1000000000000000}}{x}\right) + \color{blue}{-1 \cdot x} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(\log x, \frac{-1}{2} + x, \frac{\frac{83333333333333}{1000000000000000}}{x}\right) + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
      2. lower-neg.f6492.8

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

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

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

    1. Initial program 85.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 z around inf

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + z \cdot \frac{\color{blue}{z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)}}{x} \]
      8. lower-+.f6497.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. Applied rewrites97.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}} \]
    6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 98.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 68000000000000:\\
\;\;\;\;\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}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot \left(y + 0.0007936500793651\right), z \cdot \frac{1}{x}, \log x \cdot \left(x + -0.5\right) - \left(x + -0.91893853320467\right)\right)\\


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

    1. Initial program 99.7%

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

    if 6.8e13 < x

    1. Initial program 85.2%

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

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

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

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

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

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

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

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

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

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

      \[\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}} \]
    6. Applied rewrites98.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 68000000000000:\\ \;\;\;\;\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}:\\ \;\;\;\;\mathsf{fma}\left(z \cdot \left(y + 0.0007936500793651\right), z \cdot \frac{1}{x}, \log x \cdot \left(x + -0.5\right) - \left(x + -0.91893853320467\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 98.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

    if 7e13 < x

    1. Initial program 85.2%

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

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

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

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

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

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

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

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

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

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

      \[\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}} \]
    6. Applied rewrites98.1%

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

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

Alternative 9: 98.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 40000000000:\\ \;\;\;\;0.91893853320467 + \left(\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} + \mathsf{fma}\left(x + -0.5, \log x, -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 40000000000.0)
   (+
    0.91893853320467
    (+
     (/
      (fma
       z
       (fma (+ y 0.0007936500793651) z -0.0027777777777778)
       0.083333333333333)
      x)
     (fma (+ x -0.5) (log x) (- x))))
   (+
    (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
    (* z (/ (* z (+ y 0.0007936500793651)) x)))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= 40000000000.0) {
		tmp = 0.91893853320467 + ((fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x) + fma((x + -0.5), log(x), -x));
	} else {
		tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * ((z * (y + 0.0007936500793651)) / x));
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (x <= 40000000000.0)
		tmp = Float64(0.91893853320467 + Float64(Float64(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x) + fma(Float64(x + -0.5), log(x), Float64(-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, 40000000000.0], N[(0.91893853320467 + N[(N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + (-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 40000000000:\\
\;\;\;\;0.91893853320467 + \left(\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} + \mathsf{fma}\left(x + -0.5, \log x, -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 < 4e10

    1. Initial program 99.7%

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

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

    if 4e10 < x

    1. Initial program 85.2%

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

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

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

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

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

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

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

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

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

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

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

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

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2.3:\\ \;\;\;\;\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(-0.5, \log x, 0.91893853320467\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + z \cdot \frac{z \cdot \left(y + 0.0007936500793651\right)}{x}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x 2.3)
   (fma
    (fma
     z
     (fma (+ y 0.0007936500793651) z -0.0027777777777778)
     0.083333333333333)
    (/ 1.0 x)
    (fma -0.5 (log x) 0.91893853320467))
   (+
    (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
    (* z (/ (* z (+ y 0.0007936500793651)) x)))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= 2.3) {
		tmp = fma(fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333), (1.0 / x), fma(-0.5, log(x), 0.91893853320467));
	} else {
		tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * ((z * (y + 0.0007936500793651)) / x));
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (x <= 2.3)
		tmp = fma(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333), Float64(1.0 / x), fma(-0.5, log(x), 0.91893853320467));
	else
		tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) / x)));
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[x, 2.3], N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] * N[(1.0 / x), $MachinePrecision] + N[(-0.5 * N[Log[x], $MachinePrecision] + 0.91893853320467), $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 2.3:\\
\;\;\;\;\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(-0.5, \log x, 0.91893853320467\right)\right)\\

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


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

    1. Initial program 99.7%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. Applied rewrites99.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(-x\right) + 0.91893853320467\right)\right)} \]
    4. Taylor expanded in x around 0

      \[\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}{\frac{91893853320467}{100000000000000} + \frac{-1}{2} \cdot \log x}\right) \]
    5. Step-by-step derivation
      1. +-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}, \color{blue}{\frac{-1}{2} \cdot \log x + \frac{91893853320467}{100000000000000}}\right) \]
      2. 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}, \frac{-1}{2} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log x\right)\right)\right)\right)} + \frac{91893853320467}{100000000000000}\right) \]
      3. 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}, \frac{-1}{2} \cdot \left(\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{x}\right)}\right)\right) + \frac{91893853320467}{100000000000000}\right) \]
      4. 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}, \frac{-1}{2} \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right)\right)} + \frac{91893853320467}{100000000000000}\right) \]
      5. lower-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(\frac{-1}{2}, -1 \cdot \log \left(\frac{1}{x}\right), \frac{91893853320467}{100000000000000}\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}, \mathsf{fma}\left(\frac{-1}{2}, \color{blue}{\mathsf{neg}\left(\log \left(\frac{1}{x}\right)\right)}, \frac{91893853320467}{100000000000000}\right)\right) \]
      7. 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}, \mathsf{fma}\left(\frac{-1}{2}, \mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log x\right)\right)}\right), \frac{91893853320467}{100000000000000}\right)\right) \]
      8. 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}, \mathsf{fma}\left(\frac{-1}{2}, \color{blue}{\log x}, \frac{91893853320467}{100000000000000}\right)\right) \]
      9. lower-log.f6498.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(-0.5, \color{blue}{\log x}, 0.91893853320467\right)\right) \]
    6. Applied rewrites98.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}{\mathsf{fma}\left(-0.5, \log x, 0.91893853320467\right)}\right) \]

    if 2.2999999999999998 < x

    1. Initial program 85.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. lower-*.f64N/A

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.3:\\ \;\;\;\;\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(-0.5, \log x, 0.91893853320467\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + z \cdot \frac{z \cdot \left(y + 0.0007936500793651\right)}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 84.6% accurate, 1.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \log x, -x\right)\\


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

    1. Initial program 99.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 y around 0

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

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

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

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

        \[\leadsto \frac{91893853320467}{100000000000000} + \frac{\color{blue}{z \cdot \left(\left(\frac{7936500793651}{10000000000000000} \cdot z + y \cdot z\right) - \frac{13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}}{x} \]
      3. distribute-rgt-inN/A

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

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

        \[\leadsto \frac{91893853320467}{100000000000000} + \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} \]
      6. metadata-evalN/A

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

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

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

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

    if 2.8000000000000001e40 < x

    1. Initial program 84.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 84.6% accurate, 1.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x \cdot \log x - x\\


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

    1. Initial program 99.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 y around 0

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

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

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

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

        \[\leadsto \frac{91893853320467}{100000000000000} + \frac{\color{blue}{z \cdot \left(\left(\frac{7936500793651}{10000000000000000} \cdot z + y \cdot z\right) - \frac{13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}}{x} \]
      3. distribute-rgt-inN/A

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

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

        \[\leadsto \frac{91893853320467}{100000000000000} + \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} \]
      6. metadata-evalN/A

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

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

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

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

    if 2.8000000000000001e40 < x

    1. Initial program 84.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log x \cdot x + -1 \cdot x} \]
      7. *-commutativeN/A

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \log x} - x \]
      12. lower-log.f6472.4

        \[\leadsto x \cdot \color{blue}{\log x} - x \]
    9. Applied rewrites72.4%

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

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

Alternative 13: 64.3% accurate, 2.1× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\frac{-0.0069444444444443885}{x \cdot \mathsf{fma}\left(z, -0.0027777777777778, -0.083333333333333\right)}\\

\mathbf{else}:\\
\;\;\;\;z \cdot \frac{t\_0}{x}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -1.9999999999999999e74

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 99.5%

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \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}} \]
      7. lift-+.f64N/A

        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \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} \]
      8. flip-+N/A

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

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

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

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

      \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\color{blue}{\frac{\frac{-6944444444444388888888888889}{1000000000000000000000000000000}}{x}}}{\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{-83333333333333}{1000000000000000}\right)} \]
    6. Step-by-step derivation
      1. lower-/.f6498.9

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{-6944444444444388888888888889}{1000000000000000000000000000000}}{x \cdot \color{blue}{\left(\frac{-13888888888889}{5000000000000000} \cdot z - \frac{83333333333333}{1000000000000000}\right)}} \]
    12. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \frac{\frac{-6944444444444388888888888889}{1000000000000000000000000000000}}{x \cdot \color{blue}{\left(\frac{-13888888888889}{5000000000000000} \cdot z + \left(\mathsf{neg}\left(\frac{83333333333333}{1000000000000000}\right)\right)\right)}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\frac{-6944444444444388888888888889}{1000000000000000000000000000000}}{x \cdot \left(\color{blue}{z \cdot \frac{-13888888888889}{5000000000000000}} + \left(\mathsf{neg}\left(\frac{83333333333333}{1000000000000000}\right)\right)\right)} \]
      3. metadata-evalN/A

        \[\leadsto \frac{\frac{-6944444444444388888888888889}{1000000000000000000000000000000}}{x \cdot \left(z \cdot \frac{-13888888888889}{5000000000000000} + \color{blue}{\frac{-83333333333333}{1000000000000000}}\right)} \]
      4. lower-fma.f6444.1

        \[\leadsto \frac{-0.0069444444444443885}{x \cdot \color{blue}{\mathsf{fma}\left(z, -0.0027777777777778, -0.083333333333333\right)}} \]
    13. Applied rewrites44.1%

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

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

    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. lower-*.f64N/A

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

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

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

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

      \[\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}} \]
    6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 52.4% accurate, 2.2× speedup?

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

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

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\frac{-0.0069444444444443885}{x \cdot \mathsf{fma}\left(z, -0.0027777777777778, -0.083333333333333\right)}\\

\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z \cdot z}{x}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -1.9999999999999999e74

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 99.5%

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \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}} \]
      7. lift-+.f64N/A

        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \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} \]
      8. flip-+N/A

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

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

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

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

      \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\color{blue}{\frac{\frac{-6944444444444388888888888889}{1000000000000000000000000000000}}{x}}}{\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{-83333333333333}{1000000000000000}\right)} \]
    6. Step-by-step derivation
      1. lower-/.f6498.9

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{-6944444444444388888888888889}{1000000000000000000000000000000}}{x \cdot \color{blue}{\left(\frac{-13888888888889}{5000000000000000} \cdot z - \frac{83333333333333}{1000000000000000}\right)}} \]
    12. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \frac{\frac{-6944444444444388888888888889}{1000000000000000000000000000000}}{x \cdot \color{blue}{\left(\frac{-13888888888889}{5000000000000000} \cdot z + \left(\mathsf{neg}\left(\frac{83333333333333}{1000000000000000}\right)\right)\right)}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\frac{-6944444444444388888888888889}{1000000000000000000000000000000}}{x \cdot \left(\color{blue}{z \cdot \frac{-13888888888889}{5000000000000000}} + \left(\mathsf{neg}\left(\frac{83333333333333}{1000000000000000}\right)\right)\right)} \]
      3. metadata-evalN/A

        \[\leadsto \frac{\frac{-6944444444444388888888888889}{1000000000000000000000000000000}}{x \cdot \left(z \cdot \frac{-13888888888889}{5000000000000000} + \color{blue}{\frac{-83333333333333}{1000000000000000}}\right)} \]
      4. lower-fma.f6444.1

        \[\leadsto \frac{-0.0069444444444443885}{x \cdot \color{blue}{\mathsf{fma}\left(z, -0.0027777777777778, -0.083333333333333\right)}} \]
    13. Applied rewrites44.1%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \frac{z \cdot z}{x}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification53.2%

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

Alternative 15: 52.3% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+74}:\\ \;\;\;\;\left(z \cdot y\right) \cdot \frac{z}{x}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-6}:\\ \;\;\;\;0.083333333333333 \cdot \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z \cdot z}{x}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
   (if (<= t_0 -2e+74)
     (* (* z y) (/ z x))
     (if (<= t_0 5e-6) (* 0.083333333333333 (/ 1.0 x)) (* y (/ (* z z) x))))))
double code(double x, double y, double z) {
	double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
	double tmp;
	if (t_0 <= -2e+74) {
		tmp = (z * y) * (z / x);
	} else if (t_0 <= 5e-6) {
		tmp = 0.083333333333333 * (1.0 / x);
	} else {
		tmp = y * ((z * z) / x);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)
    if (t_0 <= (-2d+74)) then
        tmp = (z * y) * (z / x)
    else if (t_0 <= 5d-6) then
        tmp = 0.083333333333333d0 * (1.0d0 / x)
    else
        tmp = y * ((z * z) / x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
	double tmp;
	if (t_0 <= -2e+74) {
		tmp = (z * y) * (z / x);
	} else if (t_0 <= 5e-6) {
		tmp = 0.083333333333333 * (1.0 / x);
	} else {
		tmp = y * ((z * z) / x);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)
	tmp = 0
	if t_0 <= -2e+74:
		tmp = (z * y) * (z / x)
	elif t_0 <= 5e-6:
		tmp = 0.083333333333333 * (1.0 / x)
	else:
		tmp = y * ((z * z) / x)
	return tmp
function code(x, y, z)
	t_0 = Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))
	tmp = 0.0
	if (t_0 <= -2e+74)
		tmp = Float64(Float64(z * y) * Float64(z / x));
	elseif (t_0 <= 5e-6)
		tmp = Float64(0.083333333333333 * Float64(1.0 / x));
	else
		tmp = Float64(y * Float64(Float64(z * z) / x));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
	tmp = 0.0;
	if (t_0 <= -2e+74)
		tmp = (z * y) * (z / x);
	elseif (t_0 <= 5e-6)
		tmp = 0.083333333333333 * (1.0 / x);
	else
		tmp = y * ((z * z) / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+74], N[(N[(z * y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-6], N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-6}:\\
\;\;\;\;0.083333333333333 \cdot \frac{1}{x}\\

\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z \cdot z}{x}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -1.9999999999999999e74

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000}}{x}} \]
    7. Step-by-step derivation
      1. lower-/.f6443.9

        \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
    8. Applied rewrites43.9%

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

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

        \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{83333333333333}{1000000000000000}} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{83333333333333}{1000000000000000}} \]
      4. lower-/.f6444.0

        \[\leadsto \color{blue}{\frac{1}{x}} \cdot 0.083333333333333 \]
    10. Applied rewrites44.0%

      \[\leadsto \color{blue}{\frac{1}{x} \cdot 0.083333333333333} \]

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \frac{z \cdot z}{x}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification53.1%

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

Alternative 16: 52.3% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\ t_1 := y \cdot \frac{z \cdot z}{x}\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+74}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-6}:\\ \;\;\;\;0.083333333333333 \cdot \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
        (t_1 (* y (/ (* z z) x))))
   (if (<= t_0 -2e+74)
     t_1
     (if (<= t_0 5e-6) (* 0.083333333333333 (/ 1.0 x)) t_1))))
double code(double x, double y, double z) {
	double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
	double t_1 = y * ((z * z) / x);
	double tmp;
	if (t_0 <= -2e+74) {
		tmp = t_1;
	} else if (t_0 <= 5e-6) {
		tmp = 0.083333333333333 * (1.0 / x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)
    t_1 = y * ((z * z) / x)
    if (t_0 <= (-2d+74)) then
        tmp = t_1
    else if (t_0 <= 5d-6) then
        tmp = 0.083333333333333d0 * (1.0d0 / x)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
	double t_1 = y * ((z * z) / x);
	double tmp;
	if (t_0 <= -2e+74) {
		tmp = t_1;
	} else if (t_0 <= 5e-6) {
		tmp = 0.083333333333333 * (1.0 / x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)
	t_1 = y * ((z * z) / x)
	tmp = 0
	if t_0 <= -2e+74:
		tmp = t_1
	elif t_0 <= 5e-6:
		tmp = 0.083333333333333 * (1.0 / x)
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))
	t_1 = Float64(y * Float64(Float64(z * z) / x))
	tmp = 0.0
	if (t_0 <= -2e+74)
		tmp = t_1;
	elseif (t_0 <= 5e-6)
		tmp = Float64(0.083333333333333 * Float64(1.0 / x));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
	t_1 = y * ((z * z) / x);
	tmp = 0.0;
	if (t_0 <= -2e+74)
		tmp = t_1;
	elseif (t_0 <= 5e-6)
		tmp = 0.083333333333333 * (1.0 / x);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+74], t$95$1, If[LessEqual[t$95$0, 5e-6], N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-6}:\\
\;\;\;\;0.083333333333333 \cdot \frac{1}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -1.9999999999999999e74 or 5.00000000000000041e-6 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z)

    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. Taylor expanded in y around inf

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

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

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

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

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

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

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

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

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000}}{x}} \]
    7. Step-by-step derivation
      1. lower-/.f6443.9

        \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
    8. Applied rewrites43.9%

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

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

        \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{83333333333333}{1000000000000000}} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{83333333333333}{1000000000000000}} \]
      4. lower-/.f6444.0

        \[\leadsto \color{blue}{\frac{1}{x}} \cdot 0.083333333333333 \]
    10. Applied rewrites44.0%

      \[\leadsto \color{blue}{\frac{1}{x} \cdot 0.083333333333333} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification53.1%

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

Alternative 17: 65.8% accurate, 4.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;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 < 7.5e31

    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 y around 0

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

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

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

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

        \[\leadsto \frac{91893853320467}{100000000000000} + \frac{\color{blue}{z \cdot \left(\left(\frac{7936500793651}{10000000000000000} \cdot z + y \cdot z\right) - \frac{13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}}{x} \]
      3. distribute-rgt-inN/A

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

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

        \[\leadsto \frac{91893853320467}{100000000000000} + \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} \]
      6. metadata-evalN/A

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

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

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

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

    if 7.5e31 < 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 \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \color{blue}{\frac{{z}^{2} \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)}{x}} \]
    4. Step-by-step derivation
      1. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 65.8% accurate, 4.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;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 < 7.5e31

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

    if 7.5e31 < 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 \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \color{blue}{\frac{{z}^{2} \cdot \left(\frac{7936500793651}{10000000000000000} + y\right)}{x}} \]
    4. Step-by-step derivation
      1. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 19: 24.0% accurate, 8.7× speedup?

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

\\
0.083333333333333 \cdot \frac{1}{x}
\end{array}
Derivation
  1. Initial program 92.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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{83333333333333}{1000000000000000}} \]
    3. lower-*.f64N/A

      \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{83333333333333}{1000000000000000}} \]
    4. lower-/.f6421.0

      \[\leadsto \color{blue}{\frac{1}{x}} \cdot 0.083333333333333 \]
  10. Applied rewrites21.0%

    \[\leadsto \color{blue}{\frac{1}{x} \cdot 0.083333333333333} \]
  11. Final simplification21.0%

    \[\leadsto 0.083333333333333 \cdot \frac{1}{x} \]
  12. Add Preprocessing

Alternative 20: 24.0% 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 92.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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer Target 1: 98.8% 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 2024219 
(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)))