Average Error: 46.8 → 35.5
Time: 2.5m
Precision: 64
Internal Precision: 3200
\[\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 \cos \left(\left(\sqrt[3]{\frac{2.0 \cdot y + 1.0}{\frac{16.0}{t \cdot z}}} \cdot \sqrt[3]{\frac{2.0 \cdot y + 1.0}{\frac{16.0}{t \cdot z}}}\right) \cdot \frac{\sqrt[3]{2.0 \cdot y + 1.0}}{\sqrt[3]{\frac{16.0}{t \cdot z}}}\right)\]

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.8
Target39.9
Herbie35.5
\[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.8

    \[\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. Taylor expanded around 0 35.7

    \[\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}\]
  3. Applied simplify35.5

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

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

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

Runtime

Time bar (total: 2.5m)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit +o reduce:binary-search
(FPCore (x y z t a b)
  :name "Codec.Picture.Jpg.FastDct:referenceDct from JuicyPixels-3.2.6.1"

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

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