Average Error: 28.6 → 0.0
Time: 41.2s
Precision: 64
Internal Precision: 1344
\[\frac{2}{1 + e^{-2 \cdot x}} - 1\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.007065050963765869 \lor \neg \left(x \le 0.007466726183558596\right):\\ \;\;\;\;\frac{\log \left(e^{\frac{4}{\left(e^{-2 \cdot x} + 1\right) \cdot \left(e^{-2 \cdot x} + 1\right)} - 1}\right)}{1 + \frac{2}{e^{-2 \cdot x} + 1}}\\ \mathbf{else}:\\ \;\;\;\;\left({x}^{5} \cdot \frac{2}{15} + 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 x < -0.007065050963765869 or 0.007466726183558596 < x

    1. Initial program 0.0

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

      \[\leadsto \color{blue}{\frac{\frac{2}{1 + e^{-2 \cdot x}} \cdot \frac{2}{1 + e^{-2 \cdot x}} - 1 \cdot 1}{\frac{2}{1 + e^{-2 \cdot x}} + 1}}\]
    4. Using strategy rm
    5. Applied add-log-exp0.0

      \[\leadsto \frac{\frac{2}{1 + e^{-2 \cdot x}} \cdot \frac{2}{1 + e^{-2 \cdot x}} - \color{blue}{\log \left(e^{1 \cdot 1}\right)}}{\frac{2}{1 + e^{-2 \cdot x}} + 1}\]
    6. Applied add-log-exp0.0

      \[\leadsto \frac{\color{blue}{\log \left(e^{\frac{2}{1 + e^{-2 \cdot x}} \cdot \frac{2}{1 + e^{-2 \cdot x}}}\right)} - \log \left(e^{1 \cdot 1}\right)}{\frac{2}{1 + e^{-2 \cdot x}} + 1}\]
    7. Applied diff-log0.0

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

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

    if -0.007065050963765869 < x < 0.007466726183558596

    1. Initial program 58.7

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

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

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

Runtime

Time bar (total: 41.2s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes28.60.00.028.6100%
herbie shell --seed 2018296 
(FPCore (x y)
  :name "Logistic function from Lakshay Garg"
  (- (/ 2 (+ 1 (exp (* -2 x)))) 1))