Average Error: 4.0 → 2.0
Time: 4.5m
Precision: 64
Internal Precision: 2880
\[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c_n}}\]
\[\begin{array}{l} \mathbf{if}\;\left(\left(\left(\sqrt[3]{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}} \cdot \sqrt[3]{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}\right) \cdot \frac{\sqrt[3]{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}}\right) \cdot \left(\left(\sqrt[3]{\frac{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}}} \cdot \sqrt[3]{\frac{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}}}\right) \cdot \sqrt[3]{\frac{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}}}\right)\right) \cdot \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c_p}}{c_p \cdot \left(\log \frac{1}{2} + t \cdot \frac{1}{2}\right) + 1} \le 0.9999166162474663:\\ \;\;\;\;\left(\left(\left(\sqrt[3]{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}} \cdot \sqrt[3]{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}\right) \cdot \frac{\sqrt[3]{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}}\right) \cdot \left(\left(\sqrt[3]{\frac{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}}} \cdot \sqrt[3]{\frac{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}}}\right) \cdot \sqrt[3]{\frac{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}}}\right)\right) \cdot \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c_p}}{c_p \cdot \left(\log \frac{1}{2} + t \cdot \frac{1}{2}\right) + 1}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(c_p - c_n\right) \cdot \left(s \cdot \frac{1}{2}\right)\\ \end{array}\]

Error

Bits error versus c_p

Bits error versus c_n

Bits error versus t

Bits error versus s

Target

Original4.0
Target2.2
Herbie2.0
\[{\left(\frac{1 + e^{-t}}{1 + e^{-s}}\right)}^{c_p} \cdot {\left(\frac{1 + e^{t}}{1 + e^{s}}\right)}^{c_n}\]

Derivation

  1. Split input into 2 regimes
  2. if (* (* (* (* (cbrt (pow (* (cbrt (- 1 (/ 1 (+ 1 (exp (- s)))))) (cbrt (- 1 (/ 1 (+ 1 (exp (- s))))))) c_n)) (cbrt (pow (* (cbrt (- 1 (/ 1 (+ 1 (exp (- s)))))) (cbrt (- 1 (/ 1 (+ 1 (exp (- s))))))) c_n))) (/ (cbrt (pow (* (cbrt (- 1 (/ 1 (+ 1 (exp (- s)))))) (cbrt (- 1 (/ 1 (+ 1 (exp (- s))))))) c_n)) (pow (* (cbrt (- 1 (/ 1 (+ 1 (exp (- t)))))) (cbrt (- 1 (/ 1 (+ 1 (exp (- t))))))) c_n))) (* (* (cbrt (/ (pow (cbrt (- 1 (/ 1 (+ 1 (exp (- s)))))) c_n) (pow (cbrt (- 1 (/ 1 (+ 1 (exp (- t)))))) c_n))) (cbrt (/ (pow (cbrt (- 1 (/ 1 (+ 1 (exp (- s)))))) c_n) (pow (cbrt (- 1 (/ 1 (+ 1 (exp (- t)))))) c_n)))) (cbrt (/ (pow (cbrt (- 1 (/ 1 (+ 1 (exp (- s)))))) c_n) (pow (cbrt (- 1 (/ 1 (+ 1 (exp (- t)))))) c_n))))) (/ (pow (/ 1 (+ 1 (exp (- s)))) c_p) (+ (* c_p (+ (log 1/2) (* t 1/2))) 1))) < 0.9999166162474663

    1. Initial program 5.0

      \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c_n}}\]
    2. Taylor expanded around 0 2.5

      \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c_n}}{\color{blue}{\left(1 + \left(\frac{1}{2} \cdot \left(t \cdot c_p\right) + \log \frac{1}{2} \cdot c_p\right)\right)} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c_n}}\]
    3. Applied simplify2.5

      \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c_n}} \cdot \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c_p}}{c_p \cdot \left(\log \frac{1}{2} + t \cdot \frac{1}{2}\right) + 1}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt2.5

      \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c_n}}{{\color{blue}{\left(\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right) \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}}^{c_n}} \cdot \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c_p}}{c_p \cdot \left(\log \frac{1}{2} + t \cdot \frac{1}{2}\right) + 1}\]
    6. Applied unpow-prod-down2.5

      \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c_n}}{\color{blue}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n} \cdot {\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}}} \cdot \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c_p}}{c_p \cdot \left(\log \frac{1}{2} + t \cdot \frac{1}{2}\right) + 1}\]
    7. Applied add-cube-cbrt2.5

      \[\leadsto \frac{{\color{blue}{\left(\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right) \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}}^{c_n}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n} \cdot {\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}} \cdot \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c_p}}{c_p \cdot \left(\log \frac{1}{2} + t \cdot \frac{1}{2}\right) + 1}\]
    8. Applied unpow-prod-down2.5

      \[\leadsto \frac{\color{blue}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n} \cdot {\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n} \cdot {\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}} \cdot \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c_p}}{c_p \cdot \left(\log \frac{1}{2} + t \cdot \frac{1}{2}\right) + 1}\]
    9. Applied times-frac2.5

      \[\leadsto \color{blue}{\left(\frac{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}} \cdot \frac{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}}\right)} \cdot \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c_p}}{c_p \cdot \left(\log \frac{1}{2} + t \cdot \frac{1}{2}\right) + 1}\]
    10. Using strategy rm
    11. Applied *-un-lft-identity2.5

      \[\leadsto \left(\frac{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}{\color{blue}{1 \cdot {\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}}} \cdot \frac{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}}\right) \cdot \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c_p}}{c_p \cdot \left(\log \frac{1}{2} + t \cdot \frac{1}{2}\right) + 1}\]
    12. Applied add-cube-cbrt2.5

      \[\leadsto \left(\frac{\color{blue}{\left(\sqrt[3]{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}} \cdot \sqrt[3]{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}\right) \cdot \sqrt[3]{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}}}{1 \cdot {\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}} \cdot \frac{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}}\right) \cdot \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c_p}}{c_p \cdot \left(\log \frac{1}{2} + t \cdot \frac{1}{2}\right) + 1}\]
    13. Applied times-frac2.5

      \[\leadsto \left(\color{blue}{\left(\frac{\sqrt[3]{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}} \cdot \sqrt[3]{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}}{1} \cdot \frac{\sqrt[3]{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}}\right)} \cdot \frac{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}}\right) \cdot \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c_p}}{c_p \cdot \left(\log \frac{1}{2} + t \cdot \frac{1}{2}\right) + 1}\]
    14. Applied simplify2.5

      \[\leadsto \left(\left(\color{blue}{\left(\sqrt[3]{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}} \cdot \sqrt[3]{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}\right)} \cdot \frac{\sqrt[3]{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}}\right) \cdot \frac{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}}\right) \cdot \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c_p}}{c_p \cdot \left(\log \frac{1}{2} + t \cdot \frac{1}{2}\right) + 1}\]
    15. Using strategy rm
    16. Applied add-cube-cbrt2.5

      \[\leadsto \left(\left(\left(\sqrt[3]{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}} \cdot \sqrt[3]{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}\right) \cdot \frac{\sqrt[3]{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}} \cdot \sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}}\right) \cdot \color{blue}{\left(\left(\sqrt[3]{\frac{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}}} \cdot \sqrt[3]{\frac{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}}}\right) \cdot \sqrt[3]{\frac{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-s}}}\right)}^{c_n}}{{\left(\sqrt[3]{1 - \frac{1}{1 + e^{-t}}}\right)}^{c_n}}}\right)}\right) \cdot \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c_p}}{c_p \cdot \left(\log \frac{1}{2} + t \cdot \frac{1}{2}\right) + 1}\]

    if 0.9999166162474663 < (* (* (* (* (cbrt (pow (* (cbrt (- 1 (/ 1 (+ 1 (exp (- s)))))) (cbrt (- 1 (/ 1 (+ 1 (exp (- s))))))) c_n)) (cbrt (pow (* (cbrt (- 1 (/ 1 (+ 1 (exp (- s)))))) (cbrt (- 1 (/ 1 (+ 1 (exp (- s))))))) c_n))) (/ (cbrt (pow (* (cbrt (- 1 (/ 1 (+ 1 (exp (- s)))))) (cbrt (- 1 (/ 1 (+ 1 (exp (- s))))))) c_n)) (pow (* (cbrt (- 1 (/ 1 (+ 1 (exp (- t)))))) (cbrt (- 1 (/ 1 (+ 1 (exp (- t))))))) c_n))) (* (* (cbrt (/ (pow (cbrt (- 1 (/ 1 (+ 1 (exp (- s)))))) c_n) (pow (cbrt (- 1 (/ 1 (+ 1 (exp (- t)))))) c_n))) (cbrt (/ (pow (cbrt (- 1 (/ 1 (+ 1 (exp (- s)))))) c_n) (pow (cbrt (- 1 (/ 1 (+ 1 (exp (- t)))))) c_n)))) (cbrt (/ (pow (cbrt (- 1 (/ 1 (+ 1 (exp (- s)))))) c_n) (pow (cbrt (- 1 (/ 1 (+ 1 (exp (- t)))))) c_n))))) (/ (pow (/ 1 (+ 1 (exp (- s)))) c_p) (+ (* c_p (+ (log 1/2) (* t 1/2))) 1)))

    1. Initial program 3.1

      \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c_n}}\]
    2. Taylor expanded around 0 1.5

      \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \left(s \cdot c_p\right) + 1\right) - \frac{1}{2} \cdot \left(c_n \cdot s\right)}\]
    3. Applied simplify1.5

      \[\leadsto \color{blue}{1 + \left(c_p - c_n\right) \cdot \left(s \cdot \frac{1}{2}\right)}\]
  3. Recombined 2 regimes into one program.

Runtime

Time bar (total: 4.5m)Debug logProfile

herbie shell --seed '#(1071246582 2318319007 2683472949 3810440501 3233274817 2724848749)' 
(FPCore (c_p c_n t s)
  :name "Harley's example"
  :pre (and (< 0 c_p) (< 0 c_n))

  :herbie-target
  (* (pow (/ (+ 1 (exp (- t))) (+ 1 (exp (- s)))) c_p) (pow (/ (+ 1 (exp t)) (+ 1 (exp s))) c_n))

  (/ (* (pow (/ 1 (+ 1 (exp (- s)))) c_p) (pow (- 1 (/ 1 (+ 1 (exp (- s))))) c_n)) (* (pow (/ 1 (+ 1 (exp (- t)))) c_p) (pow (- 1 (/ 1 (+ 1 (exp (- t))))) c_n))))