Average Error: 6.4 → 0.4
Time: 15.4s
Precision: binary64
Cost: 20928
\[\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} \]
\[\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right) + \left(\frac{z}{x} \cdot \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right) + \left(\frac{0.083333333333333}{x} + \frac{z}{\frac{x}{z}} \cdot y\right)\right) \]
(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
 (+
  (fma (+ x -0.5) (log x) (- 0.91893853320467 x))
  (+
   (* (/ z x) (fma z 0.0007936500793651 -0.0027777777777778))
   (+ (/ 0.083333333333333 x) (* (/ z (/ x z)) y)))))
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) {
	return fma((x + -0.5), log(x), (0.91893853320467 - x)) + (((z / x) * fma(z, 0.0007936500793651, -0.0027777777777778)) + ((0.083333333333333 / x) + ((z / (x / z)) * y)));
}
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 code(x, y, z)
	return Float64(fma(Float64(x + -0.5), log(x), Float64(0.91893853320467 - x)) + Float64(Float64(Float64(z / x) * fma(z, 0.0007936500793651, -0.0027777777777778)) + Float64(Float64(0.083333333333333 / x) + Float64(Float64(z / Float64(x / z)) * y))))
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]
code[x_, y_, z_] := N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(z / x), $MachinePrecision] * N[(z * 0.0007936500793651 + -0.0027777777777778), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\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}
\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right) + \left(\frac{z}{x} \cdot \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right) + \left(\frac{0.083333333333333}{x} + \frac{z}{\frac{x}{z}} \cdot y\right)\right)

Error

Target

Original6.4
Target1.2
Herbie0.4
\[\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. Initial program 6.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. Simplified6.3

    \[\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}} \]
    Proof
    (+.f64 (fma.f64 (+.f64 x -1/2) (log.f64 x) (-.f64 91893853320467/100000000000000 x)) (/.f64 (fma.f64 z (fma.f64 (+.f64 y 7936500793651/10000000000000000) z -13888888888889/5000000000000000) 83333333333333/1000000000000000) x)): 0 points increase in error, 0 points decrease in error
    (+.f64 (fma.f64 (+.f64 x (Rewrite<= metadata-eval (neg.f64 1/2))) (log.f64 x) (-.f64 91893853320467/100000000000000 x)) (/.f64 (fma.f64 z (fma.f64 (+.f64 y 7936500793651/10000000000000000) z -13888888888889/5000000000000000) 83333333333333/1000000000000000) x)): 0 points increase in error, 0 points decrease in error
    (+.f64 (fma.f64 (Rewrite<= sub-neg_binary64 (-.f64 x 1/2)) (log.f64 x) (-.f64 91893853320467/100000000000000 x)) (/.f64 (fma.f64 z (fma.f64 (+.f64 y 7936500793651/10000000000000000) z -13888888888889/5000000000000000) 83333333333333/1000000000000000) x)): 0 points increase in error, 0 points decrease in error
    (+.f64 (fma.f64 (-.f64 x 1/2) (log.f64 x) (Rewrite<= unsub-neg_binary64 (+.f64 91893853320467/100000000000000 (neg.f64 x)))) (/.f64 (fma.f64 z (fma.f64 (+.f64 y 7936500793651/10000000000000000) z -13888888888889/5000000000000000) 83333333333333/1000000000000000) x)): 0 points increase in error, 0 points decrease in error
    (+.f64 (fma.f64 (-.f64 x 1/2) (log.f64 x) (Rewrite<= +-commutative_binary64 (+.f64 (neg.f64 x) 91893853320467/100000000000000))) (/.f64 (fma.f64 z (fma.f64 (+.f64 y 7936500793651/10000000000000000) z -13888888888889/5000000000000000) 83333333333333/1000000000000000) x)): 0 points increase in error, 0 points decrease in error
    (+.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (-.f64 x 1/2) (log.f64 x)) (+.f64 (neg.f64 x) 91893853320467/100000000000000))) (/.f64 (fma.f64 z (fma.f64 (+.f64 y 7936500793651/10000000000000000) z -13888888888889/5000000000000000) 83333333333333/1000000000000000) x)): 22 points increase in error, 6 points decrease in error
    (+.f64 (+.f64 (*.f64 (-.f64 x 1/2) (log.f64 x)) (Rewrite=> +-commutative_binary64 (+.f64 91893853320467/100000000000000 (neg.f64 x)))) (/.f64 (fma.f64 z (fma.f64 (+.f64 y 7936500793651/10000000000000000) z -13888888888889/5000000000000000) 83333333333333/1000000000000000) x)): 0 points increase in error, 0 points decrease in error
    (+.f64 (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 (*.f64 (-.f64 x 1/2) (log.f64 x)) 91893853320467/100000000000000) (neg.f64 x))) (/.f64 (fma.f64 z (fma.f64 (+.f64 y 7936500793651/10000000000000000) z -13888888888889/5000000000000000) 83333333333333/1000000000000000) x)): 0 points increase in error, 0 points decrease in error
    (+.f64 (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 91893853320467/100000000000000 (*.f64 (-.f64 x 1/2) (log.f64 x)))) (neg.f64 x)) (/.f64 (fma.f64 z (fma.f64 (+.f64 y 7936500793651/10000000000000000) z -13888888888889/5000000000000000) 83333333333333/1000000000000000) x)): 0 points increase in error, 0 points decrease in error
    (+.f64 (+.f64 (+.f64 91893853320467/100000000000000 (*.f64 (-.f64 x 1/2) (log.f64 x))) (neg.f64 x)) (/.f64 (fma.f64 z (fma.f64 (+.f64 y 7936500793651/10000000000000000) z (Rewrite<= metadata-eval (neg.f64 13888888888889/5000000000000000))) 83333333333333/1000000000000000) x)): 0 points increase in error, 0 points decrease in error
    (+.f64 (+.f64 (+.f64 91893853320467/100000000000000 (*.f64 (-.f64 x 1/2) (log.f64 x))) (neg.f64 x)) (/.f64 (fma.f64 z (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000)) 83333333333333/1000000000000000) x)): 0 points increase in error, 0 points decrease in error
    (+.f64 (+.f64 (+.f64 91893853320467/100000000000000 (*.f64 (-.f64 x 1/2) (log.f64 x))) (neg.f64 x)) (/.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 z (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000)) 83333333333333/1000000000000000)) x)): 0 points increase in error, 0 points decrease in error
    (+.f64 (+.f64 (+.f64 91893853320467/100000000000000 (*.f64 (-.f64 x 1/2) (log.f64 x))) (neg.f64 x)) (/.f64 (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z)) 83333333333333/1000000000000000) x)): 0 points increase in error, 0 points decrease in error
    (+.f64 (Rewrite<= associate-+r+_binary64 (+.f64 91893853320467/100000000000000 (+.f64 (*.f64 (-.f64 x 1/2) (log.f64 x)) (neg.f64 x)))) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x)): 0 points increase in error, 0 points decrease in error
    (+.f64 (+.f64 91893853320467/100000000000000 (Rewrite<= sub-neg_binary64 (-.f64 (*.f64 (-.f64 x 1/2) (log.f64 x)) x))) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x)): 0 points increase in error, 0 points decrease in error
    (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 (-.f64 (*.f64 (-.f64 x 1/2) (log.f64 x)) x) 91893853320467/100000000000000)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x)): 0 points increase in error, 0 points decrease in error
  3. Taylor expanded in y around 0 6.4

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

    \[\leadsto \mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right) + \color{blue}{\left(\frac{z}{x} \cdot \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right) + \left(\frac{0.083333333333333}{x} + \frac{z}{\frac{x}{z}} \cdot y\right)\right)} \]
    Proof
    (+.f64 (*.f64 (/.f64 z x) (fma.f64 z 7936500793651/10000000000000000 -13888888888889/5000000000000000)) (+.f64 (/.f64 83333333333333/1000000000000000 x) (*.f64 (/.f64 z (/.f64 x z)) y))): 0 points increase in error, 0 points decrease in error
    (+.f64 (*.f64 (/.f64 z x) (fma.f64 z 7936500793651/10000000000000000 (Rewrite<= metadata-eval (neg.f64 13888888888889/5000000000000000)))) (+.f64 (/.f64 83333333333333/1000000000000000 x) (*.f64 (/.f64 z (/.f64 x z)) y))): 0 points increase in error, 0 points decrease in error
    (+.f64 (*.f64 (/.f64 z x) (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 z 7936500793651/10000000000000000) 13888888888889/5000000000000000))) (+.f64 (/.f64 83333333333333/1000000000000000 x) (*.f64 (/.f64 z (/.f64 x z)) y))): 0 points increase in error, 0 points decrease in error
    (+.f64 (*.f64 (/.f64 z x) (-.f64 (Rewrite<= *-commutative_binary64 (*.f64 7936500793651/10000000000000000 z)) 13888888888889/5000000000000000)) (+.f64 (/.f64 83333333333333/1000000000000000 x) (*.f64 (/.f64 z (/.f64 x z)) y))): 0 points increase in error, 0 points decrease in error
    (+.f64 (Rewrite<= associate-/r/_binary64 (/.f64 z (/.f64 x (-.f64 (*.f64 7936500793651/10000000000000000 z) 13888888888889/5000000000000000)))) (+.f64 (/.f64 83333333333333/1000000000000000 x) (*.f64 (/.f64 z (/.f64 x z)) y))): 8 points increase in error, 10 points decrease in error
    (+.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 z (-.f64 (*.f64 7936500793651/10000000000000000 z) 13888888888889/5000000000000000)) x)) (+.f64 (/.f64 83333333333333/1000000000000000 x) (*.f64 (/.f64 z (/.f64 x z)) y))): 17 points increase in error, 5 points decrease in error
    (+.f64 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 (*.f64 7936500793651/10000000000000000 z) 13888888888889/5000000000000000) z)) x) (+.f64 (/.f64 83333333333333/1000000000000000 x) (*.f64 (/.f64 z (/.f64 x z)) y))): 0 points increase in error, 0 points decrease in error
    (+.f64 (/.f64 (*.f64 (-.f64 (*.f64 7936500793651/10000000000000000 z) 13888888888889/5000000000000000) z) x) (+.f64 (/.f64 (Rewrite<= metadata-eval (*.f64 83333333333333/1000000000000000 1)) x) (*.f64 (/.f64 z (/.f64 x z)) y))): 0 points increase in error, 0 points decrease in error
    (+.f64 (/.f64 (*.f64 (-.f64 (*.f64 7936500793651/10000000000000000 z) 13888888888889/5000000000000000) z) x) (+.f64 (Rewrite<= associate-*r/_binary64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x))) (*.f64 (/.f64 z (/.f64 x z)) y))): 22 points increase in error, 27 points decrease in error
    (+.f64 (/.f64 (*.f64 (-.f64 (*.f64 7936500793651/10000000000000000 z) 13888888888889/5000000000000000) z) x) (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (*.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 z z) x)) y))): 6 points increase in error, 6 points decrease in error
    (+.f64 (/.f64 (*.f64 (-.f64 (*.f64 7936500793651/10000000000000000 z) 13888888888889/5000000000000000) z) x) (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (*.f64 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 z 2)) x) y))): 0 points increase in error, 0 points decrease in error
    (+.f64 (/.f64 (*.f64 (-.f64 (*.f64 7936500793651/10000000000000000 z) 13888888888889/5000000000000000) z) x) (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (Rewrite<= associate-/r/_binary64 (/.f64 (pow.f64 z 2) (/.f64 x y))))): 30 points increase in error, 11 points decrease in error
    (+.f64 (/.f64 (*.f64 (-.f64 (*.f64 7936500793651/10000000000000000 z) 13888888888889/5000000000000000) z) x) (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (pow.f64 z 2) y) x)))): 15 points increase in error, 27 points decrease in error
    (+.f64 (/.f64 (*.f64 (-.f64 (*.f64 7936500793651/10000000000000000 z) 13888888888889/5000000000000000) z) x) (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 y (pow.f64 z 2))) x))): 0 points increase in error, 0 points decrease in error
    (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 (/.f64 (*.f64 (-.f64 (*.f64 7936500793651/10000000000000000 z) 13888888888889/5000000000000000) z) x) (*.f64 83333333333333/1000000000000000 (/.f64 1 x))) (/.f64 (*.f64 y (pow.f64 z 2)) x))): 0 points increase in error, 0 points decrease in error
    (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (/.f64 (*.f64 (-.f64 (*.f64 7936500793651/10000000000000000 z) 13888888888889/5000000000000000) z) x))) (/.f64 (*.f64 y (pow.f64 z 2)) x)): 0 points increase in error, 0 points decrease in error
    (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (*.f64 y (pow.f64 z 2)) x) (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (/.f64 (*.f64 (-.f64 (*.f64 7936500793651/10000000000000000 z) 13888888888889/5000000000000000) z) x)))): 0 points increase in error, 0 points decrease in error
  5. Final simplification0.4

    \[\leadsto \mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right) + \left(\frac{z}{x} \cdot \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right) + \left(\frac{0.083333333333333}{x} + \frac{z}{\frac{x}{z}} \cdot y\right)\right) \]

Alternatives

Alternative 1
Error1.7
Cost24008
\[\begin{array}{l} t_0 := 0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\ t_1 := t_0 + \frac{0.083333333333333 + z \cdot \left(-0.0027777777777778 + z \cdot \left(0.0007936500793651 + y\right)\right)}{x}\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{+224}:\\ \;\;\;\;t_0 + \frac{0.0007936500793651 + y}{\frac{\frac{x}{z}}{z}}\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+257}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0 + \left(\frac{0.083333333333333}{x} + \left(\frac{z}{x} \cdot -0.0027777777777778 + z \cdot \frac{z \cdot 0.0007936500793651}{x}\right)\right)\\ \end{array} \]
Alternative 2
Error0.5
Cost23752
\[\begin{array}{l} t_0 := 0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\ t_1 := t_0 + \frac{0.083333333333333 + z \cdot \left(-0.0027777777777778 + z \cdot \left(0.0007936500793651 + y\right)\right)}{x}\\ t_2 := t_0 + \frac{0.0007936500793651 + y}{\frac{\frac{x}{z}}{z}}\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{+224}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+305}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error5.5
Cost8904
\[\begin{array}{l} t_0 := z \cdot \left(-0.0027777777777778 + z \cdot \left(0.0007936500793651 + y\right)\right)\\ t_1 := 0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\ t_2 := t_1 + \left(0.0007936500793651 + y\right) \cdot \frac{z \cdot z}{x}\\ \mathbf{if}\;t_0 \leq -2 \cdot 10^{+35}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{-12}:\\ \;\;\;\;t_1 + 0.083333333333333 \cdot \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 4
Error1.4
Cost8904
\[\begin{array}{l} t_0 := z \cdot \left(-0.0027777777777778 + z \cdot \left(0.0007936500793651 + y\right)\right)\\ t_1 := 0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\ t_2 := t_1 + \frac{0.0007936500793651 + y}{\frac{\frac{x}{z}}{z}}\\ \mathbf{if}\;t_0 \leq -2 \cdot 10^{+35}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{-12}:\\ \;\;\;\;t_1 + 0.083333333333333 \cdot \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 5
Error0.5
Cost8520
\[\begin{array}{l} t_0 := \frac{z}{x} \cdot -0.0027777777777778\\ t_1 := 0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\ t_2 := t_1 + \left(\frac{0.083333333333333}{x} + \left(t_0 + z \cdot \frac{0.0007936500793651 + y}{\frac{x}{z}}\right)\right)\\ \mathbf{if}\;z \leq -3300:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-31}:\\ \;\;\;\;t_1 + \left(\left(t_0 + \frac{z \cdot \left(z \cdot y\right)}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 6
Error1.2
Cost8256
\[\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \left(\frac{0.083333333333333}{x} + \left(\frac{z}{x} \cdot -0.0027777777777778 + \frac{z}{x} \cdot \left(z \cdot \left(0.0007936500793651 + y\right)\right)\right)\right) \]
Alternative 7
Error6.2
Cost7748
\[\begin{array}{l} \mathbf{if}\;x \leq 6.5:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(-0.0027777777777778 + z \cdot \left(0.0007936500793651 + y\right)\right)}{x} + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \left(z \cdot z\right) \cdot \frac{y}{x}\\ \end{array} \]
Alternative 8
Error4.8
Cost7748
\[\begin{array}{l} \mathbf{if}\;x \leq 0.2:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(-0.0027777777777778 + z \cdot \left(0.0007936500793651 + y\right)\right)}{x} + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \frac{z \cdot z}{\frac{x}{0.0007936500793651 + y}}\\ \end{array} \]
Alternative 9
Error7.2
Cost7620
\[\begin{array}{l} \mathbf{if}\;x \leq 1.12 \cdot 10^{-7}:\\ \;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{0.083333333333333 + \left(0.0007936500793651 + y\right) \cdot \left(z \cdot z\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + 0.083333333333333 \cdot \frac{1}{x}\\ \end{array} \]
Alternative 10
Error6.7
Cost7620
\[\begin{array}{l} \mathbf{if}\;x \leq 4.2:\\ \;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{0.083333333333333 + \left(0.0007936500793651 + y\right) \cdot \left(z \cdot z\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \left(z \cdot z\right) \cdot \frac{y}{x}\\ \end{array} \]
Alternative 11
Error9.8
Cost7492
\[\begin{array}{l} \mathbf{if}\;x \leq 1.1 \cdot 10^{-25}:\\ \;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{0.083333333333333 + y \cdot \left(z \cdot z\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right)\\ \end{array} \]
Alternative 12
Error9.4
Cost7492
\[\begin{array}{l} \mathbf{if}\;x \leq 2.1 \cdot 10^{-8}:\\ \;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{0.083333333333333 + y \cdot \left(z \cdot z\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + 0.083333333333333 \cdot \frac{1}{x}\\ \end{array} \]
Alternative 13
Error12.2
Cost7232
\[\frac{0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) \]
Alternative 14
Error12.8
Cost7108
\[\begin{array}{l} \mathbf{if}\;x \leq 3:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right)\\ \end{array} \]
Alternative 15
Error13.1
Cost7104
\[\frac{0.083333333333333}{x} + \left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right) \]
Alternative 16
Error13.1
Cost6976
\[\frac{0.083333333333333}{x} + \left(x \cdot \log x - x\right) \]
Alternative 17
Error13.1
Cost6852
\[\begin{array}{l} \mathbf{if}\;x \leq 2.8:\\ \;\;\;\;{\left(x \cdot 12.000000000000048\right)}^{-1}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right)\\ \end{array} \]
Alternative 18
Error43.1
Cost6656
\[{\left(x \cdot 12.000000000000048\right)}^{-1} \]
Alternative 19
Error43.1
Cost320
\[0.083333333333333 \cdot \frac{1}{x} \]
Alternative 20
Error43.1
Cost192
\[\frac{0.083333333333333}{x} \]

Error

Reproduce

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