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

Percentage Accurate: 94.0% → 98.5%
Time: 11.3s
Alternatives: 15
Speedup: 1.1×

Specification

?
\[\begin{array}{l} \\ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+
  (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
  (/
   (+
    (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
    0.083333333333333)
   x)))
double code(double x, double y, double z) {
	return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
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 15 alternatives:

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

Initial Program: 94.0% 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.5% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_0 := \left(x - 0.5\right) \cdot \log x\\
\mathsf{fma}\left(\mathsf{fma}\left(z, y - -0.0007936500793651, -0.0027777777777778\right), \frac{z}{x}, \mathsf{fma}\left(1 - \frac{x - 0.91893853320467}{t\_0}, t\_0, \frac{0.083333333333333}{x}\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 94.0%

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right), \frac{z}{x}, \mathsf{fma}\left(\color{blue}{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) \]
    12. lower-/.f6498.5

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

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right), \frac{z}{x}, \mathsf{fma}\left(1 - \frac{x - \frac{91893853320467}{100000000000000}}{\color{blue}{\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) \]
    14. *-commutativeN/A

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

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

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

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

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

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

Alternative 2: 98.5% accurate, 1.0× speedup?

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

\\
\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)
\end{array}
Derivation
  1. Initial program 94.0%

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

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

Alternative 3: 94.1% accurate, 1.1× speedup?

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

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

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

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

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

Alternative 4: 93.5% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

Alternative 5: 91.0% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 94.0%

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

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

      \[\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)}{\color{blue}{x}} \]
      2. lift-+.f64N/A

        \[\leadsto \frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
    6. Applied rewrites63.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{x}{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}} \]
    8. Applied rewrites63.6%

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

    if 0.042999999999999997 < x

    1. Initial program 94.0%

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

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

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

      \[\leadsto \mathsf{fma}\left(x - \frac{1}{2}, \log x, \left(\frac{\mathsf{fma}\left(\color{blue}{y \cdot z}, z, \frac{83333333333333}{1000000000000000}\right)}{x} - x\right) - \frac{-91893853320467}{100000000000000}\right) \]
    6. Step-by-step derivation
      1. lower-*.f6482.0

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

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

Alternative 6: 86.6% accurate, 0.4× speedup?

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

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

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

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


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

    1. Initial program 94.0%

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

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

      \[\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. lift-*.f64N/A

        \[\leadsto \frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
      3. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{83333333333333}{1000000000000000} - \left(\mathsf{neg}\left(z\right)\right) \cdot \left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
      11. sub-flip-reverseN/A

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

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

        \[\leadsto \frac{\frac{83333333333333}{1000000000000000} - \left(\mathsf{neg}\left(z\right)\right) \cdot \mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right)}{x} \]
      14. fp-cancel-sign-sub-invN/A

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

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

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

        \[\leadsto \frac{\left(1 + \frac{\mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right) \cdot z}{\frac{83333333333333}{1000000000000000}}\right) \cdot \frac{83333333333333}{1000000000000000}}{x} \]
    6. Applied rewrites63.5%

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

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

    1. Initial program 94.0%

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

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

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

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

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

      if 5.00000000000000026e300 < (+.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 94.0%

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

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

        \[\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}}\right) \]
      5. Step-by-step derivation
        1. lower-/.f6465.6

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

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

    Alternative 7: 84.1% accurate, 1.8× speedup?

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

      1. Initial program 94.0%

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

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

        \[\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. lift-*.f64N/A

          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
        3. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} - \left(\mathsf{neg}\left(z\right)\right) \cdot \left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
        11. sub-flip-reverseN/A

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

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

          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} - \left(\mathsf{neg}\left(z\right)\right) \cdot \mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right)}{x} \]
        14. fp-cancel-sign-sub-invN/A

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right) \cdot z - \left(\mathsf{neg}\left(\frac{83333333333333}{1000000000000000}\right)\right)}{x} \]
      6. Applied rewrites63.6%

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

      if 3.4e9 < x

      1. Initial program 94.0%

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

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

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

        \[\leadsto \mathsf{fma}\left(x - \frac{1}{2}, \log x, \color{blue}{-1 \cdot x}\right) \]
      6. Step-by-step derivation
        1. lower-*.f6435.9

          \[\leadsto \mathsf{fma}\left(x - 0.5, \log x, -1 \cdot \color{blue}{x}\right) \]
      7. Applied rewrites35.9%

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

    Alternative 8: 84.1% accurate, 1.8× speedup?

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

      1. Initial program 94.0%

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

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

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

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

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

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

          \[\leadsto \frac{\left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
        12. sub-flip-reverseN/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. metadata-evalN/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.6

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

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

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

      if 3.4e9 < x

      1. Initial program 94.0%

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

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

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

        \[\leadsto \mathsf{fma}\left(x - \frac{1}{2}, \log x, \color{blue}{-1 \cdot x}\right) \]
      6. Step-by-step derivation
        1. lower-*.f6435.9

          \[\leadsto \mathsf{fma}\left(x - 0.5, \log x, -1 \cdot \color{blue}{x}\right) \]
      7. Applied rewrites35.9%

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

    Alternative 9: 63.6% accurate, 2.2× speedup?

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
      12. sub-flip-reverseN/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. metadata-evalN/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.6

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

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

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

    Alternative 10: 63.0% accurate, 1.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\left(y \cdot z\right) \cdot z - -0.083333333333333}{x}\\ \mathbf{if}\;y \leq -6.2 \cdot 10^{+72}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 0.0035:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right) \cdot z - -0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (let* ((t_0 (/ (- (* (* y z) z) -0.083333333333333) x)))
       (if (<= y -6.2e+72)
         t_0
         (if (<= y 0.0035)
           (/
            (-
             (* (fma 0.0007936500793651 z -0.0027777777777778) z)
             -0.083333333333333)
            x)
           t_0))))
    double code(double x, double y, double z) {
    	double t_0 = (((y * z) * z) - -0.083333333333333) / x;
    	double tmp;
    	if (y <= -6.2e+72) {
    		tmp = t_0;
    	} else if (y <= 0.0035) {
    		tmp = ((fma(0.0007936500793651, z, -0.0027777777777778) * z) - -0.083333333333333) / x;
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    function code(x, y, z)
    	t_0 = Float64(Float64(Float64(Float64(y * z) * z) - -0.083333333333333) / x)
    	tmp = 0.0
    	if (y <= -6.2e+72)
    		tmp = t_0;
    	elseif (y <= 0.0035)
    		tmp = Float64(Float64(Float64(fma(0.0007936500793651, z, -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 * z), $MachinePrecision] * z), $MachinePrecision] - -0.083333333333333), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[y, -6.2e+72], t$95$0, If[LessEqual[y, 0.0035], N[(N[(N[(N[(0.0007936500793651 * z + -0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] - -0.083333333333333), $MachinePrecision] / x), $MachinePrecision], t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{\left(y \cdot z\right) \cdot z - -0.083333333333333}{x}\\
    \mathbf{if}\;y \leq -6.2 \cdot 10^{+72}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;y \leq 0.0035:\\
    \;\;\;\;\frac{\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right) \cdot z - -0.083333333333333}{x}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < -6.19999999999999977e72 or 0.00350000000000000007 < y

      1. Initial program 94.0%

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

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

        \[\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. lift-*.f64N/A

          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
        3. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} - \left(\mathsf{neg}\left(z\right)\right) \cdot \left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
        11. sub-flip-reverseN/A

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

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

          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} - \left(\mathsf{neg}\left(z\right)\right) \cdot \mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right)}{x} \]
        14. fp-cancel-sign-sub-invN/A

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right) \cdot z - \left(\mathsf{neg}\left(\frac{83333333333333}{1000000000000000}\right)\right)}{x} \]
      6. Applied rewrites63.6%

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

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

          \[\leadsto \frac{\left(y \cdot z\right) \cdot z - -0.083333333333333}{x} \]
      9. Applied rewrites50.4%

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

      if -6.19999999999999977e72 < y < 0.00350000000000000007

      1. Initial program 94.0%

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

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

        \[\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. lift-*.f64N/A

          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
        3. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} - \left(\mathsf{neg}\left(z\right)\right) \cdot \left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
        11. sub-flip-reverseN/A

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

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

          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} - \left(\mathsf{neg}\left(z\right)\right) \cdot \mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right)}{x} \]
        14. fp-cancel-sign-sub-invN/A

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right) \cdot z - \left(\mathsf{neg}\left(\frac{83333333333333}{1000000000000000}\right)\right)}{x} \]
      6. Applied rewrites63.6%

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

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

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

      Alternative 11: 60.9% accurate, 2.4× speedup?

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

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

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

        \[\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. lift-*.f64N/A

          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
        3. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} - \left(\mathsf{neg}\left(z\right)\right) \cdot \left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
        11. sub-flip-reverseN/A

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

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

          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} - \left(\mathsf{neg}\left(z\right)\right) \cdot \mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right)}{x} \]
        14. fp-cancel-sign-sub-invN/A

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right) \cdot z - \left(\mathsf{neg}\left(\frac{83333333333333}{1000000000000000}\right)\right)}{x} \]
      6. Applied rewrites63.6%

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

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

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

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

        \[\leadsto \frac{\left(z \cdot \left(0.0007936500793651 + y\right)\right) \cdot z - -0.083333333333333}{x} \]
      10. Add Preprocessing

      Alternative 12: 50.4% accurate, 2.9× speedup?

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

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

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

        \[\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. lift-*.f64N/A

          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
        3. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} - \left(\mathsf{neg}\left(z\right)\right) \cdot \left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
        11. sub-flip-reverseN/A

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

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

          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} - \left(\mathsf{neg}\left(z\right)\right) \cdot \mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right)}{x} \]
        14. fp-cancel-sign-sub-invN/A

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right) \cdot z - \left(\mathsf{neg}\left(\frac{83333333333333}{1000000000000000}\right)\right)}{x} \]
      6. Applied rewrites63.6%

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

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

          \[\leadsto \frac{\left(y \cdot z\right) \cdot z - -0.083333333333333}{x} \]
      9. Applied rewrites50.4%

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

      Alternative 13: 29.3% accurate, 3.8× speedup?

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

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

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

        \[\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. lift-*.f64N/A

          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
        3. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} - \left(\mathsf{neg}\left(z\right)\right) \cdot \left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right)}{x} \]
        11. sub-flip-reverseN/A

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

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

          \[\leadsto \frac{\frac{83333333333333}{1000000000000000} - \left(\mathsf{neg}\left(z\right)\right) \cdot \mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right)}{x} \]
        14. fp-cancel-sign-sub-invN/A

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(z, y - \frac{-7936500793651}{10000000000000000}, \frac{-13888888888889}{5000000000000000}\right) \cdot z - \left(\mathsf{neg}\left(\frac{83333333333333}{1000000000000000}\right)\right)}{x} \]
      6. Applied rewrites63.6%

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

        \[\leadsto \frac{\frac{-13888888888889}{5000000000000000} \cdot z - \frac{-83333333333333}{1000000000000000}}{x} \]
      8. Step-by-step derivation
        1. Applied rewrites29.3%

          \[\leadsto \frac{-0.0027777777777778 \cdot z - -0.083333333333333}{x} \]
        2. Add Preprocessing

        Alternative 14: 23.7% accurate, 5.2× speedup?

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

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

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

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

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

          \[\leadsto \frac{1}{\color{blue}{x} \cdot \frac{1000000000000000}{83333333333333}} \]
        7. Step-by-step derivation
          1. Applied rewrites23.7%

            \[\leadsto \frac{1}{\color{blue}{x} \cdot 12.000000000000048} \]
          2. Add Preprocessing

          Alternative 15: 23.7% 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 94.0%

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

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

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

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

            Reproduce

            ?
            herbie shell --seed 2025142 
            (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)))