
(FPCore (x) :precision binary64 (* (cos x) (exp (* 10.0 (* x x)))))
double code(double x) {
return cos(x) * exp((10.0 * (x * x)));
}
real(8) function code(x)
real(8), intent (in) :: x
code = cos(x) * exp((10.0d0 * (x * x)))
end function
public static double code(double x) {
return Math.cos(x) * Math.exp((10.0 * (x * x)));
}
def code(x): return math.cos(x) * math.exp((10.0 * (x * x)))
function code(x) return Float64(cos(x) * exp(Float64(10.0 * Float64(x * x)))) end
function tmp = code(x) tmp = cos(x) * exp((10.0 * (x * x))); end
code[x_] := N[(N[Cos[x], $MachinePrecision] * N[Exp[N[(10.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos x \cdot e^{10 \cdot \left(x \cdot x\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x) :precision binary64 (* (cos x) (exp (* 10.0 (* x x)))))
double code(double x) {
return cos(x) * exp((10.0 * (x * x)));
}
real(8) function code(x)
real(8), intent (in) :: x
code = cos(x) * exp((10.0d0 * (x * x)))
end function
public static double code(double x) {
return Math.cos(x) * Math.exp((10.0 * (x * x)));
}
def code(x): return math.cos(x) * math.exp((10.0 * (x * x)))
function code(x) return Float64(cos(x) * exp(Float64(10.0 * Float64(x * x)))) end
function tmp = code(x) tmp = cos(x) * exp((10.0 * (x * x))); end
code[x_] := N[(N[Cos[x], $MachinePrecision] * N[Exp[N[(10.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos x \cdot e^{10 \cdot \left(x \cdot x\right)}
\end{array}
(FPCore (x) :precision binary64 (* (cos x) (exp (* 10.0 (* x x)))))
double code(double x) {
return cos(x) * exp((10.0 * (x * x)));
}
real(8) function code(x)
real(8), intent (in) :: x
code = cos(x) * exp((10.0d0 * (x * x)))
end function
public static double code(double x) {
return Math.cos(x) * Math.exp((10.0 * (x * x)));
}
def code(x): return math.cos(x) * math.exp((10.0 * (x * x)))
function code(x) return Float64(cos(x) * exp(Float64(10.0 * Float64(x * x)))) end
function tmp = code(x) tmp = cos(x) * exp((10.0 * (x * x))); end
code[x_] := N[(N[Cos[x], $MachinePrecision] * N[Exp[N[(10.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos x \cdot e^{10 \cdot \left(x \cdot x\right)}
\end{array}
Initial program 94.5%
(FPCore (x)
:precision binary64
(let* ((t_0 (* x (* x x))))
(*
(-
1.0
(*
(+
0.5
(*
(* x x)
(/
(- -7.233796296296296e-5 (* t_0 (* t_0 2.6791838134430728e-9)))
(+
0.001736111111111111
(+
(* (* (* x x) (* x x)) 1.9290123456790124e-6)
(* -0.041666666666666664 (* (* x x) -0.001388888888888889)))))))
(* x x)))
(exp (* 10.0 (* x x))))))
double code(double x) {
double t_0 = x * (x * x);
return (1.0 - ((0.5 + ((x * x) * ((-7.233796296296296e-5 - (t_0 * (t_0 * 2.6791838134430728e-9))) / (0.001736111111111111 + ((((x * x) * (x * x)) * 1.9290123456790124e-6) + (-0.041666666666666664 * ((x * x) * -0.001388888888888889))))))) * (x * x))) * exp((10.0 * (x * x)));
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
t_0 = x * (x * x)
code = (1.0d0 - ((0.5d0 + ((x * x) * (((-7.233796296296296d-5) - (t_0 * (t_0 * 2.6791838134430728d-9))) / (0.001736111111111111d0 + ((((x * x) * (x * x)) * 1.9290123456790124d-6) + ((-0.041666666666666664d0) * ((x * x) * (-0.001388888888888889d0)))))))) * (x * x))) * exp((10.0d0 * (x * x)))
end function
public static double code(double x) {
double t_0 = x * (x * x);
return (1.0 - ((0.5 + ((x * x) * ((-7.233796296296296e-5 - (t_0 * (t_0 * 2.6791838134430728e-9))) / (0.001736111111111111 + ((((x * x) * (x * x)) * 1.9290123456790124e-6) + (-0.041666666666666664 * ((x * x) * -0.001388888888888889))))))) * (x * x))) * Math.exp((10.0 * (x * x)));
}
def code(x): t_0 = x * (x * x) return (1.0 - ((0.5 + ((x * x) * ((-7.233796296296296e-5 - (t_0 * (t_0 * 2.6791838134430728e-9))) / (0.001736111111111111 + ((((x * x) * (x * x)) * 1.9290123456790124e-6) + (-0.041666666666666664 * ((x * x) * -0.001388888888888889))))))) * (x * x))) * math.exp((10.0 * (x * x)))
function code(x) t_0 = Float64(x * Float64(x * x)) return Float64(Float64(1.0 - Float64(Float64(0.5 + Float64(Float64(x * x) * Float64(Float64(-7.233796296296296e-5 - Float64(t_0 * Float64(t_0 * 2.6791838134430728e-9))) / Float64(0.001736111111111111 + Float64(Float64(Float64(Float64(x * x) * Float64(x * x)) * 1.9290123456790124e-6) + Float64(-0.041666666666666664 * Float64(Float64(x * x) * -0.001388888888888889))))))) * Float64(x * x))) * exp(Float64(10.0 * Float64(x * x)))) end
function tmp = code(x) t_0 = x * (x * x); tmp = (1.0 - ((0.5 + ((x * x) * ((-7.233796296296296e-5 - (t_0 * (t_0 * 2.6791838134430728e-9))) / (0.001736111111111111 + ((((x * x) * (x * x)) * 1.9290123456790124e-6) + (-0.041666666666666664 * ((x * x) * -0.001388888888888889))))))) * (x * x))) * exp((10.0 * (x * x))); end
code[x_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, N[(N[(1.0 - N[(N[(0.5 + N[(N[(x * x), $MachinePrecision] * N[(N[(-7.233796296296296e-5 - N[(t$95$0 * N[(t$95$0 * 2.6791838134430728e-9), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(0.001736111111111111 + N[(N[(N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] * 1.9290123456790124e-6), $MachinePrecision] + N[(-0.041666666666666664 * N[(N[(x * x), $MachinePrecision] * -0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(10.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
\left(1 - \left(0.5 + \left(x \cdot x\right) \cdot \frac{-7.233796296296296 \cdot 10^{-5} - t\_0 \cdot \left(t\_0 \cdot 2.6791838134430728 \cdot 10^{-9}\right)}{0.001736111111111111 + \left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 1.9290123456790124 \cdot 10^{-6} + -0.041666666666666664 \cdot \left(\left(x \cdot x\right) \cdot -0.001388888888888889\right)\right)}\right) \cdot \left(x \cdot x\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)}
\end{array}
\end{array}
Initial program 94.5%
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
Applied egg-rr0
Applied egg-rr0
(FPCore (x)
:precision binary64
(*
(-
1.0
(*
(* x x)
(+
0.5
(/
(* x (* x 0.001736111111111111))
(+ -0.041666666666666664 (* (* x x) -0.001388888888888889))))))
(exp (* x (* 10.0 x)))))
double code(double x) {
return (1.0 - ((x * x) * (0.5 + ((x * (x * 0.001736111111111111)) / (-0.041666666666666664 + ((x * x) * -0.001388888888888889)))))) * exp((x * (10.0 * x)));
}
real(8) function code(x)
real(8), intent (in) :: x
code = (1.0d0 - ((x * x) * (0.5d0 + ((x * (x * 0.001736111111111111d0)) / ((-0.041666666666666664d0) + ((x * x) * (-0.001388888888888889d0))))))) * exp((x * (10.0d0 * x)))
end function
public static double code(double x) {
return (1.0 - ((x * x) * (0.5 + ((x * (x * 0.001736111111111111)) / (-0.041666666666666664 + ((x * x) * -0.001388888888888889)))))) * Math.exp((x * (10.0 * x)));
}
def code(x): return (1.0 - ((x * x) * (0.5 + ((x * (x * 0.001736111111111111)) / (-0.041666666666666664 + ((x * x) * -0.001388888888888889)))))) * math.exp((x * (10.0 * x)))
function code(x) return Float64(Float64(1.0 - Float64(Float64(x * x) * Float64(0.5 + Float64(Float64(x * Float64(x * 0.001736111111111111)) / Float64(-0.041666666666666664 + Float64(Float64(x * x) * -0.001388888888888889)))))) * exp(Float64(x * Float64(10.0 * x)))) end
function tmp = code(x) tmp = (1.0 - ((x * x) * (0.5 + ((x * (x * 0.001736111111111111)) / (-0.041666666666666664 + ((x * x) * -0.001388888888888889)))))) * exp((x * (10.0 * x))); end
code[x_] := N[(N[(1.0 - N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(N[(x * N[(x * 0.001736111111111111), $MachinePrecision]), $MachinePrecision] / N[(-0.041666666666666664 + N[(N[(x * x), $MachinePrecision] * -0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(x * N[(10.0 * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \left(x \cdot x\right) \cdot \left(0.5 + \frac{x \cdot \left(x \cdot 0.001736111111111111\right)}{-0.041666666666666664 + \left(x \cdot x\right) \cdot -0.001388888888888889}\right)\right) \cdot e^{x \cdot \left(10 \cdot x\right)}
\end{array}
Initial program 94.5%
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
(FPCore (x)
:precision binary64
(*
(-
1.0
(*
x
(*
x
(+
0.5
(*
(* x x)
(- -0.041666666666666664 (* x (* x -0.001388888888888889))))))))
(exp (* 10.0 (* x x)))))
double code(double x) {
return (1.0 - (x * (x * (0.5 + ((x * x) * (-0.041666666666666664 - (x * (x * -0.001388888888888889)))))))) * exp((10.0 * (x * x)));
}
real(8) function code(x)
real(8), intent (in) :: x
code = (1.0d0 - (x * (x * (0.5d0 + ((x * x) * ((-0.041666666666666664d0) - (x * (x * (-0.001388888888888889d0))))))))) * exp((10.0d0 * (x * x)))
end function
public static double code(double x) {
return (1.0 - (x * (x * (0.5 + ((x * x) * (-0.041666666666666664 - (x * (x * -0.001388888888888889)))))))) * Math.exp((10.0 * (x * x)));
}
def code(x): return (1.0 - (x * (x * (0.5 + ((x * x) * (-0.041666666666666664 - (x * (x * -0.001388888888888889)))))))) * math.exp((10.0 * (x * x)))
function code(x) return Float64(Float64(1.0 - Float64(x * Float64(x * Float64(0.5 + Float64(Float64(x * x) * Float64(-0.041666666666666664 - Float64(x * Float64(x * -0.001388888888888889)))))))) * exp(Float64(10.0 * Float64(x * x)))) end
function tmp = code(x) tmp = (1.0 - (x * (x * (0.5 + ((x * x) * (-0.041666666666666664 - (x * (x * -0.001388888888888889)))))))) * exp((10.0 * (x * x))); end
code[x_] := N[(N[(1.0 - N[(x * N[(x * N[(0.5 + N[(N[(x * x), $MachinePrecision] * N[(-0.041666666666666664 - N[(x * N[(x * -0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(10.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(-0.041666666666666664 - x \cdot \left(x \cdot -0.001388888888888889\right)\right)\right)\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)}
\end{array}
Initial program 94.5%
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
(FPCore (x) :precision binary64 (* (+ 1.0 (* x (* x (+ -0.5 (* (* x x) 0.041666666666666664))))) (exp (* x (* x 10.0)))))
double code(double x) {
return (1.0 + (x * (x * (-0.5 + ((x * x) * 0.041666666666666664))))) * exp((x * (x * 10.0)));
}
real(8) function code(x)
real(8), intent (in) :: x
code = (1.0d0 + (x * (x * ((-0.5d0) + ((x * x) * 0.041666666666666664d0))))) * exp((x * (x * 10.0d0)))
end function
public static double code(double x) {
return (1.0 + (x * (x * (-0.5 + ((x * x) * 0.041666666666666664))))) * Math.exp((x * (x * 10.0)));
}
def code(x): return (1.0 + (x * (x * (-0.5 + ((x * x) * 0.041666666666666664))))) * math.exp((x * (x * 10.0)))
function code(x) return Float64(Float64(1.0 + Float64(x * Float64(x * Float64(-0.5 + Float64(Float64(x * x) * 0.041666666666666664))))) * exp(Float64(x * Float64(x * 10.0)))) end
function tmp = code(x) tmp = (1.0 + (x * (x * (-0.5 + ((x * x) * 0.041666666666666664))))) * exp((x * (x * 10.0))); end
code[x_] := N[(N[(1.0 + N[(x * N[(x * N[(-0.5 + N[(N[(x * x), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(x * N[(x * 10.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 + x \cdot \left(x \cdot \left(-0.5 + \left(x \cdot x\right) \cdot 0.041666666666666664\right)\right)\right) \cdot e^{x \cdot \left(x \cdot 10\right)}
\end{array}
Initial program 94.5%
Simplified0
Taylor expanded in x around 0 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
(FPCore (x) :precision binary64 (* (- 1.0 (* (* x x) 0.5)) (exp (* 10.0 (* x x)))))
double code(double x) {
return (1.0 - ((x * x) * 0.5)) * exp((10.0 * (x * x)));
}
real(8) function code(x)
real(8), intent (in) :: x
code = (1.0d0 - ((x * x) * 0.5d0)) * exp((10.0d0 * (x * x)))
end function
public static double code(double x) {
return (1.0 - ((x * x) * 0.5)) * Math.exp((10.0 * (x * x)));
}
def code(x): return (1.0 - ((x * x) * 0.5)) * math.exp((10.0 * (x * x)))
function code(x) return Float64(Float64(1.0 - Float64(Float64(x * x) * 0.5)) * exp(Float64(10.0 * Float64(x * x)))) end
function tmp = code(x) tmp = (1.0 - ((x * x) * 0.5)) * exp((10.0 * (x * x))); end
code[x_] := N[(N[(1.0 - N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(10.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \left(x \cdot x\right) \cdot 0.5\right) \cdot e^{10 \cdot \left(x \cdot x\right)}
\end{array}
Initial program 94.5%
Taylor expanded in x around 0 0
Simplified0
(FPCore (x) :precision binary64 (* x (* x (* (exp (* x (* 10.0 x))) -0.5))))
double code(double x) {
return x * (x * (exp((x * (10.0 * x))) * -0.5));
}
real(8) function code(x)
real(8), intent (in) :: x
code = x * (x * (exp((x * (10.0d0 * x))) * (-0.5d0)))
end function
public static double code(double x) {
return x * (x * (Math.exp((x * (10.0 * x))) * -0.5));
}
def code(x): return x * (x * (math.exp((x * (10.0 * x))) * -0.5))
function code(x) return Float64(x * Float64(x * Float64(exp(Float64(x * Float64(10.0 * x))) * -0.5))) end
function tmp = code(x) tmp = x * (x * (exp((x * (10.0 * x))) * -0.5)); end
code[x_] := N[(x * N[(x * N[(N[Exp[N[(x * N[(10.0 * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(x \cdot \left(e^{x \cdot \left(10 \cdot x\right)} \cdot -0.5\right)\right)
\end{array}
Initial program 94.5%
Simplified0
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
Taylor expanded in x around inf 0
Simplified0
(FPCore (x) :precision binary64 (* (- 1.0 (* (* x x) 0.5)) (+ 1.0 (* (* x x) (+ 10.0 (* (* x x) (+ 50.0 (* x (* x 166.66666666666666)))))))))
double code(double x) {
return (1.0 - ((x * x) * 0.5)) * (1.0 + ((x * x) * (10.0 + ((x * x) * (50.0 + (x * (x * 166.66666666666666)))))));
}
real(8) function code(x)
real(8), intent (in) :: x
code = (1.0d0 - ((x * x) * 0.5d0)) * (1.0d0 + ((x * x) * (10.0d0 + ((x * x) * (50.0d0 + (x * (x * 166.66666666666666d0)))))))
end function
public static double code(double x) {
return (1.0 - ((x * x) * 0.5)) * (1.0 + ((x * x) * (10.0 + ((x * x) * (50.0 + (x * (x * 166.66666666666666)))))));
}
def code(x): return (1.0 - ((x * x) * 0.5)) * (1.0 + ((x * x) * (10.0 + ((x * x) * (50.0 + (x * (x * 166.66666666666666)))))))
function code(x) return Float64(Float64(1.0 - Float64(Float64(x * x) * 0.5)) * Float64(1.0 + Float64(Float64(x * x) * Float64(10.0 + Float64(Float64(x * x) * Float64(50.0 + Float64(x * Float64(x * 166.66666666666666)))))))) end
function tmp = code(x) tmp = (1.0 - ((x * x) * 0.5)) * (1.0 + ((x * x) * (10.0 + ((x * x) * (50.0 + (x * (x * 166.66666666666666))))))); end
code[x_] := N[(N[(1.0 - N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(10.0 + N[(N[(x * x), $MachinePrecision] * N[(50.0 + N[(x * N[(x * 166.66666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \left(x \cdot x\right) \cdot 0.5\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(10 + \left(x \cdot x\right) \cdot \left(50 + x \cdot \left(x \cdot 166.66666666666666\right)\right)\right)\right)
\end{array}
Initial program 94.5%
Simplified0
Taylor expanded in x around 0 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
(FPCore (x) :precision binary64 (* (- 1.0 (* (* x x) 0.5)) (+ 1.0 (* (* x x) (+ 10.0 (* (* x x) 50.0))))))
double code(double x) {
return (1.0 - ((x * x) * 0.5)) * (1.0 + ((x * x) * (10.0 + ((x * x) * 50.0))));
}
real(8) function code(x)
real(8), intent (in) :: x
code = (1.0d0 - ((x * x) * 0.5d0)) * (1.0d0 + ((x * x) * (10.0d0 + ((x * x) * 50.0d0))))
end function
public static double code(double x) {
return (1.0 - ((x * x) * 0.5)) * (1.0 + ((x * x) * (10.0 + ((x * x) * 50.0))));
}
def code(x): return (1.0 - ((x * x) * 0.5)) * (1.0 + ((x * x) * (10.0 + ((x * x) * 50.0))))
function code(x) return Float64(Float64(1.0 - Float64(Float64(x * x) * 0.5)) * Float64(1.0 + Float64(Float64(x * x) * Float64(10.0 + Float64(Float64(x * x) * 50.0))))) end
function tmp = code(x) tmp = (1.0 - ((x * x) * 0.5)) * (1.0 + ((x * x) * (10.0 + ((x * x) * 50.0)))); end
code[x_] := N[(N[(1.0 - N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(10.0 + N[(N[(x * x), $MachinePrecision] * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \left(x \cdot x\right) \cdot 0.5\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(10 + \left(x \cdot x\right) \cdot 50\right)\right)
\end{array}
Initial program 94.5%
Simplified0
Taylor expanded in x around 0 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
(FPCore (x) :precision binary64 (* (- 1.0 (* (* x x) 0.5)) (+ 1.0 (* 10.0 (* x x)))))
double code(double x) {
return (1.0 - ((x * x) * 0.5)) * (1.0 + (10.0 * (x * x)));
}
real(8) function code(x)
real(8), intent (in) :: x
code = (1.0d0 - ((x * x) * 0.5d0)) * (1.0d0 + (10.0d0 * (x * x)))
end function
public static double code(double x) {
return (1.0 - ((x * x) * 0.5)) * (1.0 + (10.0 * (x * x)));
}
def code(x): return (1.0 - ((x * x) * 0.5)) * (1.0 + (10.0 * (x * x)))
function code(x) return Float64(Float64(1.0 - Float64(Float64(x * x) * 0.5)) * Float64(1.0 + Float64(10.0 * Float64(x * x)))) end
function tmp = code(x) tmp = (1.0 - ((x * x) * 0.5)) * (1.0 + (10.0 * (x * x))); end
code[x_] := N[(N[(1.0 - N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(10.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \left(x \cdot x\right) \cdot 0.5\right) \cdot \left(1 + 10 \cdot \left(x \cdot x\right)\right)
\end{array}
Initial program 94.5%
Simplified0
Taylor expanded in x around 0 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
(FPCore (x) :precision binary64 (+ 1.0 (* (* x x) (+ 9.5 (* (* x x) -4.958333333333333)))))
double code(double x) {
return 1.0 + ((x * x) * (9.5 + ((x * x) * -4.958333333333333)));
}
real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0 + ((x * x) * (9.5d0 + ((x * x) * (-4.958333333333333d0))))
end function
public static double code(double x) {
return 1.0 + ((x * x) * (9.5 + ((x * x) * -4.958333333333333)));
}
def code(x): return 1.0 + ((x * x) * (9.5 + ((x * x) * -4.958333333333333)))
function code(x) return Float64(1.0 + Float64(Float64(x * x) * Float64(9.5 + Float64(Float64(x * x) * -4.958333333333333)))) end
function tmp = code(x) tmp = 1.0 + ((x * x) * (9.5 + ((x * x) * -4.958333333333333))); end
code[x_] := N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(9.5 + N[(N[(x * x), $MachinePrecision] * -4.958333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \left(x \cdot x\right) \cdot \left(9.5 + \left(x \cdot x\right) \cdot -4.958333333333333\right)
\end{array}
Initial program 94.5%
Taylor expanded in x around 0 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
(FPCore (x) :precision binary64 (* (* x x) -0.5))
double code(double x) {
return (x * x) * -0.5;
}
real(8) function code(x)
real(8), intent (in) :: x
code = (x * x) * (-0.5d0)
end function
public static double code(double x) {
return (x * x) * -0.5;
}
def code(x): return (x * x) * -0.5
function code(x) return Float64(Float64(x * x) * -0.5) end
function tmp = code(x) tmp = (x * x) * -0.5; end
code[x_] := N[(N[(x * x), $MachinePrecision] * -0.5), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot x\right) \cdot -0.5
\end{array}
Initial program 94.5%
Simplified0
Taylor expanded in x around 0 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
Taylor expanded in x around inf 0
Simplified0
(FPCore (x) :precision binary64 1.0)
double code(double x) {
return 1.0;
}
real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0
end function
public static double code(double x) {
return 1.0;
}
def code(x): return 1.0
function code(x) return 1.0 end
function tmp = code(x) tmp = 1.0; end
code[x_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 94.5%
Taylor expanded in x around 0 0
Simplified0
herbie shell --seed 2024110
(FPCore (x)
:name "ENA, Section 1.4, Exercise 1"
:precision binary64
:pre (and (<= 1.99 x) (<= x 2.01))
(* (cos x) (exp (* 10.0 (* x x)))))