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

Percentage Accurate: 93.9% → 93.9%
Time: 3.3s
Alternatives: 15
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 93.9% accurate, 1.0× speedup?

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

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

Alternative 1: 93.9% accurate, 1.0× speedup?

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

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

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

Alternative 2: 31.7% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+305}:\\
\;\;\;\;\left(x - 0.5\right) + 0.91893853320467\\

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


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

    1. Initial program 88.6%

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

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

      \[\leadsto \color{blue}{\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467} \]
    5. Taylor expanded in x around inf

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

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

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

    1. Initial program 99.4%

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

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

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

      \[\leadsto \frac{-1}{2} \cdot \log x + \frac{91893853320467}{100000000000000} \]
    6. Applied rewrites9.5%

      \[\leadsto \left(x - 0.5\right) + 0.91893853320467 \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 84.9% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t\_0 - x\\


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

    1. Initial program 98.6%

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

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

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

      \[\leadsto \left(\frac{-1}{2} \cdot \log x + x \cdot \left(\log x - 1\right)\right) + \frac{91893853320467}{100000000000000} \]
    6. Applied rewrites88.8%

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

    if 1.4e97 < x

    1. Initial program 87.8%

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

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

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

Alternative 4: 84.6% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t\_0 - x\\


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

    1. Initial program 98.6%

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

      \[\leadsto \color{blue}{\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 rewrites88.5%

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

    if 1.4e97 < x

    1. Initial program 87.8%

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

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

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

Alternative 5: 83.4% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1.4 \cdot 10^{+97}:\\ \;\;\;\;\left(\left(x - 0.5\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(x - 0.5\right) \cdot \log x - x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x 1.4e+97)
   (+
    (+ (- x 0.5) 0.91893853320467)
    (/
     (+
      (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
      0.083333333333333)
     x))
   (- (* (- x 0.5) (log x)) x)))
double code(double x, double y, double z) {
	double tmp;
	if (x <= 1.4e+97) {
		tmp = ((x - 0.5) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
	} else {
		tmp = ((x - 0.5) * log(x)) - x;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= 1.4d+97) then
        tmp = ((x - 0.5d0) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
    else
        tmp = ((x - 0.5d0) * log(x)) - x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= 1.4e+97) {
		tmp = ((x - 0.5) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
	} else {
		tmp = ((x - 0.5) * Math.log(x)) - x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= 1.4e+97:
		tmp = ((x - 0.5) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
	else:
		tmp = ((x - 0.5) * math.log(x)) - x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= 1.4e+97)
		tmp = Float64(Float64(Float64(x - 0.5) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x));
	else
		tmp = Float64(Float64(Float64(x - 0.5) * log(x)) - x);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= 1.4e+97)
		tmp = ((x - 0.5) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
	else
		tmp = ((x - 0.5) * log(x)) - x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, 1.4e+97], N[(N[(N[(x - 0.5), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.4 \cdot 10^{+97}:\\
\;\;\;\;\left(\left(x - 0.5\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\

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


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

    1. Initial program 98.6%

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

      \[\leadsto \color{blue}{\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 rewrites88.5%

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

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

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

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

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

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

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

    if 1.4e97 < x

    1. Initial program 87.8%

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

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

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

Alternative 6: 67.7% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 5.5 \cdot 10^{+226}:\\ \;\;\;\;\left(\left(x - 0.5\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(x - 0.5\right) \cdot \log x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x 5.5e+226)
   (+
    (+ (- x 0.5) 0.91893853320467)
    (/
     (+
      (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
      0.083333333333333)
     x))
   (* (- x 0.5) (log x))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= 5.5e+226) {
		tmp = ((x - 0.5) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
	} else {
		tmp = (x - 0.5) * log(x);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= 5.5d+226) then
        tmp = ((x - 0.5d0) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
    else
        tmp = (x - 0.5d0) * log(x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= 5.5e+226) {
		tmp = ((x - 0.5) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
	} else {
		tmp = (x - 0.5) * Math.log(x);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= 5.5e+226:
		tmp = ((x - 0.5) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
	else:
		tmp = (x - 0.5) * math.log(x)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= 5.5e+226)
		tmp = Float64(Float64(Float64(x - 0.5) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x));
	else
		tmp = Float64(Float64(x - 0.5) * log(x));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= 5.5e+226)
		tmp = ((x - 0.5) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
	else
		tmp = (x - 0.5) * log(x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, 5.5e+226], N[(N[(N[(x - 0.5), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.5 \cdot 10^{+226}:\\
\;\;\;\;\left(\left(x - 0.5\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\

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


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

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

    if 5.5000000000000005e226 < x

    1. Initial program 81.9%

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

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

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

      \[\leadsto \frac{91893853320467}{100000000000000} + \color{blue}{\frac{-1}{2} \cdot \log x} \]
    6. Applied rewrites31.8%

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

Alternative 7: 66.4% accurate, 3.7× speedup?

\[\begin{array}{l} \\ \left(\left(x - 0.5\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+
  (+ (- x 0.5) 0.91893853320467)
  (/
   (+
    (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
    0.083333333333333)
   x)))
double code(double x, double y, double z) {
	return ((x - 0.5) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = ((x - 0.5d0) + 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) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z):
	return ((x - 0.5) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z)
	return Float64(Float64(Float64(x - 0.5) + 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) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
end
code[x_, y_, z_] := N[(N[(N[(x - 0.5), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(x - 0.5\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
Derivation
  1. Initial program 95.2%

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

    \[\leadsto \color{blue}{\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 rewrites73.5%

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left(\left(x - 0.5\right) + 0.91893853320467\right)} + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
  11. Add Preprocessing

Alternative 8: 66.4% accurate, 4.0× speedup?

\[\begin{array}{l} \\ \left(x - 0.5\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+
  (- x 0.5)
  (/
   (+
    (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
    0.083333333333333)
   x)))
double code(double x, double y, double z) {
	return (x - 0.5) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x - 0.5d0) + ((((((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) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z):
	return (x - 0.5) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z)
	return Float64(Float64(x - 0.5) + 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) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
end
code[x_, y_, z_] := N[(N[(x - 0.5), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(x - 0.5\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
Derivation
  1. Initial program 95.2%

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

    \[\leadsto \color{blue}{\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 rewrites73.5%

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

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

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

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

    \[\leadsto \left(x - 0.5\right) \cdot \left(y + \color{blue}{0.0007936500793651}\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
  9. 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} \]
  10. Applied rewrites68.1%

    \[\leadsto \color{blue}{\left(x - 0.5\right)} + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
  11. Add Preprocessing

Alternative 9: 63.1% accurate, 4.8× speedup?

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

\\
\frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
Derivation
  1. Initial program 95.2%

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

    \[\leadsto \color{blue}{\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 rewrites73.5%

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

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

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

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

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

    \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(1 + -1 \cdot \left(\log -1 + -1 \cdot \log \left(\frac{-1}{x}\right)\right)\right)\right)} \]
  10. Applied rewrites64.8%

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

Alternative 10: 14.8% accurate, 5.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{+110}:\\ \;\;\;\;\left(x - 0.5\right) \cdot \left(y + 0.0007936500793651\right)\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{+44}:\\ \;\;\;\;\left(x - 0.5\right) + 0.91893853320467\\ \mathbf{else}:\\ \;\;\;\;\left(\left(y + 0.0007936500793651\right) \cdot z + 0.91893853320467\right) + 0.91893853320467\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -1.55e+110)
   (* (- x 0.5) (+ y 0.0007936500793651))
   (if (<= z 6.4e+44)
     (+ (- x 0.5) 0.91893853320467)
     (+
      (+ (* (+ y 0.0007936500793651) z) 0.91893853320467)
      0.91893853320467))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -1.55e+110) {
		tmp = (x - 0.5) * (y + 0.0007936500793651);
	} else if (z <= 6.4e+44) {
		tmp = (x - 0.5) + 0.91893853320467;
	} else {
		tmp = (((y + 0.0007936500793651) * z) + 0.91893853320467) + 0.91893853320467;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (z <= (-1.55d+110)) then
        tmp = (x - 0.5d0) * (y + 0.0007936500793651d0)
    else if (z <= 6.4d+44) then
        tmp = (x - 0.5d0) + 0.91893853320467d0
    else
        tmp = (((y + 0.0007936500793651d0) * z) + 0.91893853320467d0) + 0.91893853320467d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -1.55e+110) {
		tmp = (x - 0.5) * (y + 0.0007936500793651);
	} else if (z <= 6.4e+44) {
		tmp = (x - 0.5) + 0.91893853320467;
	} else {
		tmp = (((y + 0.0007936500793651) * z) + 0.91893853320467) + 0.91893853320467;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -1.55e+110:
		tmp = (x - 0.5) * (y + 0.0007936500793651)
	elif z <= 6.4e+44:
		tmp = (x - 0.5) + 0.91893853320467
	else:
		tmp = (((y + 0.0007936500793651) * z) + 0.91893853320467) + 0.91893853320467
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -1.55e+110)
		tmp = Float64(Float64(x - 0.5) * Float64(y + 0.0007936500793651));
	elseif (z <= 6.4e+44)
		tmp = Float64(Float64(x - 0.5) + 0.91893853320467);
	else
		tmp = Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) + 0.91893853320467) + 0.91893853320467);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -1.55e+110)
		tmp = (x - 0.5) * (y + 0.0007936500793651);
	elseif (z <= 6.4e+44)
		tmp = (x - 0.5) + 0.91893853320467;
	else
		tmp = (((y + 0.0007936500793651) * z) + 0.91893853320467) + 0.91893853320467;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -1.55e+110], N[(N[(x - 0.5), $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.4e+44], N[(N[(x - 0.5), $MachinePrecision] + 0.91893853320467), $MachinePrecision], N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + 0.91893853320467), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+110}:\\
\;\;\;\;\left(x - 0.5\right) \cdot \left(y + 0.0007936500793651\right)\\

\mathbf{elif}\;z \leq 6.4 \cdot 10^{+44}:\\
\;\;\;\;\left(x - 0.5\right) + 0.91893853320467\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.55000000000000009e110

    1. Initial program 91.7%

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

      \[\leadsto \color{blue}{\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 rewrites88.8%

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

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

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

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

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

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

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

    if -1.55000000000000009e110 < z < 6.40000000000000009e44

    1. Initial program 99.4%

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

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

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

      \[\leadsto \frac{-1}{2} \cdot \log x + \frac{91893853320467}{100000000000000} \]
    6. Applied rewrites9.1%

      \[\leadsto \left(x - 0.5\right) + 0.91893853320467 \]

    if 6.40000000000000009e44 < z

    1. Initial program 87.1%

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

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

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

      \[\leadsto \frac{-1}{2} \cdot \log x + \frac{91893853320467}{100000000000000} \]
    6. Applied rewrites5.0%

      \[\leadsto \left(x - 0.5\right) + 0.91893853320467 \]
    7. Taylor expanded in x around 0

      \[\leadsto \left(x - \frac{1}{2}\right) + \frac{91893853320467}{100000000000000} \]
    8. Applied rewrites30.7%

      \[\leadsto \left(\left(y + 0.0007936500793651\right) \cdot z + 0.91893853320467\right) + 0.91893853320467 \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 11: 14.8% accurate, 7.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{+110}:\\ \;\;\;\;\left(x - 0.5\right) \cdot \left(y + 0.0007936500793651\right)\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{+44}:\\ \;\;\;\;\left(x - 0.5\right) + 0.91893853320467\\ \mathbf{else}:\\ \;\;\;\;\left(y + 0.0007936500793651\right) \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -1.55e+110)
   (* (- x 0.5) (+ y 0.0007936500793651))
   (if (<= z 6.4e+44)
     (+ (- x 0.5) 0.91893853320467)
     (* (+ y 0.0007936500793651) z))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -1.55e+110) {
		tmp = (x - 0.5) * (y + 0.0007936500793651);
	} else if (z <= 6.4e+44) {
		tmp = (x - 0.5) + 0.91893853320467;
	} else {
		tmp = (y + 0.0007936500793651) * z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (z <= (-1.55d+110)) then
        tmp = (x - 0.5d0) * (y + 0.0007936500793651d0)
    else if (z <= 6.4d+44) then
        tmp = (x - 0.5d0) + 0.91893853320467d0
    else
        tmp = (y + 0.0007936500793651d0) * z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -1.55e+110) {
		tmp = (x - 0.5) * (y + 0.0007936500793651);
	} else if (z <= 6.4e+44) {
		tmp = (x - 0.5) + 0.91893853320467;
	} else {
		tmp = (y + 0.0007936500793651) * z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -1.55e+110:
		tmp = (x - 0.5) * (y + 0.0007936500793651)
	elif z <= 6.4e+44:
		tmp = (x - 0.5) + 0.91893853320467
	else:
		tmp = (y + 0.0007936500793651) * z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -1.55e+110)
		tmp = Float64(Float64(x - 0.5) * Float64(y + 0.0007936500793651));
	elseif (z <= 6.4e+44)
		tmp = Float64(Float64(x - 0.5) + 0.91893853320467);
	else
		tmp = Float64(Float64(y + 0.0007936500793651) * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -1.55e+110)
		tmp = (x - 0.5) * (y + 0.0007936500793651);
	elseif (z <= 6.4e+44)
		tmp = (x - 0.5) + 0.91893853320467;
	else
		tmp = (y + 0.0007936500793651) * z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -1.55e+110], N[(N[(x - 0.5), $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.4e+44], N[(N[(x - 0.5), $MachinePrecision] + 0.91893853320467), $MachinePrecision], N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+110}:\\
\;\;\;\;\left(x - 0.5\right) \cdot \left(y + 0.0007936500793651\right)\\

\mathbf{elif}\;z \leq 6.4 \cdot 10^{+44}:\\
\;\;\;\;\left(x - 0.5\right) + 0.91893853320467\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.55000000000000009e110

    1. Initial program 91.7%

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

      \[\leadsto \color{blue}{\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 rewrites88.8%

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

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

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

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

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

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

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

    if -1.55000000000000009e110 < z < 6.40000000000000009e44

    1. Initial program 99.4%

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

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

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

      \[\leadsto \frac{-1}{2} \cdot \log x + \frac{91893853320467}{100000000000000} \]
    6. Applied rewrites9.1%

      \[\leadsto \left(x - 0.5\right) + 0.91893853320467 \]

    if 6.40000000000000009e44 < z

    1. Initial program 87.1%

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

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

      \[\leadsto \color{blue}{\left(x - 0.5\right) \cdot \log x - x} \]
    5. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(\left(-1 \cdot \log \left(\frac{1}{x}\right) + \frac{1}{2} \cdot \frac{\log \left(\frac{1}{x}\right)}{x}\right) - 1\right)} \]
    6. Applied rewrites30.7%

      \[\leadsto \left(y + 0.0007936500793651\right) \cdot \color{blue}{z} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 12: 13.4% accurate, 9.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 6.4 \cdot 10^{+44}:\\ \;\;\;\;\left(x - 0.5\right) + 0.91893853320467\\ \mathbf{else}:\\ \;\;\;\;\left(y + 0.0007936500793651\right) \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z 6.4e+44)
   (+ (- x 0.5) 0.91893853320467)
   (* (+ y 0.0007936500793651) z)))
double code(double x, double y, double z) {
	double tmp;
	if (z <= 6.4e+44) {
		tmp = (x - 0.5) + 0.91893853320467;
	} else {
		tmp = (y + 0.0007936500793651) * z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (z <= 6.4d+44) then
        tmp = (x - 0.5d0) + 0.91893853320467d0
    else
        tmp = (y + 0.0007936500793651d0) * z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= 6.4e+44) {
		tmp = (x - 0.5) + 0.91893853320467;
	} else {
		tmp = (y + 0.0007936500793651) * z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= 6.4e+44:
		tmp = (x - 0.5) + 0.91893853320467
	else:
		tmp = (y + 0.0007936500793651) * z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= 6.4e+44)
		tmp = Float64(Float64(x - 0.5) + 0.91893853320467);
	else
		tmp = Float64(Float64(y + 0.0007936500793651) * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= 6.4e+44)
		tmp = (x - 0.5) + 0.91893853320467;
	else
		tmp = (y + 0.0007936500793651) * z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, 6.4e+44], N[(N[(x - 0.5), $MachinePrecision] + 0.91893853320467), $MachinePrecision], N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq 6.4 \cdot 10^{+44}:\\
\;\;\;\;\left(x - 0.5\right) + 0.91893853320467\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 6.40000000000000009e44

    1. Initial program 97.6%

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

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

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

      \[\leadsto \frac{-1}{2} \cdot \log x + \frac{91893853320467}{100000000000000} \]
    6. Applied rewrites7.9%

      \[\leadsto \left(x - 0.5\right) + 0.91893853320467 \]

    if 6.40000000000000009e44 < z

    1. Initial program 87.1%

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

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

      \[\leadsto \color{blue}{\left(x - 0.5\right) \cdot \log x - x} \]
    5. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(\left(-1 \cdot \log \left(\frac{1}{x}\right) + \frac{1}{2} \cdot \frac{\log \left(\frac{1}{x}\right)}{x}\right) - 1\right)} \]
    6. Applied rewrites30.7%

      \[\leadsto \left(y + 0.0007936500793651\right) \cdot \color{blue}{z} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 13: 7.8% accurate, 11.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2.7:\\ \;\;\;\;\left(y + 0.0007936500793651\right) + 0.91893853320467\\ \mathbf{else}:\\ \;\;\;\;x - 0.5\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x 2.7) (+ (+ y 0.0007936500793651) 0.91893853320467) (- x 0.5)))
double code(double x, double y, double z) {
	double tmp;
	if (x <= 2.7) {
		tmp = (y + 0.0007936500793651) + 0.91893853320467;
	} else {
		tmp = x - 0.5;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= 2.7d0) then
        tmp = (y + 0.0007936500793651d0) + 0.91893853320467d0
    else
        tmp = x - 0.5d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= 2.7) {
		tmp = (y + 0.0007936500793651) + 0.91893853320467;
	} else {
		tmp = x - 0.5;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= 2.7:
		tmp = (y + 0.0007936500793651) + 0.91893853320467
	else:
		tmp = x - 0.5
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= 2.7)
		tmp = Float64(Float64(y + 0.0007936500793651) + 0.91893853320467);
	else
		tmp = Float64(x - 0.5);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= 2.7)
		tmp = (y + 0.0007936500793651) + 0.91893853320467;
	else
		tmp = x - 0.5;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, 2.7], N[(N[(y + 0.0007936500793651), $MachinePrecision] + 0.91893853320467), $MachinePrecision], N[(x - 0.5), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.7:\\
\;\;\;\;\left(y + 0.0007936500793651\right) + 0.91893853320467\\

\mathbf{else}:\\
\;\;\;\;x - 0.5\\


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

    1. Initial program 99.6%

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

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

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

      \[\leadsto \frac{-1}{2} \cdot \log x + \frac{91893853320467}{100000000000000} \]
    6. Applied rewrites3.5%

      \[\leadsto \left(x - 0.5\right) + 0.91893853320467 \]
    7. Taylor expanded in x around inf

      \[\leadsto x \cdot \left(\left(-1 \cdot \log \left(\frac{1}{x}\right) + \frac{1}{2} \cdot \frac{\log \left(\frac{1}{x}\right)}{x}\right) - 1\right) + \frac{91893853320467}{100000000000000} \]
    8. Applied rewrites4.5%

      \[\leadsto \left(y + 0.0007936500793651\right) + 0.91893853320467 \]

    if 2.7000000000000002 < x

    1. Initial program 90.8%

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

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

      \[\leadsto \color{blue}{\left(x - 0.5\right) \cdot \log x - x} \]
    5. Taylor expanded in x around 0

      \[\leadsto \frac{-1}{2} \cdot \color{blue}{\log x} \]
    6. Applied rewrites10.9%

      \[\leadsto x - \color{blue}{0.5} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 14: 7.4% accurate, 21.1× speedup?

\[\begin{array}{l} \\ \left(x - 0.5\right) + 0.91893853320467 \end{array} \]
(FPCore (x y z) :precision binary64 (+ (- x 0.5) 0.91893853320467))
double code(double x, double y, double z) {
	return (x - 0.5) + 0.91893853320467;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x - 0.5d0) + 0.91893853320467d0
end function
public static double code(double x, double y, double z) {
	return (x - 0.5) + 0.91893853320467;
}
def code(x, y, z):
	return (x - 0.5) + 0.91893853320467
function code(x, y, z)
	return Float64(Float64(x - 0.5) + 0.91893853320467)
end
function tmp = code(x, y, z)
	tmp = (x - 0.5) + 0.91893853320467;
end
code[x_, y_, z_] := N[(N[(x - 0.5), $MachinePrecision] + 0.91893853320467), $MachinePrecision]
\begin{array}{l}

\\
\left(x - 0.5\right) + 0.91893853320467
\end{array}
Derivation
  1. Initial program 95.2%

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

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

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

    \[\leadsto \frac{-1}{2} \cdot \log x + \frac{91893853320467}{100000000000000} \]
  6. Applied rewrites7.2%

    \[\leadsto \left(x - 0.5\right) + 0.91893853320467 \]
  7. Add Preprocessing

Alternative 15: 6.1% accurate, 37.0× speedup?

\[\begin{array}{l} \\ x - 0.5 \end{array} \]
(FPCore (x y z) :precision binary64 (- x 0.5))
double code(double x, double y, double z) {
	return x - 0.5;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x - 0.5d0
end function
public static double code(double x, double y, double z) {
	return x - 0.5;
}
def code(x, y, z):
	return x - 0.5
function code(x, y, z)
	return Float64(x - 0.5)
end
function tmp = code(x, y, z)
	tmp = x - 0.5;
end
code[x_, y_, z_] := N[(x - 0.5), $MachinePrecision]
\begin{array}{l}

\\
x - 0.5
\end{array}
Derivation
  1. Initial program 95.2%

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

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

    \[\leadsto \color{blue}{\left(x - 0.5\right) \cdot \log x - x} \]
  5. Taylor expanded in x around 0

    \[\leadsto \frac{-1}{2} \cdot \color{blue}{\log x} \]
  6. Applied rewrites6.1%

    \[\leadsto x - \color{blue}{0.5} \]
  7. Add Preprocessing

Developer Target 1: 98.8% accurate, 0.9× speedup?

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

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

Reproduce

?
herbie shell --seed 2024321 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
  :precision binary64
  :pre (TRUE)

  :alt
  (! :herbie-platform default (+ (+ (+ (* (- x 1/2) (log x)) (- 91893853320467/100000000000000 x)) (/ 83333333333333/1000000000000000 x)) (* (/ z x) (- (* z (+ y 7936500793651/10000000000000000)) 13888888888889/5000000000000000))))

  (+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))