?

Average Accuracy: 99.5% → 99.5%
Time: 13.8s
Precision: binary64
Cost: 13632

?

\[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
\[\left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(z + z\right) \cdot e^{t \cdot t}} \]
(FPCore (x y z t)
 :precision binary64
 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))
(FPCore (x y z t)
 :precision binary64
 (* (- (* x 0.5) y) (sqrt (* (+ z z) (exp (* t t))))))
double code(double x, double y, double z, double t) {
	return (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0));
}
double code(double x, double y, double z, double t) {
	return ((x * 0.5) - y) * sqrt(((z + z) * exp((t * t))));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (((x * 0.5d0) - y) * sqrt((z * 2.0d0))) * exp(((t * t) / 2.0d0))
end function
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((x * 0.5d0) - y) * sqrt(((z + z) * exp((t * t))))
end function
public static double code(double x, double y, double z, double t) {
	return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.exp(((t * t) / 2.0));
}
public static double code(double x, double y, double z, double t) {
	return ((x * 0.5) - y) * Math.sqrt(((z + z) * Math.exp((t * t))));
}
def code(x, y, z, t):
	return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.exp(((t * t) / 2.0))
def code(x, y, z, t):
	return ((x * 0.5) - y) * math.sqrt(((z + z) * math.exp((t * t))))
function code(x, y, z, t)
	return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * exp(Float64(Float64(t * t) / 2.0)))
end
function code(x, y, z, t)
	return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(z + z) * exp(Float64(t * t)))))
end
function tmp = code(x, y, z, t)
	tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0));
end
function tmp = code(x, y, z, t)
	tmp = ((x * 0.5) - y) * sqrt(((z + z) * exp((t * t))));
end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[(z + z), $MachinePrecision] * N[Exp[N[(t * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}
\left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(z + z\right) \cdot e^{t \cdot t}}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original99.5%
Target99.5%
Herbie99.5%
\[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot {\left(e^{1}\right)}^{\left(\frac{t \cdot t}{2}\right)} \]

Derivation?

  1. Initial program 99.5%

    \[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
  2. Simplified99.5%

    \[\leadsto \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot {\left(\sqrt{e^{t}}\right)}^{t}\right)} \]
    Proof

    [Start]99.5

    \[ \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]

    associate-*l* [=>]99.5

    \[ \color{blue}{\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\frac{t \cdot t}{2}}\right)} \]

    associate-*l/ [<=]99.5

    \[ \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot e^{\color{blue}{\frac{t}{2} \cdot t}}\right) \]

    exp-prod [=>]99.5

    \[ \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \color{blue}{{\left(e^{\frac{t}{2}}\right)}^{t}}\right) \]

    exp-sqrt [=>]99.5

    \[ \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot {\color{blue}{\left(\sqrt{e^{t}}\right)}}^{t}\right) \]
  3. Applied egg-rr99.5%

    \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(0 + \sqrt{\left(z + z\right) \cdot {\left(e^{t}\right)}^{t}}\right)} \]
    Proof

    [Start]99.5

    \[ \left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot {\left(\sqrt{e^{t}}\right)}^{t}\right) \]

    add-log-exp [=>]7.2

    \[ \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\log \left(e^{\sqrt{z \cdot 2} \cdot {\left(\sqrt{e^{t}}\right)}^{t}}\right)} \]

    *-un-lft-identity [=>]7.2

    \[ \left(x \cdot 0.5 - y\right) \cdot \log \color{blue}{\left(1 \cdot e^{\sqrt{z \cdot 2} \cdot {\left(\sqrt{e^{t}}\right)}^{t}}\right)} \]

    log-prod [=>]7.2

    \[ \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\left(\log 1 + \log \left(e^{\sqrt{z \cdot 2} \cdot {\left(\sqrt{e^{t}}\right)}^{t}}\right)\right)} \]

    metadata-eval [=>]7.2

    \[ \left(x \cdot 0.5 - y\right) \cdot \left(\color{blue}{0} + \log \left(e^{\sqrt{z \cdot 2} \cdot {\left(\sqrt{e^{t}}\right)}^{t}}\right)\right) \]

    add-log-exp [<=]99.5

    \[ \left(x \cdot 0.5 - y\right) \cdot \left(0 + \color{blue}{\sqrt{z \cdot 2} \cdot {\left(\sqrt{e^{t}}\right)}^{t}}\right) \]

    add-sqr-sqrt [=>]99.0

    \[ \left(x \cdot 0.5 - y\right) \cdot \left(0 + \color{blue}{\sqrt{\sqrt{z \cdot 2} \cdot {\left(\sqrt{e^{t}}\right)}^{t}} \cdot \sqrt{\sqrt{z \cdot 2} \cdot {\left(\sqrt{e^{t}}\right)}^{t}}}\right) \]

    sqrt-unprod [=>]99.5

    \[ \left(x \cdot 0.5 - y\right) \cdot \left(0 + \color{blue}{\sqrt{\left(\sqrt{z \cdot 2} \cdot {\left(\sqrt{e^{t}}\right)}^{t}\right) \cdot \left(\sqrt{z \cdot 2} \cdot {\left(\sqrt{e^{t}}\right)}^{t}\right)}}\right) \]

    swap-sqr [=>]99.5

    \[ \left(x \cdot 0.5 - y\right) \cdot \left(0 + \sqrt{\color{blue}{\left(\sqrt{z \cdot 2} \cdot \sqrt{z \cdot 2}\right) \cdot \left({\left(\sqrt{e^{t}}\right)}^{t} \cdot {\left(\sqrt{e^{t}}\right)}^{t}\right)}}\right) \]

    add-sqr-sqrt [<=]99.5

    \[ \left(x \cdot 0.5 - y\right) \cdot \left(0 + \sqrt{\color{blue}{\left(z \cdot 2\right)} \cdot \left({\left(\sqrt{e^{t}}\right)}^{t} \cdot {\left(\sqrt{e^{t}}\right)}^{t}\right)}\right) \]

    add-log-exp [=>]5.0

    \[ \left(x \cdot 0.5 - y\right) \cdot \left(0 + \sqrt{\color{blue}{\log \left(e^{z \cdot 2}\right)} \cdot \left({\left(\sqrt{e^{t}}\right)}^{t} \cdot {\left(\sqrt{e^{t}}\right)}^{t}\right)}\right) \]

    exp-lft-sqr [=>]5.0

    \[ \left(x \cdot 0.5 - y\right) \cdot \left(0 + \sqrt{\log \color{blue}{\left(e^{z} \cdot e^{z}\right)} \cdot \left({\left(\sqrt{e^{t}}\right)}^{t} \cdot {\left(\sqrt{e^{t}}\right)}^{t}\right)}\right) \]

    log-prod [=>]5.0

    \[ \left(x \cdot 0.5 - y\right) \cdot \left(0 + \sqrt{\color{blue}{\left(\log \left(e^{z}\right) + \log \left(e^{z}\right)\right)} \cdot \left({\left(\sqrt{e^{t}}\right)}^{t} \cdot {\left(\sqrt{e^{t}}\right)}^{t}\right)}\right) \]

    add-log-exp [<=]14.0

    \[ \left(x \cdot 0.5 - y\right) \cdot \left(0 + \sqrt{\left(\color{blue}{z} + \log \left(e^{z}\right)\right) \cdot \left({\left(\sqrt{e^{t}}\right)}^{t} \cdot {\left(\sqrt{e^{t}}\right)}^{t}\right)}\right) \]

    add-log-exp [<=]99.5

    \[ \left(x \cdot 0.5 - y\right) \cdot \left(0 + \sqrt{\left(z + \color{blue}{z}\right) \cdot \left({\left(\sqrt{e^{t}}\right)}^{t} \cdot {\left(\sqrt{e^{t}}\right)}^{t}\right)}\right) \]

    pow-prod-down [=>]99.5

    \[ \left(x \cdot 0.5 - y\right) \cdot \left(0 + \sqrt{\left(z + z\right) \cdot \color{blue}{{\left(\sqrt{e^{t}} \cdot \sqrt{e^{t}}\right)}^{t}}}\right) \]

    add-sqr-sqrt [<=]99.5

    \[ \left(x \cdot 0.5 - y\right) \cdot \left(0 + \sqrt{\left(z + z\right) \cdot {\color{blue}{\left(e^{t}\right)}}^{t}}\right) \]
  4. Simplified99.5%

    \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\sqrt{\left(z + z\right) \cdot {\left(e^{t}\right)}^{t}}} \]
    Proof

    [Start]99.5

    \[ \left(x \cdot 0.5 - y\right) \cdot \left(0 + \sqrt{\left(z + z\right) \cdot {\left(e^{t}\right)}^{t}}\right) \]

    +-lft-identity [=>]99.5

    \[ \left(x \cdot 0.5 - y\right) \cdot \color{blue}{\sqrt{\left(z + z\right) \cdot {\left(e^{t}\right)}^{t}}} \]
  5. Taylor expanded in z around 0 99.5%

    \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\color{blue}{2 \cdot \left(z \cdot e^{{t}^{2}}\right)}} \]
  6. Simplified99.5%

    \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\color{blue}{\left(z + z\right) \cdot e^{t \cdot t}}} \]
    Proof

    [Start]99.5

    \[ \left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot \left(z \cdot e^{{t}^{2}}\right)} \]

    associate-*r* [=>]99.5

    \[ \left(x \cdot 0.5 - y\right) \cdot \sqrt{\color{blue}{\left(2 \cdot z\right) \cdot e^{{t}^{2}}}} \]

    unpow2 [=>]99.5

    \[ \left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(2 \cdot z\right) \cdot e^{\color{blue}{t \cdot t}}} \]

    count-2 [<=]99.5

    \[ \left(x \cdot 0.5 - y\right) \cdot \sqrt{\color{blue}{\left(z + z\right)} \cdot e^{t \cdot t}} \]
  7. Final simplification99.5%

    \[\leadsto \left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(z + z\right) \cdot e^{t \cdot t}} \]

Alternatives

Alternative 1
Accuracy98.7%
Cost7488
\[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \left(1 + 0.5 \cdot \left(t \cdot t\right)\right) \]
Alternative 2
Accuracy98.7%
Cost7360
\[\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot \left(z + z \cdot \left(t \cdot t\right)\right)} \]
Alternative 3
Accuracy18.8%
Cost7236
\[\begin{array}{l} \mathbf{if}\;x \cdot 0.5 - y \leq 10^{-207}:\\ \;\;\;\;z \cdot \left(x + y \cdot -2\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(y \cdot \left(y \cdot z\right)\right)}\\ \end{array} \]
Alternative 4
Accuracy33.5%
Cost7176
\[\begin{array}{l} t_1 := \sqrt{2 \cdot \left(y \cdot \left(y \cdot z\right)\right)}\\ \mathbf{if}\;y \leq -2.45 \cdot 10^{-108}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.55 \cdot 10^{-120}:\\ \;\;\;\;\sqrt{z \cdot \left(0.5 \cdot \left(x \cdot x\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;-t_1\\ \end{array} \]
Alternative 5
Accuracy23.3%
Cost7108
\[\begin{array}{l} \mathbf{if}\;x \cdot 0.5 \leq 10^{-120}:\\ \;\;\;\;\sqrt{2 \cdot \left(y \cdot \left(y \cdot z\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{z \cdot \left(0.5 \cdot \left(x \cdot x\right)\right)}\\ \end{array} \]
Alternative 6
Accuracy98.2%
Cost6976
\[\left(x \cdot 0.5 - y\right) \cdot \sqrt{z + z} \]
Alternative 7
Accuracy7.4%
Cost448
\[z \cdot \left(x + y \cdot -2\right) \]
Alternative 8
Accuracy5.9%
Cost320
\[\left(y \cdot z\right) \cdot -2 \]
Alternative 9
Accuracy6.0%
Cost192
\[x \cdot z \]

Error

Reproduce?

herbie shell --seed 2023136 
(FPCore (x y z t)
  :name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, A"
  :precision binary64

  :herbie-target
  (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (pow (exp 1.0) (/ (* t t) 2.0)))

  (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))