Average Error: 6.0 → 4.2
Time: 5.6s
Precision: binary64
\[\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}\]
\[\begin{array}{l} \mathbf{if}\;z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \leq -2.4306357748103342 \cdot 10^{+281} \lor \neg \left(z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \leq 1.0023160839442395 \cdot 10^{+251}\right):\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x} - 0.0027777777777778 \cdot \frac{z}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log \left(\sqrt[3]{x}\right) \cdot \left(x \cdot 3 - 1.5\right) - x\right)\right) + \frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 0.083333333333333}{x}\\ \end{array}\]
\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}
\begin{array}{l}
\mathbf{if}\;z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \leq -2.4306357748103342 \cdot 10^{+281} \lor \neg \left(z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \leq 1.0023160839442395 \cdot 10^{+251}\right):\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x} - 0.0027777777777778 \cdot \frac{z}{x}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log \left(\sqrt[3]{x}\right) \cdot \left(x \cdot 3 - 1.5\right) - x\right)\right) + \frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 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)))
(FPCore (x y z)
 :precision binary64
 (if (or (<=
          (* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))
          -2.4306357748103342e+281)
         (not
          (<=
           (* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))
           1.0023160839442395e+251)))
   (+
    (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
    (-
     (* (+ y 0.0007936500793651) (/ (* z z) x))
     (* 0.0027777777777778 (/ z x))))
   (+
    (+ 0.91893853320467 (- (* (log (cbrt x)) (- (* x 3.0) 1.5)) x))
    (/
     (+
      (* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))
      0.083333333333333)
     x))))
double code(double x, double y, double z) {
	return ((double) (((double) (((double) (((double) (((double) (x - 0.5)) * ((double) log(x)))) - x)) + 0.91893853320467)) + (((double) (((double) (((double) (((double) (((double) (y + 0.0007936500793651)) * z)) - 0.0027777777777778)) * z)) + 0.083333333333333)) / x)));
}
double code(double x, double y, double z) {
	double tmp;
	if (((((double) (z * ((double) (((double) (((double) (y + 0.0007936500793651)) * z)) - 0.0027777777777778)))) <= -2.4306357748103342e+281) || !(((double) (z * ((double) (((double) (((double) (y + 0.0007936500793651)) * z)) - 0.0027777777777778)))) <= 1.0023160839442395e+251))) {
		tmp = ((double) (((double) (((double) (((double) (((double) (x - 0.5)) * ((double) log(x)))) - x)) + 0.91893853320467)) + ((double) (((double) (((double) (y + 0.0007936500793651)) * (((double) (z * z)) / x))) - ((double) (0.0027777777777778 * (z / x)))))));
	} else {
		tmp = ((double) (((double) (0.91893853320467 + ((double) (((double) (((double) log(((double) cbrt(x)))) * ((double) (((double) (x * 3.0)) - 1.5)))) - x)))) + (((double) (((double) (z * ((double) (((double) (((double) (y + 0.0007936500793651)) * z)) - 0.0027777777777778)))) + 0.083333333333333)) / x)));
	}
	return tmp;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original6.0
Target1.2
Herbie4.2
\[\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)\]

Derivation

  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 (*.f64 (+.f64 y 0.0007936500793651) z) 0.0027777777777778) z) < -2.4306357748103342e281 or 1.0023160839442395e251 < (*.f64 (-.f64 (*.f64 (+.f64 y 0.0007936500793651) z) 0.0027777777777778) z)

    1. Initial program 47.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. Taylor expanded around inf 47.8

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\left(\left(0.0007936500793651 \cdot \frac{{z}^{2}}{x} + \frac{{z}^{2} \cdot y}{x}\right) - 0.0027777777777778 \cdot \frac{z}{x}\right)}\]
    3. Simplified31.8

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

    if -2.4306357748103342e281 < (*.f64 (-.f64 (*.f64 (+.f64 y 0.0007936500793651) z) 0.0027777777777778) z) < 1.0023160839442395e251

    1. Initial program 0.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. Using strategy rm
    3. Applied add-cube-cbrt_binary640.2

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

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \color{blue}{\left(\log \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) + \log \left(\sqrt[3]{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}\]
    5. Applied distribute-lft-in_binary640.3

      \[\leadsto \left(\left(\color{blue}{\left(\left(x - 0.5\right) \cdot \log \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) + \left(x - 0.5\right) \cdot \log \left(\sqrt[3]{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}\]
    6. Simplified0.3

      \[\leadsto \left(\left(\left(\color{blue}{\left(x - 0.5\right) \cdot \left(2 \cdot \log \left(\sqrt[3]{x}\right)\right)} + \left(x - 0.5\right) \cdot \log \left(\sqrt[3]{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}\]
    7. Taylor expanded around 0 0.3

      \[\leadsto \left(\left(\color{blue}{\left(3 \cdot \left(x \cdot \log \left({x}^{0.3333333333333333}\right)\right) - 1.5 \cdot \log \left({x}^{0.3333333333333333}\right)\right)} - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\]
    8. Simplified0.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \leq -2.4306357748103342 \cdot 10^{+281} \lor \neg \left(z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \leq 1.0023160839442395 \cdot 10^{+251}\right):\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x} - 0.0027777777777778 \cdot \frac{z}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log \left(\sqrt[3]{x}\right) \cdot \left(x \cdot 3 - 1.5\right) - x\right)\right) + \frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 0.083333333333333}{x}\\ \end{array}\]

Reproduce

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

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

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