Average Error: 0.2 → 0.0
Time: 10.6s
Precision: binary64
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
\[\left(\left(b \cdot b\right) \cdot \left(2 \cdot \left(a \cdot a\right) + 4\right) + {b}^{4}\right) + \left({a}^{4} - 1\right)\]
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1
\left(\left(b \cdot b\right) \cdot \left(2 \cdot \left(a \cdot a\right) + 4\right) + {b}^{4}\right) + \left({a}^{4} - 1\right)
(FPCore (a b)
 :precision binary64
 (- (+ (pow (+ (* a a) (* b b)) 2.0) (* 4.0 (* b b))) 1.0))
(FPCore (a b)
 :precision binary64
 (+ (+ (* (* b b) (+ (* 2.0 (* a a)) 4.0)) (pow b 4.0)) (- (pow a 4.0) 1.0)))
double code(double a, double b) {
	return (pow(((a * a) + (b * b)), 2.0) + (4.0 * (b * b))) - 1.0;
}
double code(double a, double b) {
	return (((b * b) * ((2.0 * (a * a)) + 4.0)) + pow(b, 4.0)) + (pow(a, 4.0) - 1.0);
}

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 0.2

    \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  2. Taylor expanded around 0 0.0

    \[\leadsto \left(\color{blue}{\left(2 \cdot \left({a}^{2} \cdot {b}^{2}\right) + \left({b}^{4} + {a}^{4}\right)\right)} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  3. Simplified0.0

    \[\leadsto \left(\color{blue}{\left(2 \cdot \left(\left(a \cdot a\right) \cdot \left(b \cdot b\right)\right) + \left({b}^{4} + {a}^{4}\right)\right)} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  4. Using strategy rm
  5. Applied add-log-exp_binary64_21630.0

    \[\leadsto \left(\left(2 \cdot \left(\left(a \cdot a\right) \cdot \left(b \cdot b\right)\right) + \left({b}^{4} + {a}^{4}\right)\right) + 4 \cdot \left(b \cdot b\right)\right) - \color{blue}{\log \left(e^{1}\right)}\]
  6. Applied add-log-exp_binary64_216312.5

    \[\leadsto \left(\left(2 \cdot \left(\left(a \cdot a\right) \cdot \left(b \cdot b\right)\right) + \left({b}^{4} + {a}^{4}\right)\right) + \color{blue}{\log \left(e^{4 \cdot \left(b \cdot b\right)}\right)}\right) - \log \left(e^{1}\right)\]
  7. Applied add-log-exp_binary64_216322.3

    \[\leadsto \left(\left(2 \cdot \left(\left(a \cdot a\right) \cdot \left(b \cdot b\right)\right) + \left({b}^{4} + \color{blue}{\log \left(e^{{a}^{4}}\right)}\right)\right) + \log \left(e^{4 \cdot \left(b \cdot b\right)}\right)\right) - \log \left(e^{1}\right)\]
  8. Applied add-log-exp_binary64_216322.4

    \[\leadsto \left(\left(2 \cdot \left(\left(a \cdot a\right) \cdot \left(b \cdot b\right)\right) + \left(\color{blue}{\log \left(e^{{b}^{4}}\right)} + \log \left(e^{{a}^{4}}\right)\right)\right) + \log \left(e^{4 \cdot \left(b \cdot b\right)}\right)\right) - \log \left(e^{1}\right)\]
  9. Applied sum-log_binary64_221522.4

    \[\leadsto \left(\left(2 \cdot \left(\left(a \cdot a\right) \cdot \left(b \cdot b\right)\right) + \color{blue}{\log \left(e^{{b}^{4}} \cdot e^{{a}^{4}}\right)}\right) + \log \left(e^{4 \cdot \left(b \cdot b\right)}\right)\right) - \log \left(e^{1}\right)\]
  10. Applied add-log-exp_binary64_216322.4

    \[\leadsto \left(\left(\color{blue}{\log \left(e^{2 \cdot \left(\left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)}\right)} + \log \left(e^{{b}^{4}} \cdot e^{{a}^{4}}\right)\right) + \log \left(e^{4 \cdot \left(b \cdot b\right)}\right)\right) - \log \left(e^{1}\right)\]
  11. Applied sum-log_binary64_221522.4

    \[\leadsto \left(\color{blue}{\log \left(e^{2 \cdot \left(\left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)} \cdot \left(e^{{b}^{4}} \cdot e^{{a}^{4}}\right)\right)} + \log \left(e^{4 \cdot \left(b \cdot b\right)}\right)\right) - \log \left(e^{1}\right)\]
  12. Applied sum-log_binary64_221522.4

    \[\leadsto \color{blue}{\log \left(\left(e^{2 \cdot \left(\left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)} \cdot \left(e^{{b}^{4}} \cdot e^{{a}^{4}}\right)\right) \cdot e^{4 \cdot \left(b \cdot b\right)}\right)} - \log \left(e^{1}\right)\]
  13. Applied diff-log_binary64_221622.4

    \[\leadsto \color{blue}{\log \left(\frac{\left(e^{2 \cdot \left(\left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)} \cdot \left(e^{{b}^{4}} \cdot e^{{a}^{4}}\right)\right) \cdot e^{4 \cdot \left(b \cdot b\right)}}{e^{1}}\right)}\]
  14. Simplified22.4

    \[\leadsto \log \color{blue}{\left(e^{\left(b \cdot b\right) \cdot \left(2 \cdot \left(a \cdot a\right) + \left(4 + b \cdot b\right)\right) + \left({a}^{4} - 1\right)}\right)}\]
  15. Using strategy rm
  16. Applied exp-sum_binary64_217022.4

    \[\leadsto \log \color{blue}{\left(e^{\left(b \cdot b\right) \cdot \left(2 \cdot \left(a \cdot a\right) + \left(4 + b \cdot b\right)\right)} \cdot e^{{a}^{4} - 1}\right)}\]
  17. Applied log-prod_binary64_221022.4

    \[\leadsto \color{blue}{\log \left(e^{\left(b \cdot b\right) \cdot \left(2 \cdot \left(a \cdot a\right) + \left(4 + b \cdot b\right)\right)}\right) + \log \left(e^{{a}^{4} - 1}\right)}\]
  18. Simplified12.2

    \[\leadsto \color{blue}{\left(\left(b \cdot b\right) \cdot \left(2 \cdot \left(a \cdot a\right) + 4\right) + {b}^{4}\right)} + \log \left(e^{{a}^{4} - 1}\right)\]
  19. Simplified0.0

    \[\leadsto \left(\left(b \cdot b\right) \cdot \left(2 \cdot \left(a \cdot a\right) + 4\right) + {b}^{4}\right) + \color{blue}{\left({a}^{4} - 1\right)}\]
  20. Final simplification0.0

    \[\leadsto \left(\left(b \cdot b\right) \cdot \left(2 \cdot \left(a \cdot a\right) + 4\right) + {b}^{4}\right) + \left({a}^{4} - 1\right)\]

Alternatives

Reproduce

herbie shell --seed 2021100 
(FPCore (a b)
  :name "Bouland and Aaronson, Equation (26)"
  :precision binary64
  (- (+ (pow (+ (* a a) (* b b)) 2.0) (* 4.0 (* b b))) 1.0))