Average Error: 59.7 → 0.3
Time: 25.1s
Precision: 64
Internal Precision: 1344
\[\sqrt{x - 1} - \sqrt{x}\]
\[\frac{-1}{\sqrt{x - 1} + \sqrt{x}}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 59.7

    \[\sqrt{x - 1} - \sqrt{x}\]
  2. Using strategy rm
  3. Applied flip--59.2

    \[\leadsto \color{blue}{\frac{\sqrt{x - 1} \cdot \sqrt{x - 1} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x - 1} + \sqrt{x}}}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity59.2

    \[\leadsto \frac{\sqrt{x - 1} \cdot \sqrt{x - 1} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x - 1} + \color{blue}{1 \cdot \sqrt{x}}}\]
  6. Applied *-un-lft-identity59.2

    \[\leadsto \frac{\sqrt{x - 1} \cdot \sqrt{x - 1} - \sqrt{x} \cdot \sqrt{x}}{\color{blue}{1 \cdot \sqrt{x - 1}} + 1 \cdot \sqrt{x}}\]
  7. Applied distribute-lft-out59.2

    \[\leadsto \frac{\sqrt{x - 1} \cdot \sqrt{x - 1} - \sqrt{x} \cdot \sqrt{x}}{\color{blue}{1 \cdot \left(\sqrt{x - 1} + \sqrt{x}\right)}}\]
  8. Applied *-un-lft-identity59.2

    \[\leadsto \frac{\color{blue}{1 \cdot \left(\sqrt{x - 1} \cdot \sqrt{x - 1} - \sqrt{x} \cdot \sqrt{x}\right)}}{1 \cdot \left(\sqrt{x - 1} + \sqrt{x}\right)}\]
  9. Applied times-frac59.2

    \[\leadsto \color{blue}{\frac{1}{1} \cdot \frac{\sqrt{x - 1} \cdot \sqrt{x - 1} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x - 1} + \sqrt{x}}}\]
  10. Simplified59.2

    \[\leadsto \color{blue}{1} \cdot \frac{\sqrt{x - 1} \cdot \sqrt{x - 1} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x - 1} + \sqrt{x}}\]
  11. Simplified0.3

    \[\leadsto 1 \cdot \color{blue}{\frac{-1}{\sqrt{x} + \sqrt{x - 1}}}\]
  12. Final simplification0.3

    \[\leadsto \frac{-1}{\sqrt{x - 1} + \sqrt{x}}\]

Runtime

Time bar (total: 25.1s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)' 
(FPCore (x)
  :name "sqrt(x - 1) - sqrt(x)"
  (- (sqrt (- x 1)) (sqrt x)))