Average Error: 0.3 → 0.3
Time: 53.0s
Precision: binary64
Cost: 20096
\[\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}} \]
\[\sqrt{z \cdot 2} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot {\left(e^{t}\right)}^{\left(0.5 \cdot t\right)}\right) \]
(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
 (* (sqrt (* z 2.0)) (* (- (* x 0.5) y) (pow (exp t) (* 0.5 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 sqrt((z * 2.0)) * (((x * 0.5) - y) * pow(exp(t), (0.5 * 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 = sqrt((z * 2.0d0)) * (((x * 0.5d0) - y) * (exp(t) ** (0.5d0 * 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 Math.sqrt((z * 2.0)) * (((x * 0.5) - y) * Math.pow(Math.exp(t), (0.5 * 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 math.sqrt((z * 2.0)) * (((x * 0.5) - y) * math.pow(math.exp(t), (0.5 * 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(sqrt(Float64(z * 2.0)) * Float64(Float64(Float64(x * 0.5) - y) * (exp(t) ^ Float64(0.5 * 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 = sqrt((z * 2.0)) * (((x * 0.5) - y) * (exp(t) ^ (0.5 * 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[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Power[N[Exp[t], $MachinePrecision], N[(0.5 * t), $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}}
\sqrt{z \cdot 2} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot {\left(e^{t}\right)}^{\left(0.5 \cdot t\right)}\right)

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.3
Target0.3
Herbie0.3
\[\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 0.3

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

    \[\leadsto \color{blue}{\sqrt{z \cdot 2} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{{\left(e^{t}\right)}^{t}}\right)} \]
    Proof
    (*.f64 (sqrt.f64 (*.f64 z 2)) (*.f64 (-.f64 (*.f64 x 1/2) y) (sqrt.f64 (pow.f64 (exp.f64 t) t)))): 0 points increase in error, 0 points decrease in error
    (*.f64 (sqrt.f64 (*.f64 z 2)) (*.f64 (-.f64 (*.f64 x 1/2) y) (sqrt.f64 (Rewrite<= exp-prod_binary64 (exp.f64 (*.f64 t t)))))): 0 points increase in error, 0 points decrease in error
    (*.f64 (sqrt.f64 (*.f64 z 2)) (*.f64 (-.f64 (*.f64 x 1/2) y) (Rewrite<= exp-sqrt_binary64 (exp.f64 (/.f64 (*.f64 t t) 2))))): 0 points increase in error, 1 points decrease in error
    (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (sqrt.f64 (*.f64 z 2)) (-.f64 (*.f64 x 1/2) y)) (exp.f64 (/.f64 (*.f64 t t) 2)))): 3 points increase in error, 1 points decrease in error
    (*.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 (*.f64 x 1/2) y) (sqrt.f64 (*.f64 z 2)))) (exp.f64 (/.f64 (*.f64 t t) 2))): 0 points increase in error, 0 points decrease in error
  3. Applied egg-rr0.3

    \[\leadsto \sqrt{z \cdot 2} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \color{blue}{{\left(e^{t}\right)}^{\left(t \cdot 0.5\right)}}\right) \]
  4. Final simplification0.3

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

Alternatives

Alternative 1
Error0.4
Cost13760
\[\sqrt{z \cdot 2} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot e^{0.5 \cdot \left(t \cdot t\right)}\right) \]
Alternative 2
Error0.4
Cost13632
\[\left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(z + z\right) \cdot e^{t \cdot t}} \]
Alternative 3
Error0.9
Cost7488
\[\sqrt{z \cdot 2} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \left(1 + t \cdot \left(0.5 \cdot t\right)\right)\right) \]
Alternative 4
Error18.5
Cost7376
\[\begin{array}{l} t_1 := \sqrt{z + z}\\ t_2 := y \cdot \left(-t_1\right)\\ t_3 := 0.5 \cdot \left(x \cdot t_1\right)\\ \mathbf{if}\;x \leq -1.65 \cdot 10^{+18}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -0.082:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -4.5 \cdot 10^{-141}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq 7.2 \cdot 10^{+47}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 5
Error1.3
Cost6976
\[\left(x \cdot 0.5 - y\right) \cdot \sqrt{z + z} \]
Alternative 6
Error31.6
Cost6784
\[y \cdot \left(-\sqrt{z + z}\right) \]
Alternative 7
Error60.2
Cost320
\[x \cdot \left(z + z\right) \]
Alternative 8
Error60.3
Cost260
\[\begin{array}{l} \mathbf{if}\;z \leq 1.08 \cdot 10^{-142}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;-y\\ \end{array} \]
Alternative 9
Error60.2
Cost192
\[z \cdot x \]
Alternative 10
Error61.5
Cost64
\[0 \]

Error

Reproduce

herbie shell --seed 2022325 
(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))))