Average Error: 2.5 → 1.0
Time: 34.9s
Precision: 64
\[9 \le a \le 9 \land \frac{471}{100} \le b \le \frac{489}{100} \land \frac{471}{100} \le c \le \frac{489}{100}\]
\[\sqrt{\left(\left(\frac{\left(a + b\right) + c}{2} \cdot \left(\frac{\left(a + b\right) + c}{2} - a\right)\right) \cdot \left(\frac{\left(a + b\right) + c}{2} - b\right)\right) \cdot \left(\frac{\left(a + b\right) + c}{2} - c\right)}\]
\[\sqrt{e^{\log \left(\left(\frac{c + \left(a + b\right)}{2} \cdot \left(\frac{c + \left(a + b\right)}{2} - c\right)\right) \cdot \left(\left(\left(c - a\right) + b\right) \cdot \left(\frac{1}{2} \cdot \left(\frac{c + \left(a + b\right)}{2} - b\right)\right)\right)\right)}}\]
\sqrt{\left(\left(\frac{\left(a + b\right) + c}{2} \cdot \left(\frac{\left(a + b\right) + c}{2} - a\right)\right) \cdot \left(\frac{\left(a + b\right) + c}{2} - b\right)\right) \cdot \left(\frac{\left(a + b\right) + c}{2} - c\right)}
\sqrt{e^{\log \left(\left(\frac{c + \left(a + b\right)}{2} \cdot \left(\frac{c + \left(a + b\right)}{2} - c\right)\right) \cdot \left(\left(\left(c - a\right) + b\right) \cdot \left(\frac{1}{2} \cdot \left(\frac{c + \left(a + b\right)}{2} - b\right)\right)\right)\right)}}
double f(double a, double b, double c) {
        double r38768648 = a;
        double r38768649 = b;
        double r38768650 = r38768648 + r38768649;
        double r38768651 = c;
        double r38768652 = r38768650 + r38768651;
        double r38768653 = 2.0;
        double r38768654 = r38768652 / r38768653;
        double r38768655 = r38768654 - r38768648;
        double r38768656 = r38768654 * r38768655;
        double r38768657 = r38768654 - r38768649;
        double r38768658 = r38768656 * r38768657;
        double r38768659 = r38768654 - r38768651;
        double r38768660 = r38768658 * r38768659;
        double r38768661 = sqrt(r38768660);
        return r38768661;
}

double f(double a, double b, double c) {
        double r38768662 = c;
        double r38768663 = a;
        double r38768664 = b;
        double r38768665 = r38768663 + r38768664;
        double r38768666 = r38768662 + r38768665;
        double r38768667 = 2.0;
        double r38768668 = r38768666 / r38768667;
        double r38768669 = r38768668 - r38768662;
        double r38768670 = r38768668 * r38768669;
        double r38768671 = r38768662 - r38768663;
        double r38768672 = r38768671 + r38768664;
        double r38768673 = 0.5;
        double r38768674 = r38768668 - r38768664;
        double r38768675 = r38768673 * r38768674;
        double r38768676 = r38768672 * r38768675;
        double r38768677 = r38768670 * r38768676;
        double r38768678 = log(r38768677);
        double r38768679 = exp(r38768678);
        double r38768680 = sqrt(r38768679);
        return r38768680;
}

Error

Bits error versus b

Bits error versus c

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 2.5

    \[\sqrt{\left(\left(\frac{\left(a + b\right) + c}{2} \cdot \left(\frac{\left(a + b\right) + c}{2} - a\right)\right) \cdot \left(\frac{\left(a + b\right) + c}{2} - b\right)\right) \cdot \left(\frac{\left(a + b\right) + c}{2} - c\right)}\]
  2. Taylor expanded around 0 1.8

    \[\leadsto \sqrt{\left(\left(\frac{\left(a + b\right) + c}{2} \cdot \color{blue}{\left(\left(\frac{1}{2} \cdot b + \frac{1}{2} \cdot c\right) - \frac{1}{2} \cdot a\right)}\right) \cdot \left(\frac{\left(a + b\right) + c}{2} - b\right)\right) \cdot \left(\frac{\left(a + b\right) + c}{2} - c\right)}\]
  3. Simplified1.8

    \[\leadsto \sqrt{\left(\left(\frac{\left(a + b\right) + c}{2} \cdot \color{blue}{\left(\frac{1}{2} \cdot \left(\left(b + c\right) - a\right)\right)}\right) \cdot \left(\frac{\left(a + b\right) + c}{2} - b\right)\right) \cdot \left(\frac{\left(a + b\right) + c}{2} - c\right)}\]
  4. Using strategy rm
  5. Applied add-exp-log1.8

    \[\leadsto \sqrt{\left(\left(\frac{\left(a + b\right) + c}{2} \cdot \left(\frac{1}{2} \cdot \left(\left(b + c\right) - a\right)\right)\right) \cdot \left(\frac{\left(a + b\right) + c}{2} - b\right)\right) \cdot \color{blue}{e^{\log \left(\frac{\left(a + b\right) + c}{2} - c\right)}}}\]
  6. Applied add-exp-log1.8

    \[\leadsto \sqrt{\left(\left(\frac{\left(a + b\right) + c}{2} \cdot \left(\frac{1}{2} \cdot \left(\left(b + c\right) - a\right)\right)\right) \cdot \color{blue}{e^{\log \left(\frac{\left(a + b\right) + c}{2} - b\right)}}\right) \cdot e^{\log \left(\frac{\left(a + b\right) + c}{2} - c\right)}}\]
  7. Applied add-exp-log1.8

    \[\leadsto \sqrt{\left(\left(\frac{\left(a + b\right) + c}{2} \cdot \color{blue}{e^{\log \left(\frac{1}{2} \cdot \left(\left(b + c\right) - a\right)\right)}}\right) \cdot e^{\log \left(\frac{\left(a + b\right) + c}{2} - b\right)}\right) \cdot e^{\log \left(\frac{\left(a + b\right) + c}{2} - c\right)}}\]
  8. Applied add-exp-log1.8

    \[\leadsto \sqrt{\left(\left(\frac{\left(a + b\right) + c}{\color{blue}{e^{\log 2}}} \cdot e^{\log \left(\frac{1}{2} \cdot \left(\left(b + c\right) - a\right)\right)}\right) \cdot e^{\log \left(\frac{\left(a + b\right) + c}{2} - b\right)}\right) \cdot e^{\log \left(\frac{\left(a + b\right) + c}{2} - c\right)}}\]
  9. Applied add-exp-log1.9

    \[\leadsto \sqrt{\left(\left(\frac{\color{blue}{e^{\log \left(\left(a + b\right) + c\right)}}}{e^{\log 2}} \cdot e^{\log \left(\frac{1}{2} \cdot \left(\left(b + c\right) - a\right)\right)}\right) \cdot e^{\log \left(\frac{\left(a + b\right) + c}{2} - b\right)}\right) \cdot e^{\log \left(\frac{\left(a + b\right) + c}{2} - c\right)}}\]
  10. Applied div-exp1.9

    \[\leadsto \sqrt{\left(\left(\color{blue}{e^{\log \left(\left(a + b\right) + c\right) - \log 2}} \cdot e^{\log \left(\frac{1}{2} \cdot \left(\left(b + c\right) - a\right)\right)}\right) \cdot e^{\log \left(\frac{\left(a + b\right) + c}{2} - b\right)}\right) \cdot e^{\log \left(\frac{\left(a + b\right) + c}{2} - c\right)}}\]
  11. Applied prod-exp1.9

    \[\leadsto \sqrt{\left(\color{blue}{e^{\left(\log \left(\left(a + b\right) + c\right) - \log 2\right) + \log \left(\frac{1}{2} \cdot \left(\left(b + c\right) - a\right)\right)}} \cdot e^{\log \left(\frac{\left(a + b\right) + c}{2} - b\right)}\right) \cdot e^{\log \left(\frac{\left(a + b\right) + c}{2} - c\right)}}\]
  12. Applied prod-exp1.9

    \[\leadsto \sqrt{\color{blue}{e^{\left(\left(\log \left(\left(a + b\right) + c\right) - \log 2\right) + \log \left(\frac{1}{2} \cdot \left(\left(b + c\right) - a\right)\right)\right) + \log \left(\frac{\left(a + b\right) + c}{2} - b\right)}} \cdot e^{\log \left(\frac{\left(a + b\right) + c}{2} - c\right)}}\]
  13. Applied prod-exp2.0

    \[\leadsto \sqrt{\color{blue}{e^{\left(\left(\left(\log \left(\left(a + b\right) + c\right) - \log 2\right) + \log \left(\frac{1}{2} \cdot \left(\left(b + c\right) - a\right)\right)\right) + \log \left(\frac{\left(a + b\right) + c}{2} - b\right)\right) + \log \left(\frac{\left(a + b\right) + c}{2} - c\right)}}}\]
  14. Simplified1.0

    \[\leadsto \sqrt{e^{\color{blue}{\log \left(\left(\left(\frac{\left(a + b\right) + c}{2} - c\right) \cdot \frac{\left(a + b\right) + c}{2}\right) \cdot \left(\left(b + \left(c - a\right)\right) \cdot \left(\frac{1}{2} \cdot \left(\frac{\left(a + b\right) + c}{2} - b\right)\right)\right)\right)}}}\]
  15. Final simplification1.0

    \[\leadsto \sqrt{e^{\log \left(\left(\frac{c + \left(a + b\right)}{2} \cdot \left(\frac{c + \left(a + b\right)}{2} - c\right)\right) \cdot \left(\left(\left(c - a\right) + b\right) \cdot \left(\frac{1}{2} \cdot \left(\frac{c + \left(a + b\right)}{2} - b\right)\right)\right)\right)}}\]

Reproduce

herbie shell --seed 1 
(FPCore (a b c)
  :name "triangle"
  :pre (and (<= 9 a 9) (<= 471/100 b 489/100) (<= 471/100 c 489/100))
  (sqrt (* (* (* (/ (+ (+ a b) c) 2) (- (/ (+ (+ a b) c) 2) a)) (- (/ (+ (+ a b) c) 2) b)) (- (/ (+ (+ a b) c) 2) c))))