Average Error: 5.8 → 1.3
Time: 2.3m
Precision: 64
Internal precision: 128
\[\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 \le 6163318119635.77:\\ \;\;\;\;{\left(\sqrt[3]{\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467}\right)}^3 + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(x - 0.5\right) \cdot \log x\right) - \left(\left(x - \frac{y \cdot z}{\frac{x}{z}}\right) + \frac{z}{x} \cdot \left(0.0027777777777778 - 0.0007936500793651 \cdot z\right)\right)\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original5.8
Comparison1.3
Herbie1.3
\[ \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 < 6163318119635.77

    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-cube-cbrt 0.2

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

    if 6163318119635.77 < x

    1. Initial program 10.0

      \[\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. Applied taylor 10.1

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\left(\frac{y \cdot {z}^2}{x} + 0.0007936500793651 \cdot \frac{{z}^2}{x}\right) - 0.0027777777777778 \cdot \frac{z}{x}\right)\]
    3. Taylor expanded around inf 10.1

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\left(\left(\frac{y \cdot {z}^2}{x} + 0.0007936500793651 \cdot \frac{{z}^2}{x}\right) - 0.0027777777777778 \cdot \frac{z}{x}\right)}\]
    4. Applied simplify 2.1

      \[\leadsto \color{blue}{\left(0.91893853320467 + \left(x - 0.5\right) \cdot \log x\right) - \left(\left(x - \frac{y \cdot z}{\frac{x}{z}}\right) + \frac{z}{x} \cdot \left(0.0027777777777778 - 0.0007936500793651 \cdot z\right)\right)}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions

Runtime

Time bar (total: 2.3m) Debug log

Please include this information when filing a bug report:

herbie --seed '#(2420262585 3535420843 887897025 2320449328 1192482199 1130526203)'
(FPCore (x y z)
  :name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"

  :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)))