Average Error: 28.8 → 0.1
Time: 1.7m
Precision: 64
Internal Precision: 1344
\[\frac{2}{1 + e^{-2 \cdot x}} - 1\]
\[\begin{array}{l} \mathbf{if}\;e^{x \cdot -2} + 1 \le 1.9332077667223637 \lor \neg \left(e^{x \cdot -2} + 1 \le 2.0000647776950835\right):\\ \;\;\;\;\log \left(\frac{{\left(e \cdot {\left(e^{e^{x \cdot -2}}\right)}^{\left(e^{x \cdot -2} - 1\right)}\right)}^{\left(\frac{2}{{\left(e^{x \cdot -2}\right)}^{3} + 1}\right)}}{e}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{2}{15} \cdot {x}^{5} + x\right) - {x}^{3} \cdot \frac{1}{3}\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if (+ 1 (exp (* -2 x))) < 1.9332077667223637 or 2.0000647776950835 < (+ 1 (exp (* -2 x)))

    1. Initial program 0.0

      \[\frac{2}{1 + e^{-2 \cdot x}} - 1\]
    2. Using strategy rm
    3. Applied flip3-+31.8

      \[\leadsto \frac{2}{\color{blue}{\frac{{1}^{3} + {\left(e^{-2 \cdot x}\right)}^{3}}{1 \cdot 1 + \left(e^{-2 \cdot x} \cdot e^{-2 \cdot x} - 1 \cdot e^{-2 \cdot x}\right)}}} - 1\]
    4. Applied associate-/r/31.8

      \[\leadsto \color{blue}{\frac{2}{{1}^{3} + {\left(e^{-2 \cdot x}\right)}^{3}} \cdot \left(1 \cdot 1 + \left(e^{-2 \cdot x} \cdot e^{-2 \cdot x} - 1 \cdot e^{-2 \cdot x}\right)\right)} - 1\]
    5. Applied simplify31.8

      \[\leadsto \color{blue}{\frac{2}{{\left(e^{x \cdot -2}\right)}^{3} + 1}} \cdot \left(1 \cdot 1 + \left(e^{-2 \cdot x} \cdot e^{-2 \cdot x} - 1 \cdot e^{-2 \cdot x}\right)\right) - 1\]
    6. Using strategy rm
    7. Applied add-log-exp31.8

      \[\leadsto \color{blue}{\log \left(e^{\frac{2}{{\left(e^{x \cdot -2}\right)}^{3} + 1} \cdot \left(1 \cdot 1 + \left(e^{-2 \cdot x} \cdot e^{-2 \cdot x} - 1 \cdot e^{-2 \cdot x}\right)\right) - 1}\right)}\]
    8. Applied simplify0.1

      \[\leadsto \log \color{blue}{\left(\frac{{\left(e \cdot {\left(e^{e^{-2 \cdot x}}\right)}^{\left(e^{-2 \cdot x} - 1\right)}\right)}^{\left(\frac{2}{{\left(e^{-2 \cdot x}\right)}^{3} + 1}\right)}}{e}\right)}\]

    if 1.9332077667223637 < (+ 1 (exp (* -2 x))) < 2.0000647776950835

    1. Initial program 59.0

      \[\frac{2}{1 + e^{-2 \cdot x}} - 1\]
    2. Taylor expanded around 0 0.0

      \[\leadsto \color{blue}{\left(\frac{2}{15} \cdot {x}^{5} + x\right) - \frac{1}{3} \cdot {x}^{3}}\]
  3. Recombined 2 regimes into one program.
  4. Applied simplify0.1

    \[\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;e^{x \cdot -2} + 1 \le 1.9332077667223637 \lor \neg \left(e^{x \cdot -2} + 1 \le 2.0000647776950835\right):\\ \;\;\;\;\log \left(\frac{{\left(e \cdot {\left(e^{e^{x \cdot -2}}\right)}^{\left(e^{x \cdot -2} - 1\right)}\right)}^{\left(\frac{2}{{\left(e^{x \cdot -2}\right)}^{3} + 1}\right)}}{e}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{2}{15} \cdot {x}^{5} + x\right) - {x}^{3} \cdot \frac{1}{3}\\ \end{array}}\]

Runtime

Time bar (total: 1.7m)Debug logProfile

herbie shell --seed '#(1072936661 1621281212 3440817831 3219514234 460296804 1258167384)' 
(FPCore (x y)
  :name "Logistic function from Lakshay Garg"
  (- (/ 2 (+ 1 (exp (* -2 x)))) 1))