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

Percentage Accurate: 93.5% → 97.6%
Time: 12.4s
Alternatives: 12
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 12 alternatives:

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

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

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

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

    \[\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 x around 0 98.2%

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \color{blue}{\frac{z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778}{x}} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
  5. 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 \frac{z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778}{x} + \color{blue}{\frac{0.083333333333333}{x}}\right) \]
  6. Add Preprocessing

Alternative 2: 98.2% accurate, 1.0× speedup?

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

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

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

    \[\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 x around 0 98.2%

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

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

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

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \frac{\color{blue}{\left(y + 0.0007936500793651\right) \cdot z}}{x} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
    3. associate-/l*98.1%

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

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \color{blue}{\left(\left(y + 0.0007936500793651\right) \cdot \frac{z}{x}\right)} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
  8. 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(\left(y + 0.0007936500793651\right) \cdot \frac{z}{x}\right) + \color{blue}{\frac{0.083333333333333}{x}}\right) \]
  9. Final simplification98.2%

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

Alternative 3: 92.3% accurate, 1.0× speedup?

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

    \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
  2. Add Preprocessing
  3. Taylor expanded in x around inf 95.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(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
  4. Step-by-step derivation
    1. mul-1-neg95.0%

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

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

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

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

    \[\leadsto \left(\left(\color{blue}{x \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} \]
  6. Final simplification95.0%

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

Alternative 4: 83.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 9.5 \cdot 10^{-5}:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + \frac{y}{y \cdot 1260.0011340009878}\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 9.5e-5)
   (/
    (+
     0.083333333333333
     (* z (- (* z (+ y (/ y (* y 1260.0011340009878)))) 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 <= 9.5e-5) {
		tmp = (0.083333333333333 + (z * ((z * (y + (y / (y * 1260.0011340009878)))) - 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 <= 9.5d-5) then
        tmp = (0.083333333333333d0 + (z * ((z * (y + (y / (y * 1260.0011340009878d0)))) - 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 <= 9.5e-5) {
		tmp = (0.083333333333333 + (z * ((z * (y + (y / (y * 1260.0011340009878)))) - 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 <= 9.5e-5:
		tmp = (0.083333333333333 + (z * ((z * (y + (y / (y * 1260.0011340009878)))) - 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 <= 9.5e-5)
		tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + Float64(y / Float64(y * 1260.0011340009878)))) - 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 <= 9.5e-5)
		tmp = (0.083333333333333 + (z * ((z * (y + (y / (y * 1260.0011340009878)))) - 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, 9.5e-5], N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + N[(y / N[(y * 1260.0011340009878), $MachinePrecision]), $MachinePrecision]), $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 9.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + \frac{y}{y \cdot 1260.0011340009878}\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 < 9.5000000000000005e-5

    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.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 99.7%

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

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

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

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

        \[\leadsto \frac{0.083333333333333 + z \cdot \left(z \cdot \color{blue}{\left(y \cdot 1 + y \cdot \frac{0.0007936500793651}{y}\right)} - 0.0027777777777778\right)}{x} \]
      2. *-rgt-identity99.7%

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

        \[\leadsto \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + y \cdot \color{blue}{\frac{1}{\frac{y}{0.0007936500793651}}}\right) - 0.0027777777777778\right)}{x} \]
      4. un-div-inv99.7%

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

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

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

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

    if 9.5000000000000005e-5 < x

    1. Initial program 91.7%

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

      \[\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 5: 83.7% accurate, 1.1× speedup?

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

    1. Initial program 99.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. Step-by-step derivation
      1. sub-neg99.2%

        \[\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.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-define99.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-neg99.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-eval99.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. +-commutative99.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-neg99.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. *-commutative99.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-define99.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-neg99.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-eval99.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. Simplified99.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 91.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 y around inf 91.6%

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

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

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

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

        \[\leadsto \frac{0.083333333333333 + z \cdot \left(z \cdot \color{blue}{\left(y \cdot 1 + y \cdot \frac{0.0007936500793651}{y}\right)} - 0.0027777777777778\right)}{x} \]
      2. *-rgt-identity91.6%

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

        \[\leadsto \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + y \cdot \color{blue}{\frac{1}{\frac{y}{0.0007936500793651}}}\right) - 0.0027777777777778\right)}{x} \]
      4. un-div-inv91.6%

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

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

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

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

    if 5e64 < x

    1. Initial program 90.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-neg90.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+90.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-define90.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-neg90.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-eval90.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. +-commutative90.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-neg90.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. *-commutative90.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-define90.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-neg90.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-eval90.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. Simplified90.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 inf 79.3%

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

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

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

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

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

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

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

Alternative 6: 62.2% accurate, 5.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+25} \lor \neg \left(y \leq 3.4 \cdot 10^{-7}\right):\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot y - 0.0027777777777778\right)}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.00000000000000018e25 or 3.39999999999999974e-7 < y

    1. Initial program 97.5%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Step-by-step derivation
      1. sub-neg97.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+97.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-define97.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-neg97.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-eval97.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. +-commutative97.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-neg97.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. *-commutative97.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-define97.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-neg97.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-eval97.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. Simplified97.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 68.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 y around inf 68.0%

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

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

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

    if -2.00000000000000018e25 < y < 3.39999999999999974e-7

    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. Step-by-step derivation
      1. sub-neg94.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+94.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-define94.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-neg94.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-eval94.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. +-commutative94.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-neg94.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. *-commutative94.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-define94.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-neg94.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-eval94.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. Simplified94.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.1%

      \[\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 0 58.6%

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

        \[\leadsto \frac{0.083333333333333 + z \cdot \left(\color{blue}{z \cdot 0.0007936500793651} - 0.0027777777777778\right)}{x} \]
    8. Simplified58.6%

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

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

Alternative 7: 59.4% accurate, 6.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-44} \lor \neg \left(z \leq 1.8 \cdot 10^{-10}\right):\\
\;\;\;\;\frac{\left(0.0007936500793651 + y\right) \cdot \left(z \cdot z\right)}{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 < -1.54999999999999992e-44 or 1.8e-10 < z

    1. Initial program 92.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-neg92.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+92.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-define92.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-neg92.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-eval92.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. +-commutative92.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-neg92.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. *-commutative92.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-define92.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-neg92.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-eval92.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. Simplified92.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 76.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 inf 73.4%

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

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

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

    if -1.54999999999999992e-44 < z < 1.8e-10

    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 47.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 z around 0 45.2%

      \[\leadsto \frac{\color{blue}{0.083333333333333 + -0.0027777777777778 \cdot z}}{x} \]
    7. Step-by-step derivation
      1. +-commutative45.2%

        \[\leadsto \frac{\color{blue}{-0.0027777777777778 \cdot z + 0.083333333333333}}{x} \]
    8. Simplified45.2%

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

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

Alternative 8: 46.1% accurate, 7.2× speedup?

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

    1. Initial program 91.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-neg91.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+91.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-define91.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-neg91.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-eval91.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. +-commutative91.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-neg91.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. *-commutative91.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-define91.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-neg91.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-eval91.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. Simplified91.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 78.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 inf 77.1%

      \[\leadsto \color{blue}{\frac{{z}^{2} \cdot \left(0.0007936500793651 + y\right)}{x}} \]
    7. Taylor expanded in y around 0 56.5%

      \[\leadsto \color{blue}{0.0007936500793651 \cdot \frac{{z}^{2}}{x}} \]
    8. Step-by-step derivation
      1. associate-*r/57.1%

        \[\leadsto \color{blue}{\frac{0.0007936500793651 \cdot {z}^{2}}{x}} \]
      2. *-commutative57.1%

        \[\leadsto \frac{\color{blue}{{z}^{2} \cdot 0.0007936500793651}}{x} \]
      3. associate-/l*57.1%

        \[\leadsto \color{blue}{{z}^{2} \cdot \frac{0.0007936500793651}{x}} \]
    9. Simplified57.1%

      \[\leadsto \color{blue}{{z}^{2} \cdot \frac{0.0007936500793651}{x}} \]
    10. Step-by-step derivation
      1. unpow277.1%

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

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

    if -12 < z < 5.5000000000000001e45

    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.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.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.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 50.5%

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

      \[\leadsto \frac{\color{blue}{0.083333333333333 + -0.0027777777777778 \cdot z}}{x} \]
    7. Step-by-step derivation
      1. +-commutative40.6%

        \[\leadsto \frac{\color{blue}{-0.0027777777777778 \cdot z + 0.083333333333333}}{x} \]
    8. Simplified40.6%

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

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

Alternative 9: 47.0% accurate, 7.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -10.5 \lor \neg \left(z \leq 10.2\right):\\
\;\;\;\;\left(z \cdot z\right) \cdot \frac{0.0007936500793651}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -10.5 or 10.199999999999999 < z

    1. Initial program 92.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-neg92.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+92.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-define92.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-neg92.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-eval92.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. +-commutative92.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-neg92.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. *-commutative92.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-define92.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-neg92.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-eval92.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. Simplified92.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 77.5%

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

      \[\leadsto \color{blue}{\frac{{z}^{2} \cdot \left(0.0007936500793651 + y\right)}{x}} \]
    7. Taylor expanded in y around 0 52.7%

      \[\leadsto \color{blue}{0.0007936500793651 \cdot \frac{{z}^{2}}{x}} \]
    8. Step-by-step derivation
      1. associate-*r/53.3%

        \[\leadsto \color{blue}{\frac{0.0007936500793651 \cdot {z}^{2}}{x}} \]
      2. *-commutative53.3%

        \[\leadsto \frac{\color{blue}{{z}^{2} \cdot 0.0007936500793651}}{x} \]
      3. associate-/l*53.4%

        \[\leadsto \color{blue}{{z}^{2} \cdot \frac{0.0007936500793651}{x}} \]
    9. Simplified53.4%

      \[\leadsto \color{blue}{{z}^{2} \cdot \frac{0.0007936500793651}{x}} \]
    10. Step-by-step derivation
      1. unpow276.1%

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

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

    if -10.5 < z < 10.199999999999999

    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 48.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 42.8%

      \[\leadsto \frac{\color{blue}{0.083333333333333}}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification48.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -10.5 \lor \neg \left(z \leq 10.2\right):\\ \;\;\;\;\left(z \cdot z\right) \cdot \frac{0.0007936500793651}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.083333333333333}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 63.1% accurate, 7.2× speedup?

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

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

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

      \[\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+95.8%

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

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

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

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

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

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

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

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

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

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

    \[\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.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 y around inf 63.4%

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

      \[\leadsto \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y \cdot \left(1 + \color{blue}{\frac{0.0007936500793651 \cdot 1}{y}}\right)\right) - 0.0027777777777778\right)}{x} \]
    2. metadata-eval63.4%

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

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

      \[\leadsto \frac{0.083333333333333 + z \cdot \left(z \cdot \color{blue}{\left(y \cdot 1 + y \cdot \frac{0.0007936500793651}{y}\right)} - 0.0027777777777778\right)}{x} \]
    2. *-rgt-identity63.4%

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

      \[\leadsto \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + y \cdot \color{blue}{\frac{1}{\frac{y}{0.0007936500793651}}}\right) - 0.0027777777777778\right)}{x} \]
    4. un-div-inv63.4%

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

      \[\leadsto \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + \frac{y}{\color{blue}{y \cdot \frac{1}{0.0007936500793651}}}\right) - 0.0027777777777778\right)}{x} \]
    6. metadata-eval63.4%

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

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

Alternative 11: 63.1% 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 95.8%

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

      \[\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+95.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 24.1% accurate, 41.0× speedup?

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

\\
\frac{0.083333333333333}{x}
\end{array}
Derivation
  1. Initial program 95.8%

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

      \[\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+95.8%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{0.083333333333333}}{x} \]
  7. Add Preprocessing

Developer Target 1: 98.5% 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 2024145 
(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)))