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

Percentage Accurate: 93.9% → 98.7%
Time: 6.2s
Alternatives: 17
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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z)
use fmin_fmax_functions
    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}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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

Alternative 1: 98.7% accurate, 0.9× speedup?

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

\\
\mathsf{fma}\left(z, \mathsf{fma}\left(\frac{z}{x}, y - -0.0007936500793651, \frac{-0.0027777777777778}{x}\right), \mathsf{fma}\left(\log x, x - 0.5, 0.91893853320467 - x\right) - \frac{-0.083333333333333}{x}\right)
\end{array}
Derivation
  1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.6% accurate, 1.0× speedup?

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

\\
\mathsf{fma}\left(\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right), \frac{z}{x}, \left(\left(x - 0.5\right) \cdot \log x - x\right) - \left(-0.91893853320467 - \frac{0.083333333333333}{x}\right)\right)
\end{array}
Derivation
  1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 95.5% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.19999999999999993e196 < x

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(z, \frac{1}{x} \cdot \mathsf{fma}\left(\color{blue}{\frac{7936500793651}{10000000000000000}}, z, \frac{-13888888888889}{5000000000000000}\right), \mathsf{fma}\left(\log x, x - \frac{1}{2}, \frac{91893853320467}{100000000000000} - x\right) - \frac{\frac{-83333333333333}{1000000000000000}}{x}\right) \]
    8. Step-by-step derivation
      1. Applied rewrites80.4%

        \[\leadsto \mathsf{fma}\left(z, \frac{1}{x} \cdot \mathsf{fma}\left(\color{blue}{0.0007936500793651}, z, -0.0027777777777778\right), \mathsf{fma}\left(\log x, x - 0.5, 0.91893853320467 - x\right) - \frac{-0.083333333333333}{x}\right) \]
    9. Recombined 2 regimes into one program.
    10. Add Preprocessing

    Alternative 4: 95.5% accurate, 0.9× speedup?

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

      1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

      if 3.19999999999999993e196 < x

      1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(z, \frac{\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}}{x}, \mathsf{fma}\left(\log x, x - \frac{1}{2}, \frac{91893853320467}{100000000000000} - x\right) - \frac{\frac{-83333333333333}{1000000000000000}}{x}\right) \]
        3. lower-*.f6480.4

          \[\leadsto \mathsf{fma}\left(z, \frac{0.0007936500793651 \cdot z - 0.0027777777777778}{x}, \mathsf{fma}\left(\log x, x - 0.5, 0.91893853320467 - x\right) - \frac{-0.083333333333333}{x}\right) \]
      9. Applied rewrites80.4%

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

    Alternative 5: 95.4% accurate, 0.9× speedup?

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

      1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 3.19999999999999993e196 < x

      1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(z, \frac{\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}}{x}, \mathsf{fma}\left(\log x, x - \frac{1}{2}, \frac{91893853320467}{100000000000000} - x\right) - \frac{\frac{-83333333333333}{1000000000000000}}{x}\right) \]
        3. lower-*.f6480.4

          \[\leadsto \mathsf{fma}\left(z, \frac{0.0007936500793651 \cdot z - 0.0027777777777778}{x}, \mathsf{fma}\left(\log x, x - 0.5, 0.91893853320467 - x\right) - \frac{-0.083333333333333}{x}\right) \]
      9. Applied rewrites80.4%

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

    Alternative 6: 94.5% accurate, 0.9× speedup?

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

      1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 4.30000000000000012e196 < x

      1. Initial program 93.9%

        \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      2. 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{-13888888888889}{5000000000000000}} \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
      3. Step-by-step derivation
        1. Applied rewrites62.5%

          \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\color{blue}{-0.0027777777777778} \cdot z + 0.083333333333333}{x} \]
        2. Step-by-step derivation
          1. Applied rewrites62.6%

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

        Alternative 7: 94.5% accurate, 0.9× speedup?

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

          1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

          if 4.30000000000000012e196 < x

          1. Initial program 93.9%

            \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
          2. 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{-13888888888889}{5000000000000000}} \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
          3. Step-by-step derivation
            1. Applied rewrites62.5%

              \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\color{blue}{-0.0027777777777778} \cdot z + 0.083333333333333}{x} \]
            2. Step-by-step derivation
              1. Applied rewrites62.6%

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

            Alternative 8: 89.9% accurate, 0.5× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\\ \mathbf{if}\;t\_0 + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \leq -4 \cdot 10^{+30}:\\ \;\;\;\;\left(\frac{y - -0.0007936500793651}{x} \cdot z\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\_0 + \frac{\left(0.0007936500793651 \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (let* ((t_0 (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)))
               (if (<=
                    (+
                     t_0
                     (/
                      (+
                       (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
                       0.083333333333333)
                      x))
                    -4e+30)
                 (* (* (/ (- y -0.0007936500793651) x) z) z)
                 (+
                  t_0
                  (/
                   (+
                    (* (- (* 0.0007936500793651 z) 0.0027777777777778) z)
                    0.083333333333333)
                   x)))))
            double code(double x, double y, double z) {
            	double t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467;
            	double tmp;
            	if ((t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= -4e+30) {
            		tmp = (((y - -0.0007936500793651) / x) * z) * z;
            	} else {
            		tmp = t_0 + (((((0.0007936500793651 * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
            	}
            	return tmp;
            }
            
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(x, y, z)
            use fmin_fmax_functions
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8) :: t_0
                real(8) :: tmp
                t_0 = (((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0
                if ((t_0 + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)) <= (-4d+30)) then
                    tmp = (((y - (-0.0007936500793651d0)) / x) * z) * z
                else
                    tmp = t_0 + (((((0.0007936500793651d0 * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z) {
            	double t_0 = (((x - 0.5) * Math.log(x)) - x) + 0.91893853320467;
            	double tmp;
            	if ((t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= -4e+30) {
            		tmp = (((y - -0.0007936500793651) / x) * z) * z;
            	} else {
            		tmp = t_0 + (((((0.0007936500793651 * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	t_0 = (((x - 0.5) * math.log(x)) - x) + 0.91893853320467
            	tmp = 0
            	if (t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= -4e+30:
            		tmp = (((y - -0.0007936500793651) / x) * z) * z
            	else:
            		tmp = t_0 + (((((0.0007936500793651 * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
            	return tmp
            
            function code(x, y, z)
            	t_0 = Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467)
            	tmp = 0.0
            	if (Float64(t_0 + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= -4e+30)
            		tmp = Float64(Float64(Float64(Float64(y - -0.0007936500793651) / x) * z) * z);
            	else
            		tmp = Float64(t_0 + Float64(Float64(Float64(Float64(Float64(0.0007936500793651 * z) - 0.0027777777777778) * z) + 0.083333333333333) / x));
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z)
            	t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467;
            	tmp = 0.0;
            	if ((t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) <= -4e+30)
            		tmp = (((y - -0.0007936500793651) / x) * z) * z;
            	else
            		tmp = t_0 + (((((0.0007936500793651 * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, If[LessEqual[N[(t$95$0 + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], -4e+30], N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision], N[(t$95$0 + N[(N[(N[(N[(N[(0.0007936500793651 * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
            \mathbf{if}\;t\_0 + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \leq -4 \cdot 10^{+30}:\\
            \;\;\;\;\left(\frac{y - -0.0007936500793651}{x} \cdot z\right) \cdot z\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0 + \frac{\left(0.0007936500793651 \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -4.0000000000000001e30

              1. Initial program 93.9%

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

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

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

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

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

                  \[\leadsto {z}^{2} \cdot \mathsf{fma}\left(\frac{7936500793651}{10000000000000000}, \frac{1}{\color{blue}{x}}, \frac{y}{x}\right) \]
                5. lower-/.f6442.3

                  \[\leadsto {z}^{2} \cdot \mathsf{fma}\left(0.0007936500793651, \frac{1}{x}, \frac{y}{x}\right) \]
              4. Applied rewrites42.3%

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

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

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

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

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

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

                  \[\leadsto \left(\mathsf{fma}\left(\frac{7936500793651}{10000000000000000}, \frac{1}{x}, \frac{y}{x}\right) \cdot z\right) \cdot \color{blue}{z} \]
                7. lower-*.f6444.1

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

                  \[\leadsto \left(\left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right) \cdot z\right) \cdot z \]
                9. +-commutativeN/A

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

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

                  \[\leadsto \left(\left(\frac{y}{x} + \frac{7936500793651}{10000000000000000} \cdot \frac{1}{x}\right) \cdot z\right) \cdot z \]
                12. mult-flip-revN/A

                  \[\leadsto \left(\left(\frac{y}{x} + \frac{\frac{7936500793651}{10000000000000000}}{x}\right) \cdot z\right) \cdot z \]
                13. div-add-revN/A

                  \[\leadsto \left(\frac{y + \frac{7936500793651}{10000000000000000}}{x} \cdot z\right) \cdot z \]
                14. add-flipN/A

                  \[\leadsto \left(\frac{y - \left(\mathsf{neg}\left(\frac{7936500793651}{10000000000000000}\right)\right)}{x} \cdot z\right) \cdot z \]
                15. metadata-evalN/A

                  \[\leadsto \left(\frac{y - \frac{-7936500793651}{10000000000000000}}{x} \cdot z\right) \cdot z \]
                16. lift--.f64N/A

                  \[\leadsto \left(\frac{y - \frac{-7936500793651}{10000000000000000}}{x} \cdot z\right) \cdot z \]
                17. lower-/.f6444.1

                  \[\leadsto \left(\frac{y - -0.0007936500793651}{x} \cdot z\right) \cdot z \]
              6. Applied rewrites44.1%

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

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

              1. Initial program 93.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. Taylor expanded in y around 0

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

                  \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\color{blue}{0.0007936500793651} \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
              4. Recombined 2 regimes into one program.
              5. Add Preprocessing

              Alternative 9: 86.1% accurate, 0.6× speedup?

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

                1. Initial program 93.9%

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

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

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

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

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

                    \[\leadsto {z}^{2} \cdot \mathsf{fma}\left(\frac{7936500793651}{10000000000000000}, \frac{1}{\color{blue}{x}}, \frac{y}{x}\right) \]
                  5. lower-/.f6442.3

                    \[\leadsto {z}^{2} \cdot \mathsf{fma}\left(0.0007936500793651, \frac{1}{x}, \frac{y}{x}\right) \]
                4. Applied rewrites42.3%

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

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

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

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

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

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

                    \[\leadsto \left(\mathsf{fma}\left(\frac{7936500793651}{10000000000000000}, \frac{1}{x}, \frac{y}{x}\right) \cdot z\right) \cdot \color{blue}{z} \]
                  7. lower-*.f6444.1

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

                    \[\leadsto \left(\left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right) \cdot z\right) \cdot z \]
                  9. +-commutativeN/A

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

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

                    \[\leadsto \left(\left(\frac{y}{x} + \frac{7936500793651}{10000000000000000} \cdot \frac{1}{x}\right) \cdot z\right) \cdot z \]
                  12. mult-flip-revN/A

                    \[\leadsto \left(\left(\frac{y}{x} + \frac{\frac{7936500793651}{10000000000000000}}{x}\right) \cdot z\right) \cdot z \]
                  13. div-add-revN/A

                    \[\leadsto \left(\frac{y + \frac{7936500793651}{10000000000000000}}{x} \cdot z\right) \cdot z \]
                  14. add-flipN/A

                    \[\leadsto \left(\frac{y - \left(\mathsf{neg}\left(\frac{7936500793651}{10000000000000000}\right)\right)}{x} \cdot z\right) \cdot z \]
                  15. metadata-evalN/A

                    \[\leadsto \left(\frac{y - \frac{-7936500793651}{10000000000000000}}{x} \cdot z\right) \cdot z \]
                  16. lift--.f64N/A

                    \[\leadsto \left(\frac{y - \frac{-7936500793651}{10000000000000000}}{x} \cdot z\right) \cdot z \]
                  17. lower-/.f6444.1

                    \[\leadsto \left(\frac{y - -0.0007936500793651}{x} \cdot z\right) \cdot z \]
                6. Applied rewrites44.1%

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

                if -3.9999999999999998e33 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 1e51

                1. Initial program 93.9%

                  \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
                2. 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{-13888888888889}{5000000000000000}} \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                3. Step-by-step derivation
                  1. Applied rewrites62.5%

                    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\color{blue}{-0.0027777777777778} \cdot z + 0.083333333333333}{x} \]
                  2. Step-by-step derivation
                    1. Applied rewrites62.6%

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

                  Alternative 10: 86.0% accurate, 0.6× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\frac{y - -0.0007936500793651}{x} \cdot z\right) \cdot z\\ t_1 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+33}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 10^{+51}:\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                  (FPCore (x y z)
                   :precision binary64
                   (let* ((t_0 (* (* (/ (- y -0.0007936500793651) x) z) z))
                          (t_1
                           (+
                            (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
                            0.083333333333333)))
                     (if (<= t_1 -4e+33)
                       t_0
                       (if (<= t_1 1e+51)
                         (+
                          (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
                          (/ 0.083333333333333 x))
                         t_0))))
                  double code(double x, double y, double z) {
                  	double t_0 = (((y - -0.0007936500793651) / x) * z) * z;
                  	double t_1 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
                  	double tmp;
                  	if (t_1 <= -4e+33) {
                  		tmp = t_0;
                  	} else if (t_1 <= 1e+51) {
                  		tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
                  	} else {
                  		tmp = t_0;
                  	}
                  	return tmp;
                  }
                  
                  module fmin_fmax_functions
                      implicit none
                      private
                      public fmax
                      public fmin
                  
                      interface fmax
                          module procedure fmax88
                          module procedure fmax44
                          module procedure fmax84
                          module procedure fmax48
                      end interface
                      interface fmin
                          module procedure fmin88
                          module procedure fmin44
                          module procedure fmin84
                          module procedure fmin48
                      end interface
                  contains
                      real(8) function fmax88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmax44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmax84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmax48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                      end function
                      real(8) function fmin88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmin44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmin84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmin48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                      end function
                  end module
                  
                  real(8) function code(x, y, z)
                  use fmin_fmax_functions
                      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 = (((y - (-0.0007936500793651d0)) / x) * z) * z
                      t_1 = ((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0
                      if (t_1 <= (-4d+33)) then
                          tmp = t_0
                      else if (t_1 <= 1d+51) then
                          tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 / x)
                      else
                          tmp = t_0
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z) {
                  	double t_0 = (((y - -0.0007936500793651) / x) * z) * z;
                  	double t_1 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
                  	double tmp;
                  	if (t_1 <= -4e+33) {
                  		tmp = t_0;
                  	} else if (t_1 <= 1e+51) {
                  		tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
                  	} else {
                  		tmp = t_0;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z):
                  	t_0 = (((y - -0.0007936500793651) / x) * z) * z
                  	t_1 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333
                  	tmp = 0
                  	if t_1 <= -4e+33:
                  		tmp = t_0
                  	elif t_1 <= 1e+51:
                  		tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x)
                  	else:
                  		tmp = t_0
                  	return tmp
                  
                  function code(x, y, z)
                  	t_0 = Float64(Float64(Float64(Float64(y - -0.0007936500793651) / x) * z) * z)
                  	t_1 = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333)
                  	tmp = 0.0
                  	if (t_1 <= -4e+33)
                  		tmp = t_0;
                  	elseif (t_1 <= 1e+51)
                  		tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x));
                  	else
                  		tmp = t_0;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z)
                  	t_0 = (((y - -0.0007936500793651) / x) * z) * z;
                  	t_1 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
                  	tmp = 0.0;
                  	if (t_1 <= -4e+33)
                  		tmp = t_0;
                  	elseif (t_1 <= 1e+51)
                  		tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
                  	else
                  		tmp = t_0;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+33], t$95$0, If[LessEqual[t$95$1, 1e+51], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \left(\frac{y - -0.0007936500793651}{x} \cdot z\right) \cdot z\\
                  t_1 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333\\
                  \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+33}:\\
                  \;\;\;\;t\_0\\
                  
                  \mathbf{elif}\;t\_1 \leq 10^{+51}:\\
                  \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_0\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < -3.9999999999999998e33 or 1e51 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64))

                    1. Initial program 93.9%

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

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

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

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

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

                        \[\leadsto {z}^{2} \cdot \mathsf{fma}\left(\frac{7936500793651}{10000000000000000}, \frac{1}{\color{blue}{x}}, \frac{y}{x}\right) \]
                      5. lower-/.f6442.3

                        \[\leadsto {z}^{2} \cdot \mathsf{fma}\left(0.0007936500793651, \frac{1}{x}, \frac{y}{x}\right) \]
                    4. Applied rewrites42.3%

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

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

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

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

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

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

                        \[\leadsto \left(\mathsf{fma}\left(\frac{7936500793651}{10000000000000000}, \frac{1}{x}, \frac{y}{x}\right) \cdot z\right) \cdot \color{blue}{z} \]
                      7. lower-*.f6444.1

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

                        \[\leadsto \left(\left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right) \cdot z\right) \cdot z \]
                      9. +-commutativeN/A

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

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

                        \[\leadsto \left(\left(\frac{y}{x} + \frac{7936500793651}{10000000000000000} \cdot \frac{1}{x}\right) \cdot z\right) \cdot z \]
                      12. mult-flip-revN/A

                        \[\leadsto \left(\left(\frac{y}{x} + \frac{\frac{7936500793651}{10000000000000000}}{x}\right) \cdot z\right) \cdot z \]
                      13. div-add-revN/A

                        \[\leadsto \left(\frac{y + \frac{7936500793651}{10000000000000000}}{x} \cdot z\right) \cdot z \]
                      14. add-flipN/A

                        \[\leadsto \left(\frac{y - \left(\mathsf{neg}\left(\frac{7936500793651}{10000000000000000}\right)\right)}{x} \cdot z\right) \cdot z \]
                      15. metadata-evalN/A

                        \[\leadsto \left(\frac{y - \frac{-7936500793651}{10000000000000000}}{x} \cdot z\right) \cdot z \]
                      16. lift--.f64N/A

                        \[\leadsto \left(\frac{y - \frac{-7936500793651}{10000000000000000}}{x} \cdot z\right) \cdot z \]
                      17. lower-/.f6444.1

                        \[\leadsto \left(\frac{y - -0.0007936500793651}{x} \cdot z\right) \cdot z \]
                    6. Applied rewrites44.1%

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

                    if -3.9999999999999998e33 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 1e51

                    1. Initial program 93.9%

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

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

                        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\color{blue}{0.083333333333333}}{x} \]
                    4. Recombined 2 regimes into one program.
                    5. Add Preprocessing

                    Alternative 11: 83.6% accurate, 1.8× speedup?

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

                      1. Initial program 93.9%

                        \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
                      2. 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}} \]
                      3. Step-by-step derivation
                        1. lower-/.f64N/A

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

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

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

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

                          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
                        6. lower-+.f6463.2

                          \[\leadsto \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} \]
                      4. Applied rewrites63.2%

                        \[\leadsto \color{blue}{\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}} \]
                      5. Step-by-step derivation
                        1. lift-+.f64N/A

                          \[\leadsto \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{z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}{x} \]
                        3. lift-*.f64N/A

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

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

                          \[\leadsto \frac{\left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        6. lift-*.f64N/A

                          \[\leadsto \frac{\left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        7. lift-+.f64N/A

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

                          \[\leadsto \frac{\left(z \cdot \left(y + \frac{7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        9. add-flipN/A

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

                          \[\leadsto \frac{\left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        11. lift--.f64N/A

                          \[\leadsto \frac{\left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        12. metadata-evalN/A

                          \[\leadsto \frac{\left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \left(\mathsf{neg}\left(\frac{-13888888888889}{5000000000000000}\right)\right)\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        13. add-flipN/A

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

                          \[\leadsto \frac{\mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        15. lift-fma.f6463.2

                          \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(z, y - -0.0007936500793651, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} \]
                        16. lift-fma.f64N/A

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

                          \[\leadsto \frac{\mathsf{fma}\left(\left(y - \frac{-7936500793651}{10000000000000000}\right) \cdot z + \frac{-13888888888889}{5000000000000000}, z, \frac{83333333333333}{1000000000000000}\right)}{x} \]
                        18. lower-fma.f6463.2

                          \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} \]
                      6. Applied rewrites63.2%

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

                      if 2.55000000000000016e78 < x

                      1. Initial program 93.9%

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

                        \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} \]
                      3. Step-by-step derivation
                        1. lower-*.f64N/A

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

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

                          \[\leadsto x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) \]
                        4. lower-log.f64N/A

                          \[\leadsto x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) \]
                        5. lower-/.f6435.0

                          \[\leadsto x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) \]
                      4. Applied rewrites35.0%

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

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

                          \[\leadsto \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) \cdot \color{blue}{x} \]
                        3. lower-*.f6435.0

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

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

                          \[\leadsto \left(\left(\mathsf{neg}\left(\log \left(\frac{1}{x}\right)\right)\right) - 1\right) \cdot x \]
                        6. lift-log.f64N/A

                          \[\leadsto \left(\left(\mathsf{neg}\left(\log \left(\frac{1}{x}\right)\right)\right) - 1\right) \cdot x \]
                        7. lift-/.f64N/A

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

                          \[\leadsto \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log x\right)\right)\right)\right) - 1\right) \cdot x \]
                        9. lift-log.f64N/A

                          \[\leadsto \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log x\right)\right)\right)\right) - 1\right) \cdot x \]
                        10. remove-double-neg35.0

                          \[\leadsto \left(\log x - 1\right) \cdot x \]
                      6. Applied rewrites35.0%

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

                    Alternative 12: 74.0% accurate, 1.6× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\frac{y - -0.0007936500793651}{x} \cdot z\right) \cdot z\\ \mathbf{if}\;x \leq 4.4 \cdot 10^{-163}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-37}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\ \mathbf{elif}\;x \leq 2.55 \cdot 10^{+78}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(\log x - 1\right) \cdot x\\ \end{array} \end{array} \]
                    (FPCore (x y z)
                     :precision binary64
                     (let* ((t_0 (* (* (/ (- y -0.0007936500793651) x) z) z)))
                       (if (<= x 4.4e-163)
                         t_0
                         (if (<= x 1.1e-37)
                           (/
                            (fma
                             (fma 0.0007936500793651 z -0.0027777777777778)
                             z
                             0.083333333333333)
                            x)
                           (if (<= x 2.55e+78) t_0 (* (- (log x) 1.0) x))))))
                    double code(double x, double y, double z) {
                    	double t_0 = (((y - -0.0007936500793651) / x) * z) * z;
                    	double tmp;
                    	if (x <= 4.4e-163) {
                    		tmp = t_0;
                    	} else if (x <= 1.1e-37) {
                    		tmp = fma(fma(0.0007936500793651, z, -0.0027777777777778), z, 0.083333333333333) / x;
                    	} else if (x <= 2.55e+78) {
                    		tmp = t_0;
                    	} else {
                    		tmp = (log(x) - 1.0) * x;
                    	}
                    	return tmp;
                    }
                    
                    function code(x, y, z)
                    	t_0 = Float64(Float64(Float64(Float64(y - -0.0007936500793651) / x) * z) * z)
                    	tmp = 0.0
                    	if (x <= 4.4e-163)
                    		tmp = t_0;
                    	elseif (x <= 1.1e-37)
                    		tmp = Float64(fma(fma(0.0007936500793651, z, -0.0027777777777778), z, 0.083333333333333) / x);
                    	elseif (x <= 2.55e+78)
                    		tmp = t_0;
                    	else
                    		tmp = Float64(Float64(log(x) - 1.0) * x);
                    	end
                    	return tmp
                    end
                    
                    code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[x, 4.4e-163], t$95$0, If[LessEqual[x, 1.1e-37], N[(N[(N[(0.0007936500793651 * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 2.55e+78], t$95$0, N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := \left(\frac{y - -0.0007936500793651}{x} \cdot z\right) \cdot z\\
                    \mathbf{if}\;x \leq 4.4 \cdot 10^{-163}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;x \leq 1.1 \cdot 10^{-37}:\\
                    \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
                    
                    \mathbf{elif}\;x \leq 2.55 \cdot 10^{+78}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(\log x - 1\right) \cdot x\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if x < 4.40000000000000022e-163 or 1.10000000000000001e-37 < x < 2.55000000000000016e78

                      1. Initial program 93.9%

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

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

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

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

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

                          \[\leadsto {z}^{2} \cdot \mathsf{fma}\left(\frac{7936500793651}{10000000000000000}, \frac{1}{\color{blue}{x}}, \frac{y}{x}\right) \]
                        5. lower-/.f6442.3

                          \[\leadsto {z}^{2} \cdot \mathsf{fma}\left(0.0007936500793651, \frac{1}{x}, \frac{y}{x}\right) \]
                      4. Applied rewrites42.3%

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

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

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

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

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

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

                          \[\leadsto \left(\mathsf{fma}\left(\frac{7936500793651}{10000000000000000}, \frac{1}{x}, \frac{y}{x}\right) \cdot z\right) \cdot \color{blue}{z} \]
                        7. lower-*.f6444.1

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

                          \[\leadsto \left(\left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right) \cdot z\right) \cdot z \]
                        9. +-commutativeN/A

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

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

                          \[\leadsto \left(\left(\frac{y}{x} + \frac{7936500793651}{10000000000000000} \cdot \frac{1}{x}\right) \cdot z\right) \cdot z \]
                        12. mult-flip-revN/A

                          \[\leadsto \left(\left(\frac{y}{x} + \frac{\frac{7936500793651}{10000000000000000}}{x}\right) \cdot z\right) \cdot z \]
                        13. div-add-revN/A

                          \[\leadsto \left(\frac{y + \frac{7936500793651}{10000000000000000}}{x} \cdot z\right) \cdot z \]
                        14. add-flipN/A

                          \[\leadsto \left(\frac{y - \left(\mathsf{neg}\left(\frac{7936500793651}{10000000000000000}\right)\right)}{x} \cdot z\right) \cdot z \]
                        15. metadata-evalN/A

                          \[\leadsto \left(\frac{y - \frac{-7936500793651}{10000000000000000}}{x} \cdot z\right) \cdot z \]
                        16. lift--.f64N/A

                          \[\leadsto \left(\frac{y - \frac{-7936500793651}{10000000000000000}}{x} \cdot z\right) \cdot z \]
                        17. lower-/.f6444.1

                          \[\leadsto \left(\frac{y - -0.0007936500793651}{x} \cdot z\right) \cdot z \]
                      6. Applied rewrites44.1%

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

                      if 4.40000000000000022e-163 < x < 1.10000000000000001e-37

                      1. Initial program 93.9%

                        \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
                      2. 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}} \]
                      3. Step-by-step derivation
                        1. lower-/.f64N/A

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

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

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

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

                          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
                        6. lower-+.f6463.2

                          \[\leadsto \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} \]
                      4. Applied rewrites63.2%

                        \[\leadsto \color{blue}{\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}} \]
                      5. Step-by-step derivation
                        1. lift-+.f64N/A

                          \[\leadsto \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{z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}{x} \]
                        3. lift-*.f64N/A

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

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

                          \[\leadsto \frac{\left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        6. lift-*.f64N/A

                          \[\leadsto \frac{\left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        7. lift-+.f64N/A

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

                          \[\leadsto \frac{\left(z \cdot \left(y + \frac{7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        9. add-flipN/A

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

                          \[\leadsto \frac{\left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        11. lift--.f64N/A

                          \[\leadsto \frac{\left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        12. metadata-evalN/A

                          \[\leadsto \frac{\left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \left(\mathsf{neg}\left(\frac{-13888888888889}{5000000000000000}\right)\right)\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        13. add-flipN/A

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

                          \[\leadsto \frac{\mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        15. lift-fma.f6463.2

                          \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(z, y - -0.0007936500793651, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} \]
                        16. lift-fma.f64N/A

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

                          \[\leadsto \frac{\mathsf{fma}\left(\left(y - \frac{-7936500793651}{10000000000000000}\right) \cdot z + \frac{-13888888888889}{5000000000000000}, z, \frac{83333333333333}{1000000000000000}\right)}{x} \]
                        18. lower-fma.f6463.2

                          \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} \]
                      6. Applied rewrites63.2%

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

                        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), z, \frac{83333333333333}{1000000000000000}\right)}{x} \]
                      8. Step-by-step derivation
                        1. Applied rewrites46.7%

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

                        if 2.55000000000000016e78 < x

                        1. Initial program 93.9%

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

                          \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} \]
                        3. Step-by-step derivation
                          1. lower-*.f64N/A

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

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

                            \[\leadsto x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) \]
                          4. lower-log.f64N/A

                            \[\leadsto x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) \]
                          5. lower-/.f6435.0

                            \[\leadsto x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) \]
                        4. Applied rewrites35.0%

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

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

                            \[\leadsto \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) \cdot \color{blue}{x} \]
                          3. lower-*.f6435.0

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

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

                            \[\leadsto \left(\left(\mathsf{neg}\left(\log \left(\frac{1}{x}\right)\right)\right) - 1\right) \cdot x \]
                          6. lift-log.f64N/A

                            \[\leadsto \left(\left(\mathsf{neg}\left(\log \left(\frac{1}{x}\right)\right)\right) - 1\right) \cdot x \]
                          7. lift-/.f64N/A

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

                            \[\leadsto \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log x\right)\right)\right)\right) - 1\right) \cdot x \]
                          9. lift-log.f64N/A

                            \[\leadsto \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log x\right)\right)\right)\right) - 1\right) \cdot x \]
                          10. remove-double-neg35.0

                            \[\leadsto \left(\log x - 1\right) \cdot x \]
                        6. Applied rewrites35.0%

                          \[\leadsto \color{blue}{\left(\log x - 1\right) \cdot x} \]
                      9. Recombined 3 regimes into one program.
                      10. Add Preprocessing

                      Alternative 13: 70.4% accurate, 1.6× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\frac{y - -0.0007936500793651}{x} \cdot z\right) \cdot z\\ \mathbf{if}\;x \leq 6.8 \cdot 10^{-209}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{-15}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y \cdot z, z, 0.083333333333333\right)}{x}\\ \mathbf{elif}\;x \leq 2.55 \cdot 10^{+78}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(\log x - 1\right) \cdot x\\ \end{array} \end{array} \]
                      (FPCore (x y z)
                       :precision binary64
                       (let* ((t_0 (* (* (/ (- y -0.0007936500793651) x) z) z)))
                         (if (<= x 6.8e-209)
                           t_0
                           (if (<= x 2.6e-15)
                             (/ (fma (* y z) z 0.083333333333333) x)
                             (if (<= x 2.55e+78) t_0 (* (- (log x) 1.0) x))))))
                      double code(double x, double y, double z) {
                      	double t_0 = (((y - -0.0007936500793651) / x) * z) * z;
                      	double tmp;
                      	if (x <= 6.8e-209) {
                      		tmp = t_0;
                      	} else if (x <= 2.6e-15) {
                      		tmp = fma((y * z), z, 0.083333333333333) / x;
                      	} else if (x <= 2.55e+78) {
                      		tmp = t_0;
                      	} else {
                      		tmp = (log(x) - 1.0) * x;
                      	}
                      	return tmp;
                      }
                      
                      function code(x, y, z)
                      	t_0 = Float64(Float64(Float64(Float64(y - -0.0007936500793651) / x) * z) * z)
                      	tmp = 0.0
                      	if (x <= 6.8e-209)
                      		tmp = t_0;
                      	elseif (x <= 2.6e-15)
                      		tmp = Float64(fma(Float64(y * z), z, 0.083333333333333) / x);
                      	elseif (x <= 2.55e+78)
                      		tmp = t_0;
                      	else
                      		tmp = Float64(Float64(log(x) - 1.0) * x);
                      	end
                      	return tmp
                      end
                      
                      code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[x, 6.8e-209], t$95$0, If[LessEqual[x, 2.6e-15], N[(N[(N[(y * z), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 2.55e+78], t$95$0, N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]]]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_0 := \left(\frac{y - -0.0007936500793651}{x} \cdot z\right) \cdot z\\
                      \mathbf{if}\;x \leq 6.8 \cdot 10^{-209}:\\
                      \;\;\;\;t\_0\\
                      
                      \mathbf{elif}\;x \leq 2.6 \cdot 10^{-15}:\\
                      \;\;\;\;\frac{\mathsf{fma}\left(y \cdot z, z, 0.083333333333333\right)}{x}\\
                      
                      \mathbf{elif}\;x \leq 2.55 \cdot 10^{+78}:\\
                      \;\;\;\;t\_0\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\left(\log x - 1\right) \cdot x\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if x < 6.79999999999999976e-209 or 2.60000000000000004e-15 < x < 2.55000000000000016e78

                        1. Initial program 93.9%

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

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

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

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

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

                            \[\leadsto {z}^{2} \cdot \mathsf{fma}\left(\frac{7936500793651}{10000000000000000}, \frac{1}{\color{blue}{x}}, \frac{y}{x}\right) \]
                          5. lower-/.f6442.3

                            \[\leadsto {z}^{2} \cdot \mathsf{fma}\left(0.0007936500793651, \frac{1}{x}, \frac{y}{x}\right) \]
                        4. Applied rewrites42.3%

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

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

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

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

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

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

                            \[\leadsto \left(\mathsf{fma}\left(\frac{7936500793651}{10000000000000000}, \frac{1}{x}, \frac{y}{x}\right) \cdot z\right) \cdot \color{blue}{z} \]
                          7. lower-*.f6444.1

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

                            \[\leadsto \left(\left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right) \cdot z\right) \cdot z \]
                          9. +-commutativeN/A

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

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

                            \[\leadsto \left(\left(\frac{y}{x} + \frac{7936500793651}{10000000000000000} \cdot \frac{1}{x}\right) \cdot z\right) \cdot z \]
                          12. mult-flip-revN/A

                            \[\leadsto \left(\left(\frac{y}{x} + \frac{\frac{7936500793651}{10000000000000000}}{x}\right) \cdot z\right) \cdot z \]
                          13. div-add-revN/A

                            \[\leadsto \left(\frac{y + \frac{7936500793651}{10000000000000000}}{x} \cdot z\right) \cdot z \]
                          14. add-flipN/A

                            \[\leadsto \left(\frac{y - \left(\mathsf{neg}\left(\frac{7936500793651}{10000000000000000}\right)\right)}{x} \cdot z\right) \cdot z \]
                          15. metadata-evalN/A

                            \[\leadsto \left(\frac{y - \frac{-7936500793651}{10000000000000000}}{x} \cdot z\right) \cdot z \]
                          16. lift--.f64N/A

                            \[\leadsto \left(\frac{y - \frac{-7936500793651}{10000000000000000}}{x} \cdot z\right) \cdot z \]
                          17. lower-/.f6444.1

                            \[\leadsto \left(\frac{y - -0.0007936500793651}{x} \cdot z\right) \cdot z \]
                        6. Applied rewrites44.1%

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

                        if 6.79999999999999976e-209 < x < 2.60000000000000004e-15

                        1. Initial program 93.9%

                          \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
                        2. 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}} \]
                        3. Step-by-step derivation
                          1. lower-/.f64N/A

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

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

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

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

                            \[\leadsto \frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
                          6. lower-+.f6463.2

                            \[\leadsto \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} \]
                        4. Applied rewrites63.2%

                          \[\leadsto \color{blue}{\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}} \]
                        5. Step-by-step derivation
                          1. lift-+.f64N/A

                            \[\leadsto \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{z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}{x} \]
                          3. lift-*.f64N/A

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

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

                            \[\leadsto \frac{\left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                          6. lift-*.f64N/A

                            \[\leadsto \frac{\left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                          7. lift-+.f64N/A

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

                            \[\leadsto \frac{\left(z \cdot \left(y + \frac{7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                          9. add-flipN/A

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

                            \[\leadsto \frac{\left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                          11. lift--.f64N/A

                            \[\leadsto \frac{\left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                          12. metadata-evalN/A

                            \[\leadsto \frac{\left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \left(\mathsf{neg}\left(\frac{-13888888888889}{5000000000000000}\right)\right)\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                          13. add-flipN/A

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

                            \[\leadsto \frac{\mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                          15. lift-fma.f6463.2

                            \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(z, y - -0.0007936500793651, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} \]
                          16. lift-fma.f64N/A

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

                            \[\leadsto \frac{\mathsf{fma}\left(\left(y - \frac{-7936500793651}{10000000000000000}\right) \cdot z + \frac{-13888888888889}{5000000000000000}, z, \frac{83333333333333}{1000000000000000}\right)}{x} \]
                          18. lower-fma.f6463.2

                            \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} \]
                        6. Applied rewrites63.2%

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

                          \[\leadsto \frac{\mathsf{fma}\left(y \cdot z, z, \frac{83333333333333}{1000000000000000}\right)}{x} \]
                        8. Step-by-step derivation
                          1. lower-*.f6450.0

                            \[\leadsto \frac{\mathsf{fma}\left(y \cdot z, z, 0.083333333333333\right)}{x} \]
                        9. Applied rewrites50.0%

                          \[\leadsto \frac{\mathsf{fma}\left(y \cdot z, z, 0.083333333333333\right)}{x} \]

                        if 2.55000000000000016e78 < x

                        1. Initial program 93.9%

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

                          \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} \]
                        3. Step-by-step derivation
                          1. lower-*.f64N/A

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

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

                            \[\leadsto x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) \]
                          4. lower-log.f64N/A

                            \[\leadsto x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) \]
                          5. lower-/.f6435.0

                            \[\leadsto x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) \]
                        4. Applied rewrites35.0%

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

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

                            \[\leadsto \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) \cdot \color{blue}{x} \]
                          3. lower-*.f6435.0

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

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

                            \[\leadsto \left(\left(\mathsf{neg}\left(\log \left(\frac{1}{x}\right)\right)\right) - 1\right) \cdot x \]
                          6. lift-log.f64N/A

                            \[\leadsto \left(\left(\mathsf{neg}\left(\log \left(\frac{1}{x}\right)\right)\right) - 1\right) \cdot x \]
                          7. lift-/.f64N/A

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

                            \[\leadsto \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log x\right)\right)\right)\right) - 1\right) \cdot x \]
                          9. lift-log.f64N/A

                            \[\leadsto \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log x\right)\right)\right)\right) - 1\right) \cdot x \]
                          10. remove-double-neg35.0

                            \[\leadsto \left(\log x - 1\right) \cdot x \]
                        6. Applied rewrites35.0%

                          \[\leadsto \color{blue}{\left(\log x - 1\right) \cdot x} \]
                      3. Recombined 3 regimes into one program.
                      4. Add Preprocessing

                      Alternative 14: 66.6% accurate, 2.3× speedup?

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

                        1. Initial program 93.9%

                          \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
                        2. 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}} \]
                        3. Step-by-step derivation
                          1. lower-/.f64N/A

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

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

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

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

                            \[\leadsto \frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
                          6. lower-+.f6463.2

                            \[\leadsto \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} \]
                        4. Applied rewrites63.2%

                          \[\leadsto \color{blue}{\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}} \]
                        5. Step-by-step derivation
                          1. lift-+.f64N/A

                            \[\leadsto \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{z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}{x} \]
                          3. lift-*.f64N/A

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

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

                            \[\leadsto \frac{\left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                          6. lift-*.f64N/A

                            \[\leadsto \frac{\left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                          7. lift-+.f64N/A

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

                            \[\leadsto \frac{\left(z \cdot \left(y + \frac{7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                          9. add-flipN/A

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

                            \[\leadsto \frac{\left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                          11. lift--.f64N/A

                            \[\leadsto \frac{\left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                          12. metadata-evalN/A

                            \[\leadsto \frac{\left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \left(\mathsf{neg}\left(\frac{-13888888888889}{5000000000000000}\right)\right)\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                          13. add-flipN/A

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

                            \[\leadsto \frac{\mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                          15. lift-fma.f6463.2

                            \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(z, y - -0.0007936500793651, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} \]
                          16. lift-fma.f64N/A

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

                            \[\leadsto \frac{\mathsf{fma}\left(\left(y - \frac{-7936500793651}{10000000000000000}\right) \cdot z + \frac{-13888888888889}{5000000000000000}, z, \frac{83333333333333}{1000000000000000}\right)}{x} \]
                          18. lower-fma.f6463.2

                            \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} \]
                        6. Applied rewrites63.2%

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

                          \[\leadsto \frac{\mathsf{fma}\left(y \cdot z, z, \frac{83333333333333}{1000000000000000}\right)}{x} \]
                        8. Step-by-step derivation
                          1. lower-*.f6450.0

                            \[\leadsto \frac{\mathsf{fma}\left(y \cdot z, z, 0.083333333333333\right)}{x} \]
                        9. Applied rewrites50.0%

                          \[\leadsto \frac{\mathsf{fma}\left(y \cdot z, z, 0.083333333333333\right)}{x} \]

                        if 2.4e18 < x

                        1. Initial program 93.9%

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

                          \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} \]
                        3. Step-by-step derivation
                          1. lower-*.f64N/A

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

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

                            \[\leadsto x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) \]
                          4. lower-log.f64N/A

                            \[\leadsto x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) \]
                          5. lower-/.f6435.0

                            \[\leadsto x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) \]
                        4. Applied rewrites35.0%

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

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

                            \[\leadsto \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) \cdot \color{blue}{x} \]
                          3. lower-*.f6435.0

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

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

                            \[\leadsto \left(\left(\mathsf{neg}\left(\log \left(\frac{1}{x}\right)\right)\right) - 1\right) \cdot x \]
                          6. lift-log.f64N/A

                            \[\leadsto \left(\left(\mathsf{neg}\left(\log \left(\frac{1}{x}\right)\right)\right) - 1\right) \cdot x \]
                          7. lift-/.f64N/A

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

                            \[\leadsto \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log x\right)\right)\right)\right) - 1\right) \cdot x \]
                          9. lift-log.f64N/A

                            \[\leadsto \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log x\right)\right)\right)\right) - 1\right) \cdot x \]
                          10. remove-double-neg35.0

                            \[\leadsto \left(\log x - 1\right) \cdot x \]
                        6. Applied rewrites35.0%

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

                      Alternative 15: 50.0% accurate, 3.1× speedup?

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

                        \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
                      2. 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}} \]
                      3. Step-by-step derivation
                        1. lower-/.f64N/A

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

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

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

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

                          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
                        6. lower-+.f6463.2

                          \[\leadsto \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} \]
                      4. Applied rewrites63.2%

                        \[\leadsto \color{blue}{\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}} \]
                      5. Step-by-step derivation
                        1. lift-+.f64N/A

                          \[\leadsto \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{z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}{x} \]
                        3. lift-*.f64N/A

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

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

                          \[\leadsto \frac{\left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        6. lift-*.f64N/A

                          \[\leadsto \frac{\left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        7. lift-+.f64N/A

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

                          \[\leadsto \frac{\left(z \cdot \left(y + \frac{7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        9. add-flipN/A

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

                          \[\leadsto \frac{\left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        11. lift--.f64N/A

                          \[\leadsto \frac{\left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        12. metadata-evalN/A

                          \[\leadsto \frac{\left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \left(\mathsf{neg}\left(\frac{-13888888888889}{5000000000000000}\right)\right)\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        13. add-flipN/A

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

                          \[\leadsto \frac{\mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        15. lift-fma.f6463.2

                          \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(z, y - -0.0007936500793651, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} \]
                        16. lift-fma.f64N/A

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

                          \[\leadsto \frac{\mathsf{fma}\left(\left(y - \frac{-7936500793651}{10000000000000000}\right) \cdot z + \frac{-13888888888889}{5000000000000000}, z, \frac{83333333333333}{1000000000000000}\right)}{x} \]
                        18. lower-fma.f6463.2

                          \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} \]
                      6. Applied rewrites63.2%

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

                        \[\leadsto \frac{\mathsf{fma}\left(y \cdot z, z, \frac{83333333333333}{1000000000000000}\right)}{x} \]
                      8. Step-by-step derivation
                        1. lower-*.f6450.0

                          \[\leadsto \frac{\mathsf{fma}\left(y \cdot z, z, 0.083333333333333\right)}{x} \]
                      9. Applied rewrites50.0%

                        \[\leadsto \frac{\mathsf{fma}\left(y \cdot z, z, 0.083333333333333\right)}{x} \]
                      10. Add Preprocessing

                      Alternative 16: 29.0% accurate, 4.0× speedup?

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

                        \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
                      2. 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}} \]
                      3. Step-by-step derivation
                        1. lower-/.f64N/A

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

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

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

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

                          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
                        6. lower-+.f6463.2

                          \[\leadsto \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} \]
                      4. Applied rewrites63.2%

                        \[\leadsto \color{blue}{\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}} \]
                      5. Step-by-step derivation
                        1. lift-+.f64N/A

                          \[\leadsto \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{z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}{x} \]
                        3. lift-*.f64N/A

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

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

                          \[\leadsto \frac{\left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        6. lift-*.f64N/A

                          \[\leadsto \frac{\left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        7. lift-+.f64N/A

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

                          \[\leadsto \frac{\left(z \cdot \left(y + \frac{7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        9. add-flipN/A

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

                          \[\leadsto \frac{\left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        11. lift--.f64N/A

                          \[\leadsto \frac{\left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        12. metadata-evalN/A

                          \[\leadsto \frac{\left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \left(\mathsf{neg}\left(\frac{-13888888888889}{5000000000000000}\right)\right)\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        13. add-flipN/A

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

                          \[\leadsto \frac{\mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        15. lift-fma.f6463.2

                          \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(z, y - -0.0007936500793651, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} \]
                        16. lift-fma.f64N/A

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

                          \[\leadsto \frac{\mathsf{fma}\left(\left(y - \frac{-7936500793651}{10000000000000000}\right) \cdot z + \frac{-13888888888889}{5000000000000000}, z, \frac{83333333333333}{1000000000000000}\right)}{x} \]
                        18. lower-fma.f6463.2

                          \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} \]
                      6. Applied rewrites63.2%

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

                        \[\leadsto \frac{\mathsf{fma}\left(\frac{-13888888888889}{5000000000000000}, z, \frac{83333333333333}{1000000000000000}\right)}{x} \]
                      8. Step-by-step derivation
                        1. Applied rewrites29.0%

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

                        Alternative 17: 23.2% accurate, 8.7× 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;
                        }
                        
                        module fmin_fmax_functions
                            implicit none
                            private
                            public fmax
                            public fmin
                        
                            interface fmax
                                module procedure fmax88
                                module procedure fmax44
                                module procedure fmax84
                                module procedure fmax48
                            end interface
                            interface fmin
                                module procedure fmin88
                                module procedure fmin44
                                module procedure fmin84
                                module procedure fmin48
                            end interface
                        contains
                            real(8) function fmax88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmax44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmax84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmax48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                            end function
                            real(8) function fmin88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmin44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmin84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmin48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                            end function
                        end module
                        
                        real(8) function code(x, y, z)
                        use fmin_fmax_functions
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            real(8), intent (in) :: z
                            code = 0.083333333333333d0 / x
                        end function
                        
                        public static double code(double x, double y, double z) {
                        	return 0.083333333333333 / x;
                        }
                        
                        def code(x, y, z):
                        	return 0.083333333333333 / x
                        
                        function code(x, y, z)
                        	return Float64(0.083333333333333 / x)
                        end
                        
                        function tmp = code(x, y, z)
                        	tmp = 0.083333333333333 / x;
                        end
                        
                        code[x_, y_, z_] := N[(0.083333333333333 / x), $MachinePrecision]
                        
                        \begin{array}{l}
                        
                        \\
                        \frac{0.083333333333333}{x}
                        \end{array}
                        
                        Derivation
                        1. Initial program 93.9%

                          \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
                        2. 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}} \]
                        3. Step-by-step derivation
                          1. lower-/.f64N/A

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

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

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

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

                            \[\leadsto \frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
                          6. lower-+.f6463.2

                            \[\leadsto \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} \]
                        4. Applied rewrites63.2%

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

                          \[\leadsto \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                        6. Step-by-step derivation
                          1. Applied rewrites23.2%

                            \[\leadsto \frac{0.083333333333333}{x} \]
                          2. Add Preprocessing

                          Reproduce

                          ?
                          herbie shell --seed 2025156 
                          (FPCore (x y z)
                            :name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
                            :precision binary64
                            (+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))