Average Error: 6.1 → 4.2
Time: 6.1s
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}\;x \leq 2690112.159335637:\\ \;\;\;\;\sqrt{0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)} \cdot \sqrt{0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)} + \frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x - 0.5\right) \cdot \log \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) + \left(\left(x - 0.5\right) \cdot \log \left({x}^{0.3333333333333333}\right) + \left(0.91893853320467 - x\right)\right)\right) + \left(\left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x} - 0.0027777777777778 \cdot \frac{z}{x}\right)\\ \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}\;x \leq 2690112.159335637:\\
\;\;\;\;\sqrt{0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)} \cdot \sqrt{0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)} + \frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 0.083333333333333}{x}\\

\mathbf{else}:\\
\;\;\;\;\left(\left(x - 0.5\right) \cdot \log \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) + \left(\left(x - 0.5\right) \cdot \log \left({x}^{0.3333333333333333}\right) + \left(0.91893853320467 - x\right)\right)\right) + \left(\left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x} - 0.0027777777777778 \cdot \frac{z}{x}\right)\\

\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 (<= x 2690112.159335637)
   (+
    (*
     (sqrt (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)))
     (sqrt (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
    (/
     (+
      (* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))
      0.083333333333333)
     x))
   (+
    (+
     (* (- x 0.5) (log (* (cbrt x) (cbrt x))))
     (+ (* (- x 0.5) (log (pow x 0.3333333333333333))) (- 0.91893853320467 x)))
    (-
     (* (+ y 0.0007936500793651) (/ (* z z) x))
     (* 0.0027777777777778 (/ z 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);
}
double code(double x, double y, double z) {
	double tmp;
	if (x <= 2690112.159335637) {
		tmp = (sqrt(0.91893853320467 + ((log(x) * (x - 0.5)) - x)) * sqrt(0.91893853320467 + ((log(x) * (x - 0.5)) - x))) + (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x);
	} else {
		tmp = (((x - 0.5) * log(cbrt(x) * cbrt(x))) + (((x - 0.5) * log(pow(x, 0.3333333333333333))) + (0.91893853320467 - x))) + (((y + 0.0007936500793651) * ((z * z) / x)) - (0.0027777777777778 * (z / 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.1
Target1.3
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 x < 2690112.159335637

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

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

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

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

    if 2690112.159335637 < x

    1. Initial program 10.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. Using strategy rm
    3. Applied add-cube-cbrt_binary6410.5

      \[\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_binary6410.6

      \[\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-rgt-in_binary6410.6

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

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

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

      \[\leadsto \left(\log \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(x - 0.5\right) + \color{blue}{\left(\left(x - 0.5\right) \cdot \log \left(\sqrt[3]{x}\right) + \left(0.91893853320467 - x\right)\right)}\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\]
    9. Using strategy rm
    10. Applied pow1/3_binary6410.5

      \[\leadsto \left(\log \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(x - 0.5\right) + \left(\left(x - 0.5\right) \cdot \log \color{blue}{\left({x}^{0.3333333333333333}\right)} + \left(0.91893853320467 - x\right)\right)\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\]
    11. Taylor expanded around inf 10.6

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2690112.159335637:\\ \;\;\;\;\sqrt{0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)} \cdot \sqrt{0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)} + \frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x - 0.5\right) \cdot \log \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) + \left(\left(x - 0.5\right) \cdot \log \left({x}^{0.3333333333333333}\right) + \left(0.91893853320467 - x\right)\right)\right) + \left(\left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x} - 0.0027777777777778 \cdot \frac{z}{x}\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020253 
(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)))