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

Percentage Accurate: 93.7% → 95.0%
Time: 38.7s
Alternatives: 10
Speedup: 1.0×

Specification

?
\[\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} \]
(FPCore (x y z)
  :precision binary64
  (+
 (+ (- (* (- x 1/2) (log x)) x) 91893853320467/100000000000000)
 (/
  (+
   (*
    (-
     (* (+ y 7936500793651/10000000000000000) z)
     13888888888889/5000000000000000)
    z)
   83333333333333/1000000000000000)
  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 - 1/2), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 91893853320467/100000000000000), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 7936500793651/10000000000000000), $MachinePrecision] * z), $MachinePrecision] - 13888888888889/5000000000000000), $MachinePrecision] * z), $MachinePrecision] + 83333333333333/1000000000000000), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\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}

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 10 alternatives:

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

Initial Program: 93.7% accurate, 1.0× speedup?

\[\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} \]
(FPCore (x y z)
  :precision binary64
  (+
 (+ (- (* (- x 1/2) (log x)) x) 91893853320467/100000000000000)
 (/
  (+
   (*
    (-
     (* (+ y 7936500793651/10000000000000000) z)
     13888888888889/5000000000000000)
    z)
   83333333333333/1000000000000000)
  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 - 1/2), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 91893853320467/100000000000000), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 7936500793651/10000000000000000), $MachinePrecision] * z), $MachinePrecision] - 13888888888889/5000000000000000), $MachinePrecision] * z), $MachinePrecision] + 83333333333333/1000000000000000), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\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}

Alternative 1: 95.0% accurate, 0.8× speedup?

\[\begin{array}{l} t_0 := \left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\\ \mathbf{if}\;x \leq 14499999999999998720272738994373587179286645250166295040728605556879842875184063487747636105150035135758427588878949939476246172727771136:\\ \;\;\;\;t\_0 + \frac{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x}\\ \mathbf{else}:\\ \;\;\;\;t\_0 + \mathsf{134\_z0z1z2z3z4}\left(1, \left(\frac{z}{x}\right), \left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}, \left(\frac{-1}{x}\right)\right)\\ \end{array} \]
(FPCore (x y z)
  :precision binary64
  (let* ((t_0
        (+
         (- (* (- x 1/2) (log x)) x)
         91893853320467/100000000000000)))
  (if (<=
       x
       14499999999999998720272738994373587179286645250166295040728605556879842875184063487747636105150035135758427588878949939476246172727771136)
    (+
     t_0
     (/
      (+
       (*
        (-
         (* (+ y 7936500793651/10000000000000000) z)
         13888888888889/5000000000000000)
        z)
       83333333333333/1000000000000000)
      x))
    (+
     t_0
     (134-z0z1z2z3z4
      1
      (/ z x)
      (-
       (* z (- y -7936500793651/10000000000000000))
       13888888888889/5000000000000000)
      83333333333333/1000000000000000
      (/ -1 x))))))
\begin{array}{l}
t_0 := \left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\\
\mathbf{if}\;x \leq 14499999999999998720272738994373587179286645250166295040728605556879842875184063487747636105150035135758427588878949939476246172727771136:\\
\;\;\;\;t\_0 + \frac{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x}\\

\mathbf{else}:\\
\;\;\;\;t\_0 + \mathsf{134\_z0z1z2z3z4}\left(1, \left(\frac{z}{x}\right), \left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}, \left(\frac{-1}{x}\right)\right)\\


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

    1. Initial program 93.7%

      \[\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} \]

    if 1.4499999999999999e136 < x

    1. Initial program 93.7%

      \[\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. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \color{blue}{\mathsf{134\_z0z1z2z3z4}\left(1, \left(\frac{z}{x}\right), \left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}, \left(\frac{-1}{x}\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 94.5% accurate, 1.0× speedup?

\[\begin{array}{l} \mathbf{if}\;x \leq 1449999999999999992460678196288629153054020930222251832223387052753289011020174947123066913981252566629499979477761704400760581292442970358410575888164338643648836751836661491932116579591574117208504300150387150920068806070988869032355037184:\\ \;\;\;\;\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}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{\log x \cdot \left(x - \frac{1}{2}\right) - x}{\frac{91893853320467}{100000000000000}}\right) \cdot \frac{91893853320467}{100000000000000} + \frac{\frac{83333333333333}{1000000000000000}}{x}\\ \end{array} \]
(FPCore (x y z)
  :precision binary64
  (if (<=
     x
     1449999999999999992460678196288629153054020930222251832223387052753289011020174947123066913981252566629499979477761704400760581292442970358410575888164338643648836751836661491932116579591574117208504300150387150920068806070988869032355037184)
  (+
   (+ (- (* (- x 1/2) (log x)) x) 91893853320467/100000000000000)
   (/
    (+
     (*
      (-
       (* (+ y 7936500793651/10000000000000000) z)
       13888888888889/5000000000000000)
      z)
     83333333333333/1000000000000000)
    x))
  (+
   (*
    (+
     1
     (/ (- (* (log x) (- x 1/2)) x) 91893853320467/100000000000000))
    91893853320467/100000000000000)
   (/ 83333333333333/1000000000000000 x))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= 1.45e+240) {
		tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
	} else {
		tmp = ((1.0 + (((log(x) * (x - 0.5)) - x) / 0.91893853320467)) * 0.91893853320467) + (0.083333333333333 / x);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= 1.45d+240) then
        tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
    else
        tmp = ((1.0d0 + (((log(x) * (x - 0.5d0)) - x) / 0.91893853320467d0)) * 0.91893853320467d0) + (0.083333333333333d0 / x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= 1.45e+240) {
		tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
	} else {
		tmp = ((1.0 + (((Math.log(x) * (x - 0.5)) - x) / 0.91893853320467)) * 0.91893853320467) + (0.083333333333333 / x);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= 1.45e+240:
		tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
	else:
		tmp = ((1.0 + (((math.log(x) * (x - 0.5)) - x) / 0.91893853320467)) * 0.91893853320467) + (0.083333333333333 / x)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= 1.45e+240)
		tmp = 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));
	else
		tmp = Float64(Float64(Float64(1.0 + Float64(Float64(Float64(log(x) * Float64(x - 0.5)) - x) / 0.91893853320467)) * 0.91893853320467) + Float64(0.083333333333333 / x));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= 1.45e+240)
		tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
	else
		tmp = ((1.0 + (((log(x) * (x - 0.5)) - x) / 0.91893853320467)) * 0.91893853320467) + (0.083333333333333 / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, 1449999999999999992460678196288629153054020930222251832223387052753289011020174947123066913981252566629499979477761704400760581292442970358410575888164338643648836751836661491932116579591574117208504300150387150920068806070988869032355037184], N[(N[(N[(N[(N[(x - 1/2), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 91893853320467/100000000000000), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 7936500793651/10000000000000000), $MachinePrecision] * z), $MachinePrecision] - 13888888888889/5000000000000000), $MachinePrecision] * z), $MachinePrecision] + 83333333333333/1000000000000000), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1 + N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x - 1/2), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / 91893853320467/100000000000000), $MachinePrecision]), $MachinePrecision] * 91893853320467/100000000000000), $MachinePrecision] + N[(83333333333333/1000000000000000 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 1449999999999999992460678196288629153054020930222251832223387052753289011020174947123066913981252566629499979477761704400760581292442970358410575888164338643648836751836661491932116579591574117208504300150387150920068806070988869032355037184:\\
\;\;\;\;\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}\\

\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{\log x \cdot \left(x - \frac{1}{2}\right) - x}{\frac{91893853320467}{100000000000000}}\right) \cdot \frac{91893853320467}{100000000000000} + \frac{\frac{83333333333333}{1000000000000000}}{x}\\


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

    1. Initial program 93.7%

      \[\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} \]

    if 1.45e240 < x

    1. Initial program 93.7%

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

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

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

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

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

          \[\leadsto \color{blue}{\left(1 + \frac{\left(x - \frac{1}{2}\right) \cdot \log x - x}{\frac{91893853320467}{100000000000000}}\right) \cdot \frac{91893853320467}{100000000000000}} + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
      3. Applied rewrites57.4%

        \[\leadsto \color{blue}{\left(1 + \frac{\log x \cdot \left(x - \frac{1}{2}\right) - x}{\frac{91893853320467}{100000000000000}}\right) \cdot \frac{91893853320467}{100000000000000}} + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
    4. Recombined 2 regimes into one program.
    5. Add Preprocessing

    Alternative 3: 93.6% accurate, 1.0× speedup?

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

      1. Initial program 93.7%

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

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

          \[\leadsto \left(x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\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. lower--.f64N/A

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

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

          \[\leadsto \left(x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
        5. lower-/.f6492.8%

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

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

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

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

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

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

      if 4.2000000000000003e237 < x

      1. Initial program 93.7%

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

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

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

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

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

            \[\leadsto \color{blue}{\left(1 + \frac{\left(x - \frac{1}{2}\right) \cdot \log x - x}{\frac{91893853320467}{100000000000000}}\right) \cdot \frac{91893853320467}{100000000000000}} + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
        3. Applied rewrites57.4%

          \[\leadsto \color{blue}{\left(1 + \frac{\log x \cdot \left(x - \frac{1}{2}\right) - x}{\frac{91893853320467}{100000000000000}}\right) \cdot \frac{91893853320467}{100000000000000}} + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
      4. Recombined 2 regimes into one program.
      5. Add Preprocessing

      Alternative 4: 93.4% accurate, 0.9× speedup?

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

        1. Initial program 93.7%

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

          \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\left(\color{blue}{y \cdot z} - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
        3. Step-by-step derivation
          1. lower-*.f6483.0%

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

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

        if -0.0040000000000000001 < (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) < 7.9365007936510045e-4

        1. Initial program 93.7%

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

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

            \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\left(\color{blue}{\frac{7936500793651}{10000000000000000}} \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
        4. Recombined 2 regimes into one program.
        5. Add Preprocessing

        Alternative 5: 90.6% accurate, 1.0× speedup?

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

          1. Initial program 93.7%

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

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

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

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

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

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

          if 2.3e14 < x

          1. Initial program 93.7%

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

            \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\left(\color{blue}{y \cdot z} - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
          3. Step-by-step derivation
            1. lower-*.f6483.0%

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

            \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\left(\color{blue}{y \cdot z} - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 6: 84.3% accurate, 1.0× speedup?

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

          1. Initial program 93.7%

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

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

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

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

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

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

          if 4.1999999999999999e42 < x

          1. Initial program 93.7%

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

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

              \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\color{blue}{\frac{83333333333333}{1000000000000000}}}{x} \]
            2. Taylor expanded in x around inf

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

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

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

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

                \[\leadsto \left(x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
              5. lower-/.f6456.6%

                \[\leadsto \left(x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
            4. Applied rewrites56.6%

              \[\leadsto \left(\color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
          4. Recombined 2 regimes into one program.
          5. Add Preprocessing

          Alternative 7: 84.3% accurate, 1.0× speedup?

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

            1. Initial program 93.7%

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

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

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

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

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

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

            if 4.1999999999999999e42 < x

            1. Initial program 93.7%

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

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

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

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

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

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

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

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

                \[\leadsto \left(\frac{91893853320467}{100000000000000} + \left(\frac{83333333333333}{1000000000000000} \cdot \frac{1}{x} + \log x \cdot \left(x - \frac{1}{2}\right)\right)\right) - x \]
              8. lower--.f6457.4%

                \[\leadsto \left(\frac{91893853320467}{100000000000000} + \left(\frac{83333333333333}{1000000000000000} \cdot \frac{1}{x} + \log x \cdot \left(x - \frac{1}{2}\right)\right)\right) - x \]
            4. Applied rewrites57.4%

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

          Alternative 8: 84.2% accurate, 1.1× speedup?

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

            1. Initial program 93.7%

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\left(\left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) \cdot x + \frac{83333333333333}{1000000000000000}\right) \cdot \frac{1}{x}} \]
              3. Applied rewrites41.0%

                \[\leadsto \color{blue}{\left(\left(\log x \cdot \left(x - \frac{1}{2}\right) - \left(x - \frac{91893853320467}{100000000000000}\right)\right) \cdot x + \frac{83333333333333}{1000000000000000}\right) \cdot \frac{1}{x}} \]
              4. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

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

              if 4.1999999999999999e42 < x

              1. Initial program 93.7%

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

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

                  \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\color{blue}{\frac{83333333333333}{1000000000000000}}}{x} \]
              4. Recombined 2 regimes into one program.
              5. Add Preprocessing

              Alternative 9: 84.2% accurate, 1.1× speedup?

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

                1. Initial program 93.7%

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\left(\left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) \cdot x + \frac{83333333333333}{1000000000000000}\right) \cdot \frac{1}{x}} \]
                  3. Applied rewrites41.0%

                    \[\leadsto \color{blue}{\left(\left(\log x \cdot \left(x - \frac{1}{2}\right) - \left(x - \frac{91893853320467}{100000000000000}\right)\right) \cdot x + \frac{83333333333333}{1000000000000000}\right) \cdot \frac{1}{x}} \]
                  4. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

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

                  if 4.1999999999999999e42 < x

                  1. Initial program 93.7%

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

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

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

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

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

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

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

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

                      \[\leadsto \left(\frac{91893853320467}{100000000000000} + \left(\frac{83333333333333}{1000000000000000} \cdot \frac{1}{x} + \log x \cdot \left(x - \frac{1}{2}\right)\right)\right) - x \]
                    8. lower--.f6457.4%

                      \[\leadsto \left(\frac{91893853320467}{100000000000000} + \left(\frac{83333333333333}{1000000000000000} \cdot \frac{1}{x} + \log x \cdot \left(x - \frac{1}{2}\right)\right)\right) - x \]
                  4. Applied rewrites57.4%

                    \[\leadsto \color{blue}{\left(\frac{91893853320467}{100000000000000} + \left(\frac{83333333333333}{1000000000000000} \cdot \frac{1}{x} + \log x \cdot \left(x - \frac{1}{2}\right)\right)\right) - x} \]
                4. Recombined 2 regimes into one program.
                5. Add Preprocessing

                Alternative 10: 63.3% accurate, 4.8× speedup?

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\left(\left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) \cdot x + \frac{83333333333333}{1000000000000000}\right) \cdot \frac{1}{x}} \]
                  3. Applied rewrites41.0%

                    \[\leadsto \color{blue}{\left(\left(\log x \cdot \left(x - \frac{1}{2}\right) - \left(x - \frac{91893853320467}{100000000000000}\right)\right) \cdot x + \frac{83333333333333}{1000000000000000}\right) \cdot \frac{1}{x}} \]
                  4. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \color{blue}{\frac{\left(z \cdot \left(y - \frac{-7936500793651}{10000000000000000}\right) - \frac{13888888888889}{5000000000000000}\right) \cdot z - \frac{-83333333333333}{1000000000000000}}{x}} \]
                  9. Add Preprocessing

                  Reproduce

                  ?
                  herbie shell --seed 2025271 -o generate:evaluate
                  (FPCore (x y z)
                    :name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
                    :precision binary64
                    (+ (+ (- (* (- x 1/2) (log x)) x) 91893853320467/100000000000000) (/ (+ (* (- (* (+ y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x)))