Average Error: 15.4 → 15.4
Time: 8.7s
Precision: binary64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{1}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \left(\frac{1}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}} \cdot \left(\frac{0.5}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}} - \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}}\right)\right)\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{1}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \left(\frac{1}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}} \cdot \left(\frac{0.5}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}} - \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}}\right)\right)
(FPCore (x)
 :precision binary64
 (- 1.0 (sqrt (* 0.5 (+ 1.0 (/ 1.0 (hypot 1.0 x)))))))
(FPCore (x)
 :precision binary64
 (*
  (/ 1.0 (sqrt (+ 1.0 (sqrt (+ 0.5 (/ 0.5 (hypot 1.0 x)))))))
  (*
   (/ 1.0 (sqrt (sqrt (+ 1.0 (sqrt (+ 0.5 (/ 0.5 (hypot 1.0 x))))))))
   (-
    (/ 0.5 (sqrt (sqrt (+ 1.0 (sqrt (+ 0.5 (/ 0.5 (hypot 1.0 x))))))))
    (/
     (/ 0.5 (hypot 1.0 x))
     (sqrt (sqrt (+ 1.0 (sqrt (+ 0.5 (/ 0.5 (hypot 1.0 x))))))))))))
double code(double x) {
	return 1.0 - sqrt(0.5 * (1.0 + (1.0 / hypot(1.0, x))));
}
double code(double x) {
	return (1.0 / sqrt(1.0 + sqrt(0.5 + (0.5 / hypot(1.0, x))))) * ((1.0 / sqrt(sqrt(1.0 + sqrt(0.5 + (0.5 / hypot(1.0, x)))))) * ((0.5 / sqrt(sqrt(1.0 + sqrt(0.5 + (0.5 / hypot(1.0, x)))))) - ((0.5 / hypot(1.0, x)) / sqrt(sqrt(1.0 + sqrt(0.5 + (0.5 / hypot(1.0, x))))))));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.4

    \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
  2. Simplified15.4

    \[\leadsto \color{blue}{1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
  3. Using strategy rm
  4. Applied flip--_binary64_60015.4

    \[\leadsto \color{blue}{\frac{1 \cdot 1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\]
  5. Simplified14.9

    \[\leadsto \frac{\color{blue}{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
  6. Using strategy rm
  7. Applied div-sub_binary64_56815.0

    \[\leadsto \color{blue}{\frac{0.5}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} - \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\]
  8. Using strategy rm
  9. Applied add-sqr-sqrt_binary64_55930.3

    \[\leadsto \frac{0.5}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} - \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\color{blue}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \cdot \sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}}\]
  10. Applied *-un-lft-identity_binary64_57430.3

    \[\leadsto \frac{0.5}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} - \frac{\color{blue}{1 \cdot \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \cdot \sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\]
  11. Applied times-frac_binary64_56930.3

    \[\leadsto \frac{0.5}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} - \color{blue}{\frac{1}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}}\]
  12. Applied add-sqr-sqrt_binary64_55915.4

    \[\leadsto \frac{0.5}{\color{blue}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \cdot \sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}} - \frac{1}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\]
  13. Applied *-un-lft-identity_binary64_57415.4

    \[\leadsto \frac{\color{blue}{1 \cdot 0.5}}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \cdot \sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} - \frac{1}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\]
  14. Applied times-frac_binary64_56915.0

    \[\leadsto \color{blue}{\frac{1}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \frac{0.5}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}} - \frac{1}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\]
  15. Applied distribute-lft-out--_binary64_61915.0

    \[\leadsto \color{blue}{\frac{1}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \left(\frac{0.5}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} - \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\right)}\]
  16. Using strategy rm
  17. Applied add-sqr-sqrt_binary64_55930.8

    \[\leadsto \frac{1}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \left(\frac{0.5}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} - \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\color{blue}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}}}\right)\]
  18. Applied *-un-lft-identity_binary64_57430.8

    \[\leadsto \frac{1}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \left(\frac{0.5}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} - \frac{\color{blue}{1 \cdot \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}}\right)\]
  19. Applied times-frac_binary64_56930.8

    \[\leadsto \frac{1}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \left(\frac{0.5}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} - \color{blue}{\frac{1}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}} \cdot \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}}}\right)\]
  20. Applied add-sqr-sqrt_binary64_55930.8

    \[\leadsto \frac{1}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \left(\frac{0.5}{\color{blue}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}}} - \frac{1}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}} \cdot \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}}\right)\]
  21. Applied *-un-lft-identity_binary64_57430.8

    \[\leadsto \frac{1}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \left(\frac{\color{blue}{1 \cdot 0.5}}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}} - \frac{1}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}} \cdot \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}}\right)\]
  22. Applied times-frac_binary64_56915.4

    \[\leadsto \frac{1}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \left(\color{blue}{\frac{1}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}} \cdot \frac{0.5}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}}} - \frac{1}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}} \cdot \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}}\right)\]
  23. Applied distribute-lft-out--_binary64_61915.4

    \[\leadsto \frac{1}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \color{blue}{\left(\frac{1}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}} \cdot \left(\frac{0.5}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}} - \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}}\right)\right)}\]
  24. Final simplification15.4

    \[\leadsto \frac{1}{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \left(\frac{1}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}} \cdot \left(\frac{0.5}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}} - \frac{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{\sqrt{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}}\right)\right)\]

Reproduce

herbie shell --seed 2020231 
(FPCore (x)
  :name "Given's Rotation SVD example, simplified"
  :precision binary64
  (- 1.0 (sqrt (* 0.5 (+ 1.0 (/ 1.0 (hypot 1.0 x)))))))