Average Error: 0.0 → 0.0
Time: 5.0s
Precision: binary64
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)\]
\[\left(0.5 \cdot \cos re\right) \cdot \left(\sqrt[3]{8} \cdot \cosh im\right)\]
\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\left(0.5 \cdot \cos re\right) \cdot \left(\sqrt[3]{8} \cdot \cosh im\right)
(FPCore (re im)
 :precision binary64
 (* (* 0.5 (cos re)) (+ (exp (- im)) (exp im))))
(FPCore (re im)
 :precision binary64
 (* (* 0.5 (cos re)) (* (cbrt 8.0) (cosh im))))
double code(double re, double im) {
	return (0.5 * cos(re)) * (exp(-im) + exp(im));
}
double code(double re, double im) {
	return (0.5 * cos(re)) * (cbrt(8.0) * cosh(im));
}

Error

Bits error versus re

Bits error versus im

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)\]
  2. Using strategy rm
  3. Applied add-cbrt-cube_binary64_7960.1

    \[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\sqrt[3]{\left(\left(e^{-im} + e^{im}\right) \cdot \left(e^{-im} + e^{im}\right)\right) \cdot \left(e^{-im} + e^{im}\right)}}\]
  4. Simplified0.1

    \[\leadsto \left(0.5 \cdot \cos re\right) \cdot \sqrt[3]{\color{blue}{{\left(e^{im} + e^{-im}\right)}^{3}}}\]
  5. Using strategy rm
  6. Applied cosh-undef_binary64_9540.1

    \[\leadsto \left(0.5 \cdot \cos re\right) \cdot \sqrt[3]{{\color{blue}{\left(2 \cdot \cosh im\right)}}^{3}}\]
  7. Applied unpow-prod-down_binary64_8390.1

    \[\leadsto \left(0.5 \cdot \cos re\right) \cdot \sqrt[3]{\color{blue}{{2}^{3} \cdot {\cosh im}^{3}}}\]
  8. Applied cbrt-prod_binary64_7910.1

    \[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(\sqrt[3]{{2}^{3}} \cdot \sqrt[3]{{\cosh im}^{3}}\right)}\]
  9. Simplified0.1

    \[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(\color{blue}{\sqrt[3]{8}} \cdot \sqrt[3]{{\cosh im}^{3}}\right)\]
  10. Simplified0.0

    \[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(\sqrt[3]{8} \cdot \color{blue}{\cosh im}\right)\]
  11. Final simplification0.0

    \[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(\sqrt[3]{8} \cdot \cosh im\right)\]

Reproduce

herbie shell --seed 2021058 
(FPCore (re im)
  :name "math.cos on complex, real part"
  :precision binary64
  (* (* 0.5 (cos re)) (+ (exp (- im)) (exp im))))