Average Error: 5.9 → 5.9
Time: 30.3s
Precision: 64
\[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.9189385332046700050057097541866824030876\right) + \frac{\left(\left(y + 7.936500793651000149400709382518925849581 \cdot 10^{-4}\right) \cdot z - 0.002777777777777800001512975569539776188321\right) \cdot z + 0.08333333333333299564049667651488562114537}{x}\]
\[\left(\left(0.9189385332046700050057097541866824030876 - x\right) + \left(x - 0.5\right) \cdot \log x\right) + \frac{0.08333333333333299564049667651488562114537 + \left(\left(z \cdot z\right) \cdot \left(y + 7.936500793651000149400709382518925849581 \cdot 10^{-4}\right) - 0.002777777777777800001512975569539776188321 \cdot z\right)}{x}\]
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.9189385332046700050057097541866824030876\right) + \frac{\left(\left(y + 7.936500793651000149400709382518925849581 \cdot 10^{-4}\right) \cdot z - 0.002777777777777800001512975569539776188321\right) \cdot z + 0.08333333333333299564049667651488562114537}{x}
\left(\left(0.9189385332046700050057097541866824030876 - x\right) + \left(x - 0.5\right) \cdot \log x\right) + \frac{0.08333333333333299564049667651488562114537 + \left(\left(z \cdot z\right) \cdot \left(y + 7.936500793651000149400709382518925849581 \cdot 10^{-4}\right) - 0.002777777777777800001512975569539776188321 \cdot z\right)}{x}
double f(double x, double y, double z) {
        double r25275430 = x;
        double r25275431 = 0.5;
        double r25275432 = r25275430 - r25275431;
        double r25275433 = log(r25275430);
        double r25275434 = r25275432 * r25275433;
        double r25275435 = r25275434 - r25275430;
        double r25275436 = 0.91893853320467;
        double r25275437 = r25275435 + r25275436;
        double r25275438 = y;
        double r25275439 = 0.0007936500793651;
        double r25275440 = r25275438 + r25275439;
        double r25275441 = z;
        double r25275442 = r25275440 * r25275441;
        double r25275443 = 0.0027777777777778;
        double r25275444 = r25275442 - r25275443;
        double r25275445 = r25275444 * r25275441;
        double r25275446 = 0.083333333333333;
        double r25275447 = r25275445 + r25275446;
        double r25275448 = r25275447 / r25275430;
        double r25275449 = r25275437 + r25275448;
        return r25275449;
}

double f(double x, double y, double z) {
        double r25275450 = 0.91893853320467;
        double r25275451 = x;
        double r25275452 = r25275450 - r25275451;
        double r25275453 = 0.5;
        double r25275454 = r25275451 - r25275453;
        double r25275455 = log(r25275451);
        double r25275456 = r25275454 * r25275455;
        double r25275457 = r25275452 + r25275456;
        double r25275458 = 0.083333333333333;
        double r25275459 = z;
        double r25275460 = r25275459 * r25275459;
        double r25275461 = y;
        double r25275462 = 0.0007936500793651;
        double r25275463 = r25275461 + r25275462;
        double r25275464 = r25275460 * r25275463;
        double r25275465 = 0.0027777777777778;
        double r25275466 = r25275465 * r25275459;
        double r25275467 = r25275464 - r25275466;
        double r25275468 = r25275458 + r25275467;
        double r25275469 = r25275468 / r25275451;
        double r25275470 = r25275457 + r25275469;
        return r25275470;
}

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

Original5.9
Target1.3
Herbie5.9
\[\left(\left(\left(x - 0.5\right) \cdot \log x + \left(0.9189385332046700050057097541866824030876 - x\right)\right) + \frac{0.08333333333333299564049667651488562114537}{x}\right) + \frac{z}{x} \cdot \left(z \cdot \left(y + 7.936500793651000149400709382518925849581 \cdot 10^{-4}\right) - 0.002777777777777800001512975569539776188321\right)\]

Derivation

  1. Initial program 5.9

    \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.9189385332046700050057097541866824030876\right) + \frac{\left(\left(y + 7.936500793651000149400709382518925849581 \cdot 10^{-4}\right) \cdot z - 0.002777777777777800001512975569539776188321\right) \cdot z + 0.08333333333333299564049667651488562114537}{x}\]
  2. Using strategy rm
  3. Applied sub-neg5.9

    \[\leadsto \left(\color{blue}{\left(\left(x - 0.5\right) \cdot \log x + \left(-x\right)\right)} + 0.9189385332046700050057097541866824030876\right) + \frac{\left(\left(y + 7.936500793651000149400709382518925849581 \cdot 10^{-4}\right) \cdot z - 0.002777777777777800001512975569539776188321\right) \cdot z + 0.08333333333333299564049667651488562114537}{x}\]
  4. Applied associate-+l+5.9

    \[\leadsto \color{blue}{\left(\left(x - 0.5\right) \cdot \log x + \left(\left(-x\right) + 0.9189385332046700050057097541866824030876\right)\right)} + \frac{\left(\left(y + 7.936500793651000149400709382518925849581 \cdot 10^{-4}\right) \cdot z - 0.002777777777777800001512975569539776188321\right) \cdot z + 0.08333333333333299564049667651488562114537}{x}\]
  5. Simplified5.9

    \[\leadsto \left(\left(x - 0.5\right) \cdot \log x + \color{blue}{\left(0.9189385332046700050057097541866824030876 - x\right)}\right) + \frac{\left(\left(y + 7.936500793651000149400709382518925849581 \cdot 10^{-4}\right) \cdot z - 0.002777777777777800001512975569539776188321\right) \cdot z + 0.08333333333333299564049667651488562114537}{x}\]
  6. Taylor expanded around 0 5.9

    \[\leadsto \left(\left(x - 0.5\right) \cdot \log x + \left(0.9189385332046700050057097541866824030876 - x\right)\right) + \frac{\color{blue}{\left(\left({z}^{2} \cdot y + 7.936500793651000149400709382518925849581 \cdot 10^{-4} \cdot {z}^{2}\right) - 0.002777777777777800001512975569539776188321 \cdot z\right)} + 0.08333333333333299564049667651488562114537}{x}\]
  7. Simplified5.9

    \[\leadsto \left(\left(x - 0.5\right) \cdot \log x + \left(0.9189385332046700050057097541866824030876 - x\right)\right) + \frac{\color{blue}{\left(\left(z \cdot z\right) \cdot \left(7.936500793651000149400709382518925849581 \cdot 10^{-4} + y\right) - z \cdot 0.002777777777777800001512975569539776188321\right)} + 0.08333333333333299564049667651488562114537}{x}\]
  8. Final simplification5.9

    \[\leadsto \left(\left(0.9189385332046700050057097541866824030876 - x\right) + \left(x - 0.5\right) \cdot \log x\right) + \frac{0.08333333333333299564049667651488562114537 + \left(\left(z \cdot z\right) \cdot \left(y + 7.936500793651000149400709382518925849581 \cdot 10^{-4}\right) - 0.002777777777777800001512975569539776188321 \cdot z\right)}{x}\]

Reproduce

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

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