Average Error: 9.6 → 4.9
Time: 1.1m
Precision: 64
Internal Precision: 1664
\[x + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(a - x\right)\]
\[\begin{array}{l} \mathbf{if}\;\frac{y - z}{\left(t + 1.0\right) - z} \le 0.9999999999999999:\\ \;\;\;\;(\left(\frac{y - z}{\left(t + 1.0\right) - z}\right) \cdot a + x)_* + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(-x\right)\\ \mathbf{if}\;\frac{y - z}{\left(t + 1.0\right) - z} \le 1.0000000034015424:\\ \;\;\;\;(\left(\frac{y}{z}\right) \cdot \left(x - a\right) + a)_*\\ \mathbf{else}:\\ \;\;\;\;(\left(\frac{y - z}{\left(t + 1.0\right) - z}\right) \cdot a + x)_* + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(-x\right)\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Derivation

  1. Split input into 2 regimes
  2. if (/ (- y z) (- (+ t 1.0) z)) < 0.9999999999999999 or 1.0000000034015424 < (/ (- y z) (- (+ t 1.0) z))

    1. Initial program 0.8

      \[x + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(a - x\right)\]
    2. Using strategy rm
    3. Applied sub-neg0.8

      \[\leadsto x + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \color{blue}{\left(a + \left(-x\right)\right)}\]
    4. Applied distribute-lft-in0.8

      \[\leadsto x + \color{blue}{\left(\frac{y - z}{\left(t + 1.0\right) - z} \cdot a + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(-x\right)\right)}\]
    5. Applied associate-+r+0.8

      \[\leadsto \color{blue}{\left(x + \frac{y - z}{\left(t + 1.0\right) - z} \cdot a\right) + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(-x\right)}\]
    6. Applied simplify0.8

      \[\leadsto \color{blue}{(\left(\frac{y - z}{\left(t + 1.0\right) - z}\right) \cdot a + x)_*} + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(-x\right)\]

    if 0.9999999999999999 < (/ (- y z) (- (+ t 1.0) z)) < 1.0000000034015424

    1. Initial program 30.6

      \[x + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(a - x\right)\]
    2. Taylor expanded around inf 20.3

      \[\leadsto \color{blue}{\left(\frac{y \cdot x}{z} + a\right) - \frac{y \cdot a}{z}}\]
    3. Applied simplify14.7

      \[\leadsto \color{blue}{(\left(\frac{y}{z}\right) \cdot \left(x - a\right) + a)_*}\]
  3. Recombined 2 regimes into one program.

Runtime

Time bar (total: 1.1m)Debug logProfile

herbie shell --seed '#(1064173506 2580572819 2847706409 4129882574 1125180799 1845288547)' +o rules:numerics
(FPCore (x y z t a)
  :name "Hakyll.Web.Tags:renderTagCloud from hakyll-4.7.2.3"
  (+ x (* (/ (- y z) (- (+ t 1.0) z)) (- a x))))