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

Percentage Accurate: 94.1% → 98.5%
Time: 14.7s
Alternatives: 16
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 94.1% 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: 98.5% accurate, 1.0× speedup?

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

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

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

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

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \left(\color{blue}{\left(0.0007936500793651 \cdot \frac{z}{x} + \frac{y \cdot z}{x}\right)} - 0.0027777777777778 \cdot \frac{1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right) \]
  5. Step-by-step derivation
    1. associate-/l*94.3%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \left(\left(0.0007936500793651 \cdot \frac{z}{x} + \color{blue}{y \cdot \frac{z}{x}}\right) - 0.0027777777777778 \cdot \frac{1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right) \]
    2. distribute-rgt-out98.2%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \left(\color{blue}{\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)} - 0.0027777777777778 \cdot \frac{1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right) \]
  6. Simplified98.2%

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

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

Alternative 2: 96.0% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;y \leq 2.2 \cdot 10^{-31}:\\
\;\;\;\;t\_0 + \left(t\_1 + z \cdot \left(\frac{z}{x} \cdot 0.0007936500793651 - \frac{0.0027777777777778}{x}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(x \cdot \log x - x\right)\right) + \left(t\_1 + z \cdot \left(\frac{z \cdot y}{x} + 0.0027777777777778 \cdot \frac{-1}{x}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.40000000000000002e-27

    1. Initial program 95.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

    if -2.40000000000000002e-27 < y < 2.2000000000000001e-31

    1. Initial program 90.6%

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

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

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\color{blue}{z \cdot \left(0.0007936500793651 \cdot \frac{z}{x} - 0.0027777777777778 \cdot \frac{1}{x}\right)} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
    5. Step-by-step derivation
      1. associate-*r/99.6%

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \left(0.0007936500793651 \cdot \frac{z}{x} - \color{blue}{\frac{0.0027777777777778 \cdot 1}{x}}\right) + 0.083333333333333 \cdot \frac{1}{x}\right) \]
      2. metadata-eval99.6%

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \left(0.0007936500793651 \cdot \frac{z}{x} - \frac{\color{blue}{0.0027777777777778}}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right) \]
    6. Simplified99.6%

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

    if 2.2000000000000001e-31 < y

    1. Initial program 94.1%

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

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\color{blue}{y \cdot z} - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    4. Step-by-step derivation
      1. *-commutative94.1%

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

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

      \[\leadsto \left(\left(\color{blue}{-1 \cdot \left(x \cdot \log \left(\frac{1}{x}\right)\right)} - x\right) + 0.91893853320467\right) + \frac{\left(z \cdot y - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    7. Step-by-step derivation
      1. mul-1-neg94.1%

        \[\leadsto \left(\left(\color{blue}{\left(-x \cdot \log \left(\frac{1}{x}\right)\right)} - x\right) + 0.91893853320467\right) + \frac{\left(z \cdot y - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      2. distribute-rgt-neg-in94.1%

        \[\leadsto \left(\left(\color{blue}{x \cdot \left(-\log \left(\frac{1}{x}\right)\right)} - x\right) + 0.91893853320467\right) + \frac{\left(z \cdot y - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      3. log-rec94.1%

        \[\leadsto \left(\left(x \cdot \left(-\color{blue}{\left(-\log x\right)}\right) - x\right) + 0.91893853320467\right) + \frac{\left(z \cdot y - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      4. remove-double-neg94.1%

        \[\leadsto \left(\left(x \cdot \color{blue}{\log x} - x\right) + 0.91893853320467\right) + \frac{\left(z \cdot y - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    8. Simplified94.1%

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

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

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

Alternative 3: 96.9% accurate, 0.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t\_0 + \left(0.083333333333333 \cdot \frac{1}{x} + z \cdot \left(z \cdot \frac{y}{x} + 0.0027777777777778 \cdot \frac{-1}{x}\right)\right)\\


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

    1. Initial program 96.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

    if 3e158 < x

    1. Initial program 84.9%

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

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

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

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

Alternative 4: 95.8% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 96.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

    if 5.80000000000000048e158 < x

    1. Initial program 84.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 y around inf 86.0%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\color{blue}{y \cdot z} - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    4. Step-by-step derivation
      1. *-commutative86.0%

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

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

      \[\leadsto \left(\left(\color{blue}{-1 \cdot \left(x \cdot \log \left(\frac{1}{x}\right)\right)} - x\right) + 0.91893853320467\right) + \frac{\left(z \cdot y - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    7. Step-by-step derivation
      1. mul-1-neg86.0%

        \[\leadsto \left(\left(\color{blue}{\left(-x \cdot \log \left(\frac{1}{x}\right)\right)} - x\right) + 0.91893853320467\right) + \frac{\left(z \cdot y - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      2. distribute-rgt-neg-in86.0%

        \[\leadsto \left(\left(\color{blue}{x \cdot \left(-\log \left(\frac{1}{x}\right)\right)} - x\right) + 0.91893853320467\right) + \frac{\left(z \cdot y - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      3. log-rec86.0%

        \[\leadsto \left(\left(x \cdot \left(-\color{blue}{\left(-\log x\right)}\right) - x\right) + 0.91893853320467\right) + \frac{\left(z \cdot y - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      4. remove-double-neg86.0%

        \[\leadsto \left(\left(x \cdot \color{blue}{\log x} - x\right) + 0.91893853320467\right) + \frac{\left(z \cdot y - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    8. Simplified86.0%

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

      \[\leadsto \left(\left(x \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\left(z \cdot \left(\frac{y \cdot z}{x} - 0.0027777777777778 \cdot \frac{1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.7%

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

Alternative 5: 90.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.7%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \left(\color{blue}{\left(\left(x - 0.5\right) \cdot \log x + \left(-x\right)\right)} + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      2. associate-+l+99.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}} \]
    6. Step-by-step derivation
      1. distribute-lft-in99.4%

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

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

    if 1.99999999999999991e-6 < x

    1. Initial program 87.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 y around inf 83.8%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\color{blue}{y \cdot z} - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    4. Step-by-step derivation
      1. *-commutative83.8%

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

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

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

Alternative 6: 90.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.054:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(\left(z \cdot 0.0007936500793651 + z \cdot y\right) - 0.0027777777777778\right)}{x}\\

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


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

    1. Initial program 99.7%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \left(\color{blue}{\left(\left(x - 0.5\right) \cdot \log x + \left(-x\right)\right)} + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      2. associate-+l+99.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}} \]
    6. Step-by-step derivation
      1. distribute-lft-in99.4%

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

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

    if 0.0539999999999999994 < x

    1. Initial program 87.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 y around inf 83.8%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\color{blue}{y \cdot z} - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    4. Step-by-step derivation
      1. *-commutative83.8%

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

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

      \[\leadsto \left(\left(\color{blue}{-1 \cdot \left(x \cdot \log \left(\frac{1}{x}\right)\right)} - x\right) + 0.91893853320467\right) + \frac{\left(z \cdot y - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    7. Step-by-step derivation
      1. mul-1-neg82.5%

        \[\leadsto \left(\left(\color{blue}{\left(-x \cdot \log \left(\frac{1}{x}\right)\right)} - x\right) + 0.91893853320467\right) + \frac{\left(z \cdot y - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      2. distribute-rgt-neg-in82.5%

        \[\leadsto \left(\left(\color{blue}{x \cdot \left(-\log \left(\frac{1}{x}\right)\right)} - x\right) + 0.91893853320467\right) + \frac{\left(z \cdot y - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      3. log-rec82.5%

        \[\leadsto \left(\left(x \cdot \left(-\color{blue}{\left(-\log x\right)}\right) - x\right) + 0.91893853320467\right) + \frac{\left(z \cdot y - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      4. remove-double-neg82.5%

        \[\leadsto \left(\left(x \cdot \color{blue}{\log x} - x\right) + 0.91893853320467\right) + \frac{\left(z \cdot y - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    8. Simplified82.5%

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

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

Alternative 7: 94.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+
  (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
  (/
   (+
    0.083333333333333
    (* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
   x)))
double code(double x, double y, double z) {
	return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / 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) + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
end function
public static double code(double x, double y, double z) {
	return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
}
def code(x, y, z):
	return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x)
function code(x, y, z)
	return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x))
end
function tmp = code(x, y, z)
	tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / 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[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}
\end{array}
Derivation
  1. Initial program 93.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. Final simplification93.1%

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

Alternative 8: 84.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 26:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(\left(z \cdot 0.0007936500793651 + z \cdot y\right) - 0.0027777777777778\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x 26.0)
   (/
    (+
     0.083333333333333
     (* z (- (+ (* z 0.0007936500793651) (* z y)) 0.0027777777777778)))
    x)
   (+
    (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
    (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= 26.0) {
		tmp = (0.083333333333333 + (z * (((z * 0.0007936500793651) + (z * y)) - 0.0027777777777778))) / x;
	} else {
		tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / 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 <= 26.0d0) then
        tmp = (0.083333333333333d0 + (z * (((z * 0.0007936500793651d0) + (z * y)) - 0.0027777777777778d0))) / 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 <= 26.0) {
		tmp = (0.083333333333333 + (z * (((z * 0.0007936500793651) + (z * y)) - 0.0027777777777778))) / 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 <= 26.0:
		tmp = (0.083333333333333 + (z * (((z * 0.0007936500793651) + (z * y)) - 0.0027777777777778))) / 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 <= 26.0)
		tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(Float64(z * 0.0007936500793651) + Float64(z * y)) - 0.0027777777777778))) / 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 <= 26.0)
		tmp = (0.083333333333333 + (z * (((z * 0.0007936500793651) + (z * y)) - 0.0027777777777778))) / 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, 26.0], N[(N[(0.083333333333333 + N[(z * N[(N[(N[(z * 0.0007936500793651), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 26:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(\left(z \cdot 0.0007936500793651 + z \cdot y\right) - 0.0027777777777778\right)}{x}\\

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


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

    1. Initial program 99.7%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \left(\color{blue}{\left(\left(x - 0.5\right) \cdot \log x + \left(-x\right)\right)} + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      2. associate-+l+99.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}} \]
    6. Step-by-step derivation
      1. distribute-lft-in99.4%

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

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

    if 26 < x

    1. Initial program 87.3%

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

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

Alternative 9: 84.5% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 9.6 \cdot 10^{+33}:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(\left(z \cdot 0.0007936500793651 + z \cdot y\right) - 0.0027777777777778\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x 9.6e+33)
   (/
    (+
     0.083333333333333
     (* z (- (+ (* z 0.0007936500793651) (* z y)) 0.0027777777777778)))
    x)
   (* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= 9.6e+33) {
		tmp = (0.083333333333333 + (z * (((z * 0.0007936500793651) + (z * y)) - 0.0027777777777778))) / x;
	} else {
		tmp = x * (log(x) + -1.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) :: tmp
    if (x <= 9.6d+33) then
        tmp = (0.083333333333333d0 + (z * (((z * 0.0007936500793651d0) + (z * y)) - 0.0027777777777778d0))) / x
    else
        tmp = x * (log(x) + (-1.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= 9.6e+33) {
		tmp = (0.083333333333333 + (z * (((z * 0.0007936500793651) + (z * y)) - 0.0027777777777778))) / x;
	} else {
		tmp = x * (Math.log(x) + -1.0);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= 9.6e+33:
		tmp = (0.083333333333333 + (z * (((z * 0.0007936500793651) + (z * y)) - 0.0027777777777778))) / x
	else:
		tmp = x * (math.log(x) + -1.0)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= 9.6e+33)
		tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(Float64(z * 0.0007936500793651) + Float64(z * y)) - 0.0027777777777778))) / x);
	else
		tmp = Float64(x * Float64(log(x) + -1.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= 9.6e+33)
		tmp = (0.083333333333333 + (z * (((z * 0.0007936500793651) + (z * y)) - 0.0027777777777778))) / x;
	else
		tmp = x * (log(x) + -1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, 9.6e+33], N[(N[(0.083333333333333 + N[(z * N[(N[(N[(z * 0.0007936500793651), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    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. Step-by-step derivation
      1. sub-neg99.6%

        \[\leadsto \left(\color{blue}{\left(\left(x - 0.5\right) \cdot \log x + \left(-x\right)\right)} + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      2. associate-+l+99.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}} \]
    6. Step-by-step derivation
      1. distribute-lft-in93.9%

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

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

    if 9.5999999999999999e33 < x

    1. Initial program 85.9%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Step-by-step derivation
      1. sub-neg85.9%

        \[\leadsto \left(\color{blue}{\left(\left(x - 0.5\right) \cdot \log x + \left(-x\right)\right)} + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      2. associate-+l+85.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) + \left(-1\right)\right)} \]
      2. mul-1-neg74.8%

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

        \[\leadsto x \cdot \left(\left(-\color{blue}{\left(-\log x\right)}\right) + \left(-1\right)\right) \]
      4. remove-double-neg74.8%

        \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(-1\right)\right) \]
      5. metadata-eval74.8%

        \[\leadsto x \cdot \left(\log x + \color{blue}{-1}\right) \]
    7. Simplified74.8%

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

Alternative 10: 62.8% accurate, 5.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -240 \lor \neg \left(z \leq 6.8 \cdot 10^{+53}\right):\\ \;\;\;\;\left(z \cdot z\right) \cdot \frac{0.0007936500793651 + y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot y - 0.0027777777777778\right)}{x}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -240.0) (not (<= z 6.8e+53)))
   (* (* z z) (/ (+ 0.0007936500793651 y) x))
   (/ (+ 0.083333333333333 (* z (- (* z y) 0.0027777777777778))) x)))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -240.0) || !(z <= 6.8e+53)) {
		tmp = (z * z) * ((0.0007936500793651 + y) / x);
	} else {
		tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / 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 ((z <= (-240.0d0)) .or. (.not. (z <= 6.8d+53))) then
        tmp = (z * z) * ((0.0007936500793651d0 + y) / x)
    else
        tmp = (0.083333333333333d0 + (z * ((z * y) - 0.0027777777777778d0))) / x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -240.0) || !(z <= 6.8e+53)) {
		tmp = (z * z) * ((0.0007936500793651 + y) / x);
	} else {
		tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -240.0) or not (z <= 6.8e+53):
		tmp = (z * z) * ((0.0007936500793651 + y) / x)
	else:
		tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -240.0) || !(z <= 6.8e+53))
		tmp = Float64(Float64(z * z) * Float64(Float64(0.0007936500793651 + y) / x));
	else
		tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * y) - 0.0027777777777778))) / x);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -240.0) || ~((z <= 6.8e+53)))
		tmp = (z * z) * ((0.0007936500793651 + y) / x);
	else
		tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -240.0], N[Not[LessEqual[z, 6.8e+53]], $MachinePrecision]], N[(N[(z * z), $MachinePrecision] * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.083333333333333 + N[(z * N[(N[(z * y), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -240 \lor \neg \left(z \leq 6.8 \cdot 10^{+53}\right):\\
\;\;\;\;\left(z \cdot z\right) \cdot \frac{0.0007936500793651 + y}{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot y - 0.0027777777777778\right)}{x}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -240 or 6.79999999999999995e53 < z

    1. Initial program 85.9%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Step-by-step derivation
      1. sub-neg85.9%

        \[\leadsto \left(\color{blue}{\left(\left(x - 0.5\right) \cdot \log x + \left(-x\right)\right)} + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      2. associate-+l+85.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{z}^{2} \cdot \frac{0.0007936500793651 + y}{x}} \]
    8. Simplified66.6%

      \[\leadsto \color{blue}{{z}^{2} \cdot \frac{0.0007936500793651 + y}{x}} \]
    9. Step-by-step derivation
      1. unpow266.6%

        \[\leadsto \color{blue}{\left(z \cdot z\right)} \cdot \frac{0.0007936500793651 + y}{x} \]
    10. Applied egg-rr66.6%

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

    if -240 < z < 6.79999999999999995e53

    1. Initial program 99.5%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Step-by-step derivation
      1. sub-neg99.5%

        \[\leadsto \left(\color{blue}{\left(\left(x - 0.5\right) \cdot \log x + \left(-x\right)\right)} + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      2. associate-+l+99.5%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{0.083333333333333 + z \cdot \left(\color{blue}{y \cdot z} - 0.0027777777777778\right)}{x} \]
    7. Step-by-step derivation
      1. *-commutative52.3%

        \[\leadsto \frac{0.083333333333333 + z \cdot \left(\color{blue}{z \cdot y} - 0.0027777777777778\right)}{x} \]
    8. Simplified52.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -240 \lor \neg \left(z \leq 6.8 \cdot 10^{+53}\right):\\ \;\;\;\;\left(z \cdot z\right) \cdot \frac{0.0007936500793651 + y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot y - 0.0027777777777778\right)}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 60.4% accurate, 6.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{-50} \lor \neg \left(z \leq 1.08 \cdot 10^{-8}\right):\\ \;\;\;\;\left(z \cdot z\right) \cdot \frac{0.0007936500793651 + y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -2.1e-50) (not (<= z 1.08e-8)))
   (* (* z z) (/ (+ 0.0007936500793651 y) x))
   (/ (+ 0.083333333333333 (* z -0.0027777777777778)) x)))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -2.1e-50) || !(z <= 1.08e-8)) {
		tmp = (z * z) * ((0.0007936500793651 + y) / x);
	} else {
		tmp = (0.083333333333333 + (z * -0.0027777777777778)) / 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 ((z <= (-2.1d-50)) .or. (.not. (z <= 1.08d-8))) then
        tmp = (z * z) * ((0.0007936500793651d0 + y) / x)
    else
        tmp = (0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -2.1e-50) || !(z <= 1.08e-8)) {
		tmp = (z * z) * ((0.0007936500793651 + y) / x);
	} else {
		tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -2.1e-50) or not (z <= 1.08e-8):
		tmp = (z * z) * ((0.0007936500793651 + y) / x)
	else:
		tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -2.1e-50) || !(z <= 1.08e-8))
		tmp = Float64(Float64(z * z) * Float64(Float64(0.0007936500793651 + y) / x));
	else
		tmp = Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -2.1e-50) || ~((z <= 1.08e-8)))
		tmp = (z * z) * ((0.0007936500793651 + y) / x);
	else
		tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.1e-50], N[Not[LessEqual[z, 1.08e-8]], $MachinePrecision]], N[(N[(z * z), $MachinePrecision] * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-50} \lor \neg \left(z \leq 1.08 \cdot 10^{-8}\right):\\
\;\;\;\;\left(z \cdot z\right) \cdot \frac{0.0007936500793651 + y}{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.1000000000000001e-50 or 1.0800000000000001e-8 < z

    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. Step-by-step derivation
      1. sub-neg88.6%

        \[\leadsto \left(\color{blue}{\left(\left(x - 0.5\right) \cdot \log x + \left(-x\right)\right)} + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      2. associate-+l+88.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{z}^{2} \cdot \frac{0.0007936500793651 + y}{x}} \]
    8. Simplified59.7%

      \[\leadsto \color{blue}{{z}^{2} \cdot \frac{0.0007936500793651 + y}{x}} \]
    9. Step-by-step derivation
      1. unpow259.7%

        \[\leadsto \color{blue}{\left(z \cdot z\right)} \cdot \frac{0.0007936500793651 + y}{x} \]
    10. Applied egg-rr59.7%

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

    if -2.1000000000000001e-50 < z < 1.0800000000000001e-8

    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. Step-by-step derivation
      1. sub-neg99.4%

        \[\leadsto \left(\color{blue}{\left(\left(x - 0.5\right) \cdot \log x + \left(-x\right)\right)} + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      2. associate-+l+99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{-50} \lor \neg \left(z \leq 1.08 \cdot 10^{-8}\right):\\ \;\;\;\;\left(z \cdot z\right) \cdot \frac{0.0007936500793651 + y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 63.2% accurate, 8.2× speedup?

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

\\
\frac{0.083333333333333 + z \cdot \left(\left(z \cdot 0.0007936500793651 + z \cdot y\right) - 0.0027777777777778\right)}{x}
\end{array}
Derivation
  1. Initial program 93.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. Step-by-step derivation
    1. sub-neg93.1%

      \[\leadsto \left(\color{blue}{\left(\left(x - 0.5\right) \cdot \log x + \left(-x\right)\right)} + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. associate-+l+93.1%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}} \]
  6. Step-by-step derivation
    1. distribute-lft-in59.2%

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

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

Alternative 13: 63.2% accurate, 9.5× speedup?

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

\\
\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}
\end{array}
Derivation
  1. Initial program 93.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. Step-by-step derivation
    1. sub-neg93.1%

      \[\leadsto \left(\color{blue}{\left(\left(x - 0.5\right) \cdot \log x + \left(-x\right)\right)} + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. associate-+l+93.1%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 33.0% accurate, 10.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1.52 \cdot 10^{-9}:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot 0.083333333333333\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x 1.52e-9)
   (/ (+ 0.083333333333333 (* z -0.0027777777777778)) x)
   (* x 0.083333333333333)))
double code(double x, double y, double z) {
	double tmp;
	if (x <= 1.52e-9) {
		tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x;
	} else {
		tmp = x * 0.083333333333333;
	}
	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.52d-9) then
        tmp = (0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x
    else
        tmp = x * 0.083333333333333d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= 1.52e-9) {
		tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x;
	} else {
		tmp = x * 0.083333333333333;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= 1.52e-9:
		tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x
	else:
		tmp = x * 0.083333333333333
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= 1.52e-9)
		tmp = Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x);
	else
		tmp = Float64(x * 0.083333333333333);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= 1.52e-9)
		tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x;
	else
		tmp = x * 0.083333333333333;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, 1.52e-9], N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(x * 0.083333333333333), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.52 \cdot 10^{-9}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\

\mathbf{else}:\\
\;\;\;\;x \cdot 0.083333333333333\\


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

    1. Initial program 99.7%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \left(\color{blue}{\left(\left(x - 0.5\right) \cdot \log x + \left(-x\right)\right)} + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      2. associate-+l+99.7%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{0.083333333333333 + z \cdot \color{blue}{-0.0027777777777778}}{x} \]

    if 1.51999999999999992e-9 < x

    1. Initial program 87.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. Step-by-step derivation
      1. sub-neg87.5%

        \[\leadsto \left(\color{blue}{\left(\left(x - 0.5\right) \cdot \log x + \left(-x\right)\right)} + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      2. associate-+l+87.5%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{0.083333333333333}}{x} \]
    7. Step-by-step derivation
      1. div-inv3.0%

        \[\leadsto \color{blue}{0.083333333333333 \cdot \frac{1}{x}} \]
    8. Applied egg-rr3.0%

      \[\leadsto \color{blue}{0.083333333333333 \cdot \frac{1}{x}} \]
    9. Step-by-step derivation
      1. pow13.0%

        \[\leadsto \color{blue}{{\left(0.083333333333333 \cdot \frac{1}{x}\right)}^{1}} \]
      2. *-commutative3.0%

        \[\leadsto {\color{blue}{\left(\frac{1}{x} \cdot 0.083333333333333\right)}}^{1} \]
      3. add-exp-log3.0%

        \[\leadsto {\left(\color{blue}{e^{\log \left(\frac{1}{x}\right)}} \cdot 0.083333333333333\right)}^{1} \]
      4. add-sqr-sqrt0.0%

        \[\leadsto {\left(e^{\color{blue}{\sqrt{\log \left(\frac{1}{x}\right)} \cdot \sqrt{\log \left(\frac{1}{x}\right)}}} \cdot 0.083333333333333\right)}^{1} \]
      5. sqrt-unprod10.5%

        \[\leadsto {\left(e^{\color{blue}{\sqrt{\log \left(\frac{1}{x}\right) \cdot \log \left(\frac{1}{x}\right)}}} \cdot 0.083333333333333\right)}^{1} \]
      6. log-rec10.5%

        \[\leadsto {\left(e^{\sqrt{\color{blue}{\left(-\log x\right)} \cdot \log \left(\frac{1}{x}\right)}} \cdot 0.083333333333333\right)}^{1} \]
      7. log-rec10.5%

        \[\leadsto {\left(e^{\sqrt{\left(-\log x\right) \cdot \color{blue}{\left(-\log x\right)}}} \cdot 0.083333333333333\right)}^{1} \]
      8. sqr-neg10.5%

        \[\leadsto {\left(e^{\sqrt{\color{blue}{\log x \cdot \log x}}} \cdot 0.083333333333333\right)}^{1} \]
      9. sqrt-unprod10.5%

        \[\leadsto {\left(e^{\color{blue}{\sqrt{\log x} \cdot \sqrt{\log x}}} \cdot 0.083333333333333\right)}^{1} \]
      10. add-sqr-sqrt10.5%

        \[\leadsto {\left(e^{\color{blue}{\log x}} \cdot 0.083333333333333\right)}^{1} \]
      11. add-exp-log10.5%

        \[\leadsto {\left(\color{blue}{x} \cdot 0.083333333333333\right)}^{1} \]
    10. Applied egg-rr10.5%

      \[\leadsto \color{blue}{{\left(x \cdot 0.083333333333333\right)}^{1}} \]
    11. Step-by-step derivation
      1. unpow110.5%

        \[\leadsto \color{blue}{x \cdot 0.083333333333333} \]
    12. Simplified10.5%

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

Alternative 15: 27.5% accurate, 15.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 0.054:\\ \;\;\;\;\frac{0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot 0.083333333333333\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x 0.054) (/ 0.083333333333333 x) (* x 0.083333333333333)))
double code(double x, double y, double z) {
	double tmp;
	if (x <= 0.054) {
		tmp = 0.083333333333333 / x;
	} else {
		tmp = x * 0.083333333333333;
	}
	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 <= 0.054d0) then
        tmp = 0.083333333333333d0 / x
    else
        tmp = x * 0.083333333333333d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= 0.054) {
		tmp = 0.083333333333333 / x;
	} else {
		tmp = x * 0.083333333333333;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= 0.054:
		tmp = 0.083333333333333 / x
	else:
		tmp = x * 0.083333333333333
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= 0.054)
		tmp = Float64(0.083333333333333 / x);
	else
		tmp = Float64(x * 0.083333333333333);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= 0.054)
		tmp = 0.083333333333333 / x;
	else
		tmp = x * 0.083333333333333;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, 0.054], N[(0.083333333333333 / x), $MachinePrecision], N[(x * 0.083333333333333), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.054:\\
\;\;\;\;\frac{0.083333333333333}{x}\\

\mathbf{else}:\\
\;\;\;\;x \cdot 0.083333333333333\\


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

    1. Initial program 99.7%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \left(\color{blue}{\left(\left(x - 0.5\right) \cdot \log x + \left(-x\right)\right)} + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      2. associate-+l+99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0539999999999999994 < x

    1. Initial program 87.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. Step-by-step derivation
      1. sub-neg87.4%

        \[\leadsto \left(\color{blue}{\left(\left(x - 0.5\right) \cdot \log x + \left(-x\right)\right)} + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      2. associate-+l+87.4%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{0.083333333333333}}{x} \]
    7. Step-by-step derivation
      1. div-inv3.0%

        \[\leadsto \color{blue}{0.083333333333333 \cdot \frac{1}{x}} \]
    8. Applied egg-rr3.0%

      \[\leadsto \color{blue}{0.083333333333333 \cdot \frac{1}{x}} \]
    9. Step-by-step derivation
      1. pow13.0%

        \[\leadsto \color{blue}{{\left(0.083333333333333 \cdot \frac{1}{x}\right)}^{1}} \]
      2. *-commutative3.0%

        \[\leadsto {\color{blue}{\left(\frac{1}{x} \cdot 0.083333333333333\right)}}^{1} \]
      3. add-exp-log3.0%

        \[\leadsto {\left(\color{blue}{e^{\log \left(\frac{1}{x}\right)}} \cdot 0.083333333333333\right)}^{1} \]
      4. add-sqr-sqrt0.0%

        \[\leadsto {\left(e^{\color{blue}{\sqrt{\log \left(\frac{1}{x}\right)} \cdot \sqrt{\log \left(\frac{1}{x}\right)}}} \cdot 0.083333333333333\right)}^{1} \]
      5. sqrt-unprod10.5%

        \[\leadsto {\left(e^{\color{blue}{\sqrt{\log \left(\frac{1}{x}\right) \cdot \log \left(\frac{1}{x}\right)}}} \cdot 0.083333333333333\right)}^{1} \]
      6. log-rec10.5%

        \[\leadsto {\left(e^{\sqrt{\color{blue}{\left(-\log x\right)} \cdot \log \left(\frac{1}{x}\right)}} \cdot 0.083333333333333\right)}^{1} \]
      7. log-rec10.5%

        \[\leadsto {\left(e^{\sqrt{\left(-\log x\right) \cdot \color{blue}{\left(-\log x\right)}}} \cdot 0.083333333333333\right)}^{1} \]
      8. sqr-neg10.5%

        \[\leadsto {\left(e^{\sqrt{\color{blue}{\log x \cdot \log x}}} \cdot 0.083333333333333\right)}^{1} \]
      9. sqrt-unprod10.5%

        \[\leadsto {\left(e^{\color{blue}{\sqrt{\log x} \cdot \sqrt{\log x}}} \cdot 0.083333333333333\right)}^{1} \]
      10. add-sqr-sqrt10.5%

        \[\leadsto {\left(e^{\color{blue}{\log x}} \cdot 0.083333333333333\right)}^{1} \]
      11. add-exp-log10.5%

        \[\leadsto {\left(\color{blue}{x} \cdot 0.083333333333333\right)}^{1} \]
    10. Applied egg-rr10.5%

      \[\leadsto \color{blue}{{\left(x \cdot 0.083333333333333\right)}^{1}} \]
    11. Step-by-step derivation
      1. unpow110.5%

        \[\leadsto \color{blue}{x \cdot 0.083333333333333} \]
    12. Simplified10.5%

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

Alternative 16: 6.6% accurate, 41.0× speedup?

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

\\
x \cdot 0.083333333333333
\end{array}
Derivation
  1. Initial program 93.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. Step-by-step derivation
    1. sub-neg93.1%

      \[\leadsto \left(\color{blue}{\left(\left(x - 0.5\right) \cdot \log x + \left(-x\right)\right)} + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. associate-+l+93.1%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{0.083333333333333}}{x} \]
  7. Step-by-step derivation
    1. div-inv21.2%

      \[\leadsto \color{blue}{0.083333333333333 \cdot \frac{1}{x}} \]
  8. Applied egg-rr21.2%

    \[\leadsto \color{blue}{0.083333333333333 \cdot \frac{1}{x}} \]
  9. Step-by-step derivation
    1. pow121.2%

      \[\leadsto \color{blue}{{\left(0.083333333333333 \cdot \frac{1}{x}\right)}^{1}} \]
    2. *-commutative21.2%

      \[\leadsto {\color{blue}{\left(\frac{1}{x} \cdot 0.083333333333333\right)}}^{1} \]
    3. add-exp-log19.9%

      \[\leadsto {\left(\color{blue}{e^{\log \left(\frac{1}{x}\right)}} \cdot 0.083333333333333\right)}^{1} \]
    4. add-sqr-sqrt18.1%

      \[\leadsto {\left(e^{\color{blue}{\sqrt{\log \left(\frac{1}{x}\right)} \cdot \sqrt{\log \left(\frac{1}{x}\right)}}} \cdot 0.083333333333333\right)}^{1} \]
    5. sqrt-unprod24.0%

      \[\leadsto {\left(e^{\color{blue}{\sqrt{\log \left(\frac{1}{x}\right) \cdot \log \left(\frac{1}{x}\right)}}} \cdot 0.083333333333333\right)}^{1} \]
    6. log-rec24.0%

      \[\leadsto {\left(e^{\sqrt{\color{blue}{\left(-\log x\right)} \cdot \log \left(\frac{1}{x}\right)}} \cdot 0.083333333333333\right)}^{1} \]
    7. log-rec24.0%

      \[\leadsto {\left(e^{\sqrt{\left(-\log x\right) \cdot \color{blue}{\left(-\log x\right)}}} \cdot 0.083333333333333\right)}^{1} \]
    8. sqr-neg24.0%

      \[\leadsto {\left(e^{\sqrt{\color{blue}{\log x \cdot \log x}}} \cdot 0.083333333333333\right)}^{1} \]
    9. sqrt-unprod5.6%

      \[\leadsto {\left(e^{\color{blue}{\sqrt{\log x} \cdot \sqrt{\log x}}} \cdot 0.083333333333333\right)}^{1} \]
    10. add-sqr-sqrt7.0%

      \[\leadsto {\left(e^{\color{blue}{\log x}} \cdot 0.083333333333333\right)}^{1} \]
    11. add-exp-log7.0%

      \[\leadsto {\left(\color{blue}{x} \cdot 0.083333333333333\right)}^{1} \]
  10. Applied egg-rr7.0%

    \[\leadsto \color{blue}{{\left(x \cdot 0.083333333333333\right)}^{1}} \]
  11. Step-by-step derivation
    1. unpow17.0%

      \[\leadsto \color{blue}{x \cdot 0.083333333333333} \]
  12. Simplified7.0%

    \[\leadsto \color{blue}{x \cdot 0.083333333333333} \]
  13. Add Preprocessing

Developer Target 1: 98.4% accurate, 1.0× 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 2024146 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
  :precision binary64

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

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