Average Error: 13.1 → 13.1
Time: 9.8s
Precision: 64
Internal Precision: 3392
\[\mathsf{copysign}\left(\sqrt{\frac{\sqrt{a^2 + b^2}^* - a}{2}}, b\right)\]
\[\mathsf{copysign}\left(\sqrt{\frac{\sqrt{a^2 + b^2}^* - a}{2}}, b\right)\]

Error

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 13.1

    \[\mathsf{copysign}\left(\sqrt{\frac{\sqrt{a^2 + b^2}^* - a}{2}}, b\right)\]
  2. Initial simplification13.1

    \[\leadsto \mathsf{copysign}\left(\sqrt{\frac{\sqrt{a^2 + b^2}^* - a}{2}}, b\right)\]
  3. Final simplification13.1

    \[\leadsto \mathsf{copysign}\left(\sqrt{\frac{\sqrt{a^2 + b^2}^* - a}{2}}, b\right)\]

Runtime

Time bar (total: 9.8s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)' 
(FPCore (a b)
  :name "copysign(sqrt((hypot(a,b)-a)/2), b)"
  (copysign (sqrt (/ (- (hypot a b) a) 2)) b))