Average Error: 46.1 → 34.6
Time: 1.0m
Precision: 64
Internal precision: 128
\[\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2.0 + 1.0\right) \cdot z\right) \cdot t}{16.0}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2.0 + 1.0\right) \cdot b\right) \cdot t}{16.0}\right)\]
\[x \cdot {\left(\sqrt[3]{{\left(\sqrt[3]{\cos \left(\frac{1.0 + 2.0 \cdot y}{\frac{\frac{16.0}{z}}{t}}\right)}\right)}^3}\right)}^3\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Target

Original46.1
Comparison38.9
Herbie34.6
\[ x \cdot \cos \left(\frac{b}{16.0} \cdot \frac{t}{\left(1.0 - a \cdot 2.0\right) + {\left(a \cdot 2.0\right)}^2}\right) \]

Derivation

  1. Initial program 46.1

    \[\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2.0 + 1.0\right) \cdot z\right) \cdot t}{16.0}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2.0 + 1.0\right) \cdot b\right) \cdot t}{16.0}\right)\]
  2. Applied taylor 34.8

    \[\leadsto \left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2.0 + 1.0\right) \cdot z\right) \cdot t}{16.0}\right)\right) \cdot 1\]
  3. Taylor expanded around 0 34.8

    \[\leadsto \left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2.0 + 1.0\right) \cdot z\right) \cdot t}{16.0}\right)\right) \cdot \color{blue}{1}\]
  4. Applied simplify 34.5

    \[\leadsto \color{blue}{x \cdot \cos \left(\frac{1.0 + 2.0 \cdot y}{\frac{\frac{16.0}{z}}{t}}\right)}\]
  5. Using strategy rm
  6. Applied add-cube-cbrt 34.6

    \[\leadsto x \cdot \color{blue}{{\left(\sqrt[3]{\cos \left(\frac{1.0 + 2.0 \cdot y}{\frac{\frac{16.0}{z}}{t}}\right)}\right)}^3}\]
  7. Using strategy rm
  8. Applied add-cube-cbrt 34.6

    \[\leadsto x \cdot {\left(\sqrt[3]{\color{blue}{{\left(\sqrt[3]{\cos \left(\frac{1.0 + 2.0 \cdot y}{\frac{\frac{16.0}{z}}{t}}\right)}\right)}^3}}\right)}^3\]
  9. Removed slow pow expressions

Runtime

Time bar (total: 1.0m) Debug log

Please include this information when filing a bug report:

herbie --seed '#(778858373 743931873 2464583708 3870714892 1262567524 204478896)'
(FPCore (x y z t a b)
  :name "Codec.Picture.Jpg.FastDct:referenceDct from JuicyPixels-3.2.6.1"

  :target
  (* x (cos (* (/ b 16.0) (/ t (+ (- 1.0 (* a 2.0)) (sqr (* a 2.0)))))))

  (* (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0))) (cos (/ (* (* (+ (* a 2.0) 1.0) b) t) 16.0))))