Average Error: 5.6 → 0.4
Time: 29.7s
Precision: binary64
Cost: 9160
\[\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} t_0 := z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) + -0.0027777777777778\right)\\ t_1 := 0.91893853320467 + \left(\left(0.0007936500793651 + y\right) \cdot \left(z \cdot \frac{z}{x}\right) + x \cdot \left(\log x + -1\right)\right)\\ \mathbf{if}\;t_0 \leq -1 \cdot 10^{+52}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+275}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \frac{0.083333333333333 + t_0}{x}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \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
 (let* ((t_0 (* z (+ (* z (+ 0.0007936500793651 y)) -0.0027777777777778)))
        (t_1
         (+
          0.91893853320467
          (+
           (* (+ 0.0007936500793651 y) (* z (/ z x)))
           (* x (+ (log x) -1.0))))))
   (if (<= t_0 -1e+52)
     t_1
     (if (<= t_0 5e+275)
       (+
        (+ 0.91893853320467 (- (* (log x) (+ x -0.5)) x))
        (/ (+ 0.083333333333333 t_0) x))
       t_1))))
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 t_0 = z * ((z * (0.0007936500793651 + y)) + -0.0027777777777778);
	double t_1 = 0.91893853320467 + (((0.0007936500793651 + y) * (z * (z / x))) + (x * (log(x) + -1.0)));
	double tmp;
	if (t_0 <= -1e+52) {
		tmp = t_1;
	} else if (t_0 <= 5e+275) {
		tmp = (0.91893853320467 + ((log(x) * (x + -0.5)) - x)) + ((0.083333333333333 + t_0) / x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = z * ((z * (0.0007936500793651d0 + y)) + (-0.0027777777777778d0))
    t_1 = 0.91893853320467d0 + (((0.0007936500793651d0 + y) * (z * (z / x))) + (x * (log(x) + (-1.0d0))))
    if (t_0 <= (-1d+52)) then
        tmp = t_1
    else if (t_0 <= 5d+275) then
        tmp = (0.91893853320467d0 + ((log(x) * (x + (-0.5d0))) - x)) + ((0.083333333333333d0 + t_0) / x)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
public static double code(double x, double y, double z) {
	double t_0 = z * ((z * (0.0007936500793651 + y)) + -0.0027777777777778);
	double t_1 = 0.91893853320467 + (((0.0007936500793651 + y) * (z * (z / x))) + (x * (Math.log(x) + -1.0)));
	double tmp;
	if (t_0 <= -1e+52) {
		tmp = t_1;
	} else if (t_0 <= 5e+275) {
		tmp = (0.91893853320467 + ((Math.log(x) * (x + -0.5)) - x)) + ((0.083333333333333 + t_0) / x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
def code(x, y, z):
	t_0 = z * ((z * (0.0007936500793651 + y)) + -0.0027777777777778)
	t_1 = 0.91893853320467 + (((0.0007936500793651 + y) * (z * (z / x))) + (x * (math.log(x) + -1.0)))
	tmp = 0
	if t_0 <= -1e+52:
		tmp = t_1
	elif t_0 <= 5e+275:
		tmp = (0.91893853320467 + ((math.log(x) * (x + -0.5)) - x)) + ((0.083333333333333 + t_0) / x)
	else:
		tmp = t_1
	return tmp
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)
	t_0 = Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) + -0.0027777777777778))
	t_1 = Float64(0.91893853320467 + Float64(Float64(Float64(0.0007936500793651 + y) * Float64(z * Float64(z / x))) + Float64(x * Float64(log(x) + -1.0))))
	tmp = 0.0
	if (t_0 <= -1e+52)
		tmp = t_1;
	elseif (t_0 <= 5e+275)
		tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x + -0.5)) - x)) + Float64(Float64(0.083333333333333 + t_0) / x));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp = code(x, y, z)
	tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
end
function tmp_2 = code(x, y, z)
	t_0 = z * ((z * (0.0007936500793651 + y)) + -0.0027777777777778);
	t_1 = 0.91893853320467 + (((0.0007936500793651 + y) * (z * (z / x))) + (x * (log(x) + -1.0)));
	tmp = 0.0;
	if (t_0 <= -1e+52)
		tmp = t_1;
	elseif (t_0 <= 5e+275)
		tmp = (0.91893853320467 + ((log(x) * (x + -0.5)) - x)) + ((0.083333333333333 + t_0) / x);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
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_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] + -0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.91893853320467 + N[(N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+52], t$95$1, If[LessEqual[t$95$0, 5e+275], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + t$95$0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], t$95$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}
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) + -0.0027777777777778\right)\\
t_1 := 0.91893853320467 + \left(\left(0.0007936500793651 + y\right) \cdot \left(z \cdot \frac{z}{x}\right) + x \cdot \left(\log x + -1\right)\right)\\
\mathbf{if}\;t_0 \leq -1 \cdot 10^{+52}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+275}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \frac{0.083333333333333 + t_0}{x}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original5.6
Target1.3
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. Split input into 2 regimes
  2. if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < -9.9999999999999999e51 or 5.0000000000000003e275 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z)

    1. Initial program 35.7

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

      \[\leadsto \color{blue}{0.91893853320467 + \left(\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} - \mathsf{fma}\left(\log x, 0.5 - x, x\right)\right)} \]
      Proof
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (fma.f64 z (fma.f64 (+.f64 y 7936500793651/10000000000000000) z -13888888888889/5000000000000000) 83333333333333/1000000000000000) x) (fma.f64 (log.f64 x) (-.f64 1/2 x) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (fma.f64 z (fma.f64 (+.f64 y 7936500793651/10000000000000000) z (Rewrite<= metadata-eval (neg.f64 13888888888889/5000000000000000))) 83333333333333/1000000000000000) x) (fma.f64 (log.f64 x) (-.f64 1/2 x) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (fma.f64 z (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000)) 83333333333333/1000000000000000) x) (fma.f64 (log.f64 x) (-.f64 1/2 x) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 z (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000)) 83333333333333/1000000000000000)) x) (fma.f64 (log.f64 x) (-.f64 1/2 x) x))): 1 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z)) 83333333333333/1000000000000000) x) (fma.f64 (log.f64 x) (-.f64 1/2 x) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x) (fma.f64 (log.f64 x) (Rewrite<= unsub-neg_binary64 (+.f64 1/2 (neg.f64 x))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x) (fma.f64 (log.f64 x) (Rewrite=> +-commutative_binary64 (+.f64 (neg.f64 x) 1/2)) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x) (fma.f64 (log.f64 x) (+.f64 (Rewrite=> neg-sub0_binary64 (-.f64 0 x)) 1/2) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x) (fma.f64 (log.f64 x) (Rewrite<= associate--r-_binary64 (-.f64 0 (-.f64 x 1/2))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x) (fma.f64 (log.f64 x) (Rewrite<= neg-sub0_binary64 (neg.f64 (-.f64 x 1/2))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x) (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (log.f64 x) (neg.f64 (-.f64 x 1/2))) x)))): 11 points increase in error, 20 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x) (+.f64 (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 (log.f64 x) (-.f64 x 1/2)))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x) (+.f64 (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 x 1/2) (log.f64 x)))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x) (Rewrite<= +-commutative_binary64 (+.f64 x (neg.f64 (*.f64 (-.f64 x 1/2) (log.f64 x))))))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x) (Rewrite<= sub-neg_binary64 (-.f64 x (*.f64 (-.f64 x 1/2) (log.f64 x)))))): 0 points increase in error, 0 points decrease in error
      (Rewrite=> associate-+r-_binary64 (-.f64 (+.f64 91893853320467/100000000000000 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x)) (-.f64 x (*.f64 (-.f64 x 1/2) (log.f64 x))))): 1 points increase in error, 0 points decrease in error
      (Rewrite=> associate--r-_binary64 (+.f64 (-.f64 (+.f64 91893853320467/100000000000000 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x)) x) (*.f64 (-.f64 x 1/2) (log.f64 x)))): 1 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= unsub-neg_binary64 (+.f64 (+.f64 91893853320467/100000000000000 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x)) (neg.f64 x))) (*.f64 (-.f64 x 1/2) (log.f64 x))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-+r+_binary64 (+.f64 (+.f64 91893853320467/100000000000000 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x)) (+.f64 (neg.f64 x) (*.f64 (-.f64 x 1/2) (log.f64 x))))): 0 points increase in error, 1 points decrease in error
      (+.f64 (+.f64 91893853320467/100000000000000 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x)) (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 (-.f64 x 1/2) (log.f64 x)) (neg.f64 x)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 91893853320467/100000000000000 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x)) (Rewrite<= sub-neg_binary64 (-.f64 (*.f64 (-.f64 x 1/2) (log.f64 x)) x))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 (-.f64 (*.f64 (-.f64 x 1/2) (log.f64 x)) x) (+.f64 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
      (Rewrite<= associate-+l+_binary64 (+.f64 (+.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, 1 points decrease in error
    3. Taylor expanded in z around inf 36.3

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

      \[\leadsto 0.91893853320467 + \left(\color{blue}{\left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right)} - \mathsf{fma}\left(\log x, 0.5 - x, x\right)\right) \]
      Proof
      (*.f64 (+.f64 y 7936500793651/10000000000000000) (*.f64 z (/.f64 z x))): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= +-commutative_binary64 (+.f64 7936500793651/10000000000000000 y)) (*.f64 z (/.f64 z x))): 0 points increase in error, 0 points decrease in error
      (*.f64 (+.f64 7936500793651/10000000000000000 y) (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 z z) x))): 48 points increase in error, 24 points decrease in error
      (*.f64 (+.f64 7936500793651/10000000000000000 y) (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 z 2)) x)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 (pow.f64 z 2) x) (+.f64 7936500793651/10000000000000000 y))): 0 points increase in error, 0 points decrease in error
      (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 (pow.f64 z 2) (+.f64 7936500793651/10000000000000000 y)) x)): 37 points increase in error, 30 points decrease in error
    5. Taylor expanded in x around inf 0.6

      \[\leadsto 0.91893853320467 + \left(\left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) - \color{blue}{\left(1 + \log \left(\frac{1}{x}\right)\right) \cdot x}\right) \]
    6. Simplified0.6

      \[\leadsto 0.91893853320467 + \left(\left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) - \color{blue}{\left(x - x \cdot \log x\right)}\right) \]
      Proof
      (-.f64 x (*.f64 x (log.f64 x))): 0 points increase in error, 0 points decrease in error
      (-.f64 x (Rewrite=> *-commutative_binary64 (*.f64 (log.f64 x) x))): 0 points increase in error, 0 points decrease in error
      (Rewrite=> cancel-sign-sub-inv_binary64 (+.f64 x (*.f64 (neg.f64 (log.f64 x)) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (*.f64 (Rewrite<= log-rec_binary64 (log.f64 (/.f64 1 x))) x)): 0 points increase in error, 0 points decrease in error
      (Rewrite=> distribute-rgt1-in_binary64 (*.f64 (+.f64 (log.f64 (/.f64 1 x)) 1) x)): 33 points increase in error, 31 points decrease in error
      (*.f64 (Rewrite<= +-commutative_binary64 (+.f64 1 (log.f64 (/.f64 1 x)))) x): 0 points increase in error, 0 points decrease in error
    7. Taylor expanded in x around 0 0.6

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

    if -9.9999999999999999e51 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 5.0000000000000003e275

    1. Initial program 0.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} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) + -0.0027777777777778\right) \leq -1 \cdot 10^{+52}:\\ \;\;\;\;0.91893853320467 + \left(\left(0.0007936500793651 + y\right) \cdot \left(z \cdot \frac{z}{x}\right) + x \cdot \left(\log x + -1\right)\right)\\ \mathbf{elif}\;z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) + -0.0027777777777778\right) \leq 5 \cdot 10^{+275}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) + -0.0027777777777778\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;0.91893853320467 + \left(\left(0.0007936500793651 + y\right) \cdot \left(z \cdot \frac{z}{x}\right) + x \cdot \left(\log x + -1\right)\right)\\ \end{array} \]

Alternatives

Alternative 1
Error1.3
Cost9160
\[\begin{array}{l} t_0 := \left(0.0007936500793651 + y\right) \cdot \left(z \cdot \frac{z}{x}\right)\\ t_1 := z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) + -0.0027777777777778\right)\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{+52}:\\ \;\;\;\;0.91893853320467 + \left(t_0 + x \cdot \left(\log x + -1\right)\right)\\ \mathbf{elif}\;t_1 \leq 20000000000:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \left(\frac{0.083333333333333}{x} + \frac{z \cdot \left(-0.0027777777777778 + z \cdot 0.0007936500793651\right)}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;0.91893853320467 + \left(t_0 + \left(x \cdot \log x - x\right)\right)\\ \end{array} \]
Alternative 2
Error1.5
Cost8904
\[\begin{array}{l} t_0 := \left(0.0007936500793651 + y\right) \cdot \left(z \cdot \frac{z}{x}\right)\\ t_1 := z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) + -0.0027777777777778\right)\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{+52}:\\ \;\;\;\;0.91893853320467 + \left(t_0 + x \cdot \left(\log x + -1\right)\right)\\ \mathbf{elif}\;t_1 \leq 0.01:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \left(\frac{0.083333333333333}{x} + \frac{z}{x} \cdot -0.0027777777777778\right)\\ \mathbf{else}:\\ \;\;\;\;0.91893853320467 + \left(t_0 + \left(x \cdot \log x - x\right)\right)\\ \end{array} \]
Alternative 3
Error1.6
Cost8776
\[\begin{array}{l} t_0 := z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) + -0.0027777777777778\right)\\ t_1 := 0.91893853320467 + \left(\left(0.0007936500793651 + y\right) \cdot \left(z \cdot \frac{z}{x}\right) + x \cdot \left(\log x + -1\right)\right)\\ \mathbf{if}\;t_0 \leq -1 \cdot 10^{+52}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_0 \leq 0.01:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \frac{1}{\frac{x}{0.083333333333333}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error1.6
Cost8776
\[\begin{array}{l} t_0 := \left(0.0007936500793651 + y\right) \cdot \left(z \cdot \frac{z}{x}\right)\\ t_1 := z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) + -0.0027777777777778\right)\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{+52}:\\ \;\;\;\;0.91893853320467 + \left(t_0 + x \cdot \left(\log x + -1\right)\right)\\ \mathbf{elif}\;t_1 \leq 0.01:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \frac{1}{\frac{x}{0.083333333333333}}\\ \mathbf{else}:\\ \;\;\;\;0.91893853320467 + \left(t_0 + \left(x \cdot \log x - x\right)\right)\\ \end{array} \]
Alternative 5
Error1.0
Cost8388
\[\begin{array}{l} \mathbf{if}\;x \leq 3.398722903599718 \cdot 10^{+174}:\\ \;\;\;\;\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 \left(z \cdot \left(0.0007936500793651 + y\right)\right) + \frac{z}{x} \cdot -0.0027777777777778\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.91893853320467 + \left(z \cdot \frac{z}{\frac{x}{y}} + x \cdot \left(\log x + -1\right)\right)\\ \end{array} \]
Alternative 6
Error3.9
Cost7492
\[\begin{array}{l} \mathbf{if}\;x \leq 440:\\ \;\;\;\;\frac{0.083333333333333 + \left(z \cdot -0.0027777777777778 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right)\right)\right)}{x} - x\\ \mathbf{else}:\\ \;\;\;\;0.91893853320467 + \left(z \cdot \frac{z}{\frac{x}{y}} + x \cdot \left(\log x + -1\right)\right)\\ \end{array} \]
Alternative 7
Error3.9
Cost7492
\[\begin{array}{l} \mathbf{if}\;x \leq 440:\\ \;\;\;\;\frac{0.083333333333333 + \left(z \cdot -0.0027777777777778 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right)\right)\right)}{x} - x\\ \mathbf{else}:\\ \;\;\;\;0.91893853320467 + \left(z \cdot \frac{z}{\frac{x}{y}} + \left(x \cdot \log x - x\right)\right)\\ \end{array} \]
Alternative 8
Error3.9
Cost7492
\[\begin{array}{l} \mathbf{if}\;x \leq 440:\\ \;\;\;\;\left(\frac{0.083333333333333}{x} + \frac{z}{x} \cdot \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right)\right) - x\\ \mathbf{else}:\\ \;\;\;\;0.91893853320467 + \left(z \cdot \frac{z}{\frac{x}{y}} + \left(x \cdot \log x - x\right)\right)\\ \end{array} \]
Alternative 9
Error6.4
Cost7364
\[\begin{array}{l} \mathbf{if}\;x \leq 0.00086:\\ \;\;\;\;\frac{0.083333333333333 + \left(z \cdot -0.0027777777777778 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right)\right)\right)}{x} - x\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\ \end{array} \]
Alternative 10
Error6.6
Cost7108
\[\begin{array}{l} \mathbf{if}\;x \leq 440:\\ \;\;\;\;\frac{0.083333333333333 + \left(z \cdot -0.0027777777777778 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right)\right)\right)}{x} - x\\ \mathbf{else}:\\ \;\;\;\;0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\ \end{array} \]
Alternative 11
Error6.8
Cost6852
\[\begin{array}{l} \mathbf{if}\;x \leq 440:\\ \;\;\;\;\frac{0.083333333333333 + \left(z \cdot -0.0027777777777778 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right)\right)\right)}{x} - x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log x - x\\ \end{array} \]
Alternative 12
Error32.3
Cost3020
\[\begin{array}{l} t_0 := z \cdot \left(0.0007936500793651 + y\right)\\ t_1 := z \cdot \left(t_0 + -0.0027777777777778\right)\\ t_2 := z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) - x\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{+52}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{-14}:\\ \;\;\;\;0.91893853320467 + \frac{0.083333333333333}{x}\\ \mathbf{elif}\;t_1 \leq 10^{+285}:\\ \;\;\;\;\frac{0.083333333333333 + \left(z \cdot -0.0027777777777778 + z \cdot t_0\right)}{x} - x\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 13
Error32.3
Cost2892
\[\begin{array}{l} t_0 := z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) + -0.0027777777777778\right)\\ t_1 := z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) - x\\ \mathbf{if}\;t_0 \leq -1 \cdot 10^{+52}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_0 \leq 2 \cdot 10^{-14}:\\ \;\;\;\;0.91893853320467 + \frac{0.083333333333333}{x}\\ \mathbf{elif}\;t_0 \leq 10^{+285}:\\ \;\;\;\;\frac{0.083333333333333 + t_0}{x} - x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 14
Error32.9
Cost1096
\[\begin{array}{l} t_0 := z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) - x\\ \mathbf{if}\;z \leq -1:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 3800000:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(-0.0027777777777778 + z \cdot y\right)}{x} - x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 15
Error34.4
Cost968
\[\begin{array}{l} t_0 := z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) - x\\ \mathbf{if}\;z \leq -1.2 \cdot 10^{-7}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-12}:\\ \;\;\;\;0.91893853320467 + \frac{0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 16
Error33.0
Cost968
\[\begin{array}{l} t_0 := z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) - x\\ \mathbf{if}\;z \leq -1:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 100:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot y\right)}{x} - x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 17
Error33.2
Cost964
\[\begin{array}{l} \mathbf{if}\;x \leq 4.3701877893316864 \cdot 10^{+73}:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right)\right)}{x} - x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) - x\\ \end{array} \]
Alternative 18
Error39.8
Cost840
\[\begin{array}{l} t_0 := z \cdot \frac{z}{\frac{x}{y}} - x\\ \mathbf{if}\;z \leq -1.2 \cdot 10^{-7}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-12}:\\ \;\;\;\;0.91893853320467 + \frac{0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 19
Error42.5
Cost320
\[0.91893853320467 + \frac{0.083333333333333}{x} \]
Alternative 20
Error43.1
Cost192
\[\frac{0.083333333333333}{x} \]
Alternative 21
Error60.9
Cost64
\[0.91893853320467 \]

Error

Reproduce

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