Average Error: 9.7 → 5.9
Time: 2.7m
Precision: 64
Internal Precision: 1408
\[x + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(a - x\right)\]
\[\begin{array}{l} \mathbf{if}\;x + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(a - x\right) \le -1.7520507504360348 \cdot 10^{-290}:\\ \;\;\;\;x + \left(\frac{1}{\sqrt[3]{\left(t + 1.0\right) - z} \cdot \sqrt[3]{\left(t + 1.0\right) - z}} \cdot \frac{y - z}{\sqrt[3]{\left(t + 1.0\right) - z}}\right) \cdot \left(a - x\right)\\ \mathbf{if}\;x + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(a - x\right) \le 7.863852451305876 \cdot 10^{-285}:\\ \;\;\;\;a - \left(a - x\right) \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \left(\frac{1}{\sqrt[3]{\left(t + 1.0\right) - z} \cdot \sqrt[3]{\left(t + 1.0\right) - z}} \cdot \frac{y - z}{\sqrt[3]{\left(t + 1.0\right) - z}}\right) \cdot \left(a - 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 (+ x (* (/ (- y z) (- (+ t 1.0) z)) (- a x))) < -1.7520507504360348e-290 or 7.863852451305876e-285 < (+ x (* (/ (- y z) (- (+ t 1.0) z)) (- a x)))

    1. Initial program 0.9

      \[x + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(a - x\right)\]
    2. Using strategy rm
    3. Applied add-cube-cbrt1.4

      \[\leadsto x + \frac{y - z}{\color{blue}{\left(\sqrt[3]{\left(t + 1.0\right) - z} \cdot \sqrt[3]{\left(t + 1.0\right) - z}\right) \cdot \sqrt[3]{\left(t + 1.0\right) - z}}} \cdot \left(a - x\right)\]
    4. Applied *-un-lft-identity1.4

      \[\leadsto x + \frac{\color{blue}{1 \cdot \left(y - z\right)}}{\left(\sqrt[3]{\left(t + 1.0\right) - z} \cdot \sqrt[3]{\left(t + 1.0\right) - z}\right) \cdot \sqrt[3]{\left(t + 1.0\right) - z}} \cdot \left(a - x\right)\]
    5. Applied times-frac1.4

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

    if -1.7520507504360348e-290 < (+ x (* (/ (- y z) (- (+ t 1.0) z)) (- a x))) < 7.863852451305876e-285

    1. Initial program 59.5

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

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

      \[\leadsto \color{blue}{a - \left(a - x\right) \cdot \frac{y}{z}}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions.

Runtime

Time bar (total: 2.7m)Debug logProfile

herbie shell --seed '#(1063185673 2139736501 2393378123 1907444849 1070993796 1007244912)' 
(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))))