
(FPCore (x y z) :precision binary64 (- (+ x (cos y)) (* z (sin y))))
double code(double x, double y, double z) {
return (x + cos(y)) - (z * sin(y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x + cos(y)) - (z * sin(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.cos(y)) - (z * Math.sin(y));
}
def code(x, y, z): return (x + math.cos(y)) - (z * math.sin(y))
function code(x, y, z) return Float64(Float64(x + cos(y)) - Float64(z * sin(y))) end
function tmp = code(x, y, z) tmp = (x + cos(y)) - (z * sin(y)); end
code[x_, y_, z_] := N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \cos y\right) - z \cdot \sin y
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (- (+ x (cos y)) (* z (sin y))))
double code(double x, double y, double z) {
return (x + cos(y)) - (z * sin(y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x + cos(y)) - (z * sin(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.cos(y)) - (z * Math.sin(y));
}
def code(x, y, z): return (x + math.cos(y)) - (z * math.sin(y))
function code(x, y, z) return Float64(Float64(x + cos(y)) - Float64(z * sin(y))) end
function tmp = code(x, y, z) tmp = (x + cos(y)) - (z * sin(y)); end
code[x_, y_, z_] := N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \cos y\right) - z \cdot \sin y
\end{array}
(FPCore (x y z) :precision binary64 (fma (sin y) (- z) (+ x (cos y))))
double code(double x, double y, double z) {
return fma(sin(y), -z, (x + cos(y)));
}
function code(x, y, z) return fma(sin(y), Float64(-z), Float64(x + cos(y))) end
code[x_, y_, z_] := N[(N[Sin[y], $MachinePrecision] * (-z) + N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\sin y, -z, x + \cos y\right)
\end{array}
Initial program 99.9%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-neg.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (+ x (cos y)) (* z (sin y)))))
(if (<= t_0 -400.0)
(- x (fma z y -1.0))
(if (<= t_0 0.995) (cos y) (+ 1.0 x)))))
double code(double x, double y, double z) {
double t_0 = (x + cos(y)) - (z * sin(y));
double tmp;
if (t_0 <= -400.0) {
tmp = x - fma(z, y, -1.0);
} else if (t_0 <= 0.995) {
tmp = cos(y);
} else {
tmp = 1.0 + x;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(x + cos(y)) - Float64(z * sin(y))) tmp = 0.0 if (t_0 <= -400.0) tmp = Float64(x - fma(z, y, -1.0)); elseif (t_0 <= 0.995) tmp = cos(y); else tmp = Float64(1.0 + x); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -400.0], N[(x - N[(z * y + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.995], N[Cos[y], $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x + \cos y\right) - z \cdot \sin y\\
\mathbf{if}\;t\_0 \leq -400:\\
\;\;\;\;x - \mathsf{fma}\left(z, y, -1\right)\\
\mathbf{elif}\;t\_0 \leq 0.995:\\
\;\;\;\;\cos y\\
\mathbf{else}:\\
\;\;\;\;1 + x\\
\end{array}
\end{array}
if (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < -400Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
lower--.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6474.3
Applied rewrites74.3%
if -400 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 0.994999999999999996Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
lower-cos.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
Applied rewrites94.4%
if 0.994999999999999996 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) Initial program 99.9%
Taylor expanded in y around 0
lower-+.f6471.3
Applied rewrites71.3%
(FPCore (x y z) :precision binary64 (- (+ x (cos y)) (* z (sin y))))
double code(double x, double y, double z) {
return (x + cos(y)) - (z * sin(y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x + cos(y)) - (z * sin(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.cos(y)) - (z * Math.sin(y));
}
def code(x, y, z): return (x + math.cos(y)) - (z * math.sin(y))
function code(x, y, z) return Float64(Float64(x + cos(y)) - Float64(z * sin(y))) end
function tmp = code(x, y, z) tmp = (x + cos(y)) - (z * sin(y)); end
code[x_, y_, z_] := N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \cos y\right) - z \cdot \sin y
\end{array}
Initial program 99.9%
(FPCore (x y z) :precision binary64 (if (<= z -61000.0) (- (+ 1.0 x) (* z (sin y))) (if (<= z 1.52e-15) (+ x (cos y)) (fma (sin y) (- z) (+ 1.0 x)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -61000.0) {
tmp = (1.0 + x) - (z * sin(y));
} else if (z <= 1.52e-15) {
tmp = x + cos(y);
} else {
tmp = fma(sin(y), -z, (1.0 + x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (z <= -61000.0) tmp = Float64(Float64(1.0 + x) - Float64(z * sin(y))); elseif (z <= 1.52e-15) tmp = Float64(x + cos(y)); else tmp = fma(sin(y), Float64(-z), Float64(1.0 + x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[z, -61000.0], N[(N[(1.0 + x), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.52e-15], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(N[Sin[y], $MachinePrecision] * (-z) + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -61000:\\
\;\;\;\;\left(1 + x\right) - z \cdot \sin y\\
\mathbf{elif}\;z \leq 1.52 \cdot 10^{-15}:\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\sin y, -z, 1 + x\right)\\
\end{array}
\end{array}
if z < -61000Initial program 99.8%
Taylor expanded in y around 0
Applied rewrites99.1%
if -61000 < z < 1.52000000000000005e-15Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
lower-cos.f64100.0
Applied rewrites100.0%
if 1.52000000000000005e-15 < z Initial program 99.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-neg.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
Applied rewrites99.2%
Final simplification99.6%
(FPCore (x y z) :precision binary64 (let* ((t_0 (- (+ 1.0 x) (* z (sin y))))) (if (<= z -61000.0) t_0 (if (<= z 1.52e-15) (+ x (cos y)) t_0))))
double code(double x, double y, double z) {
double t_0 = (1.0 + x) - (z * sin(y));
double tmp;
if (z <= -61000.0) {
tmp = t_0;
} else if (z <= 1.52e-15) {
tmp = x + cos(y);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (1.0d0 + x) - (z * sin(y))
if (z <= (-61000.0d0)) then
tmp = t_0
else if (z <= 1.52d-15) then
tmp = x + cos(y)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (1.0 + x) - (z * Math.sin(y));
double tmp;
if (z <= -61000.0) {
tmp = t_0;
} else if (z <= 1.52e-15) {
tmp = x + Math.cos(y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (1.0 + x) - (z * math.sin(y)) tmp = 0 if z <= -61000.0: tmp = t_0 elif z <= 1.52e-15: tmp = x + math.cos(y) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(1.0 + x) - Float64(z * sin(y))) tmp = 0.0 if (z <= -61000.0) tmp = t_0; elseif (z <= 1.52e-15) tmp = Float64(x + cos(y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (1.0 + x) - (z * sin(y)); tmp = 0.0; if (z <= -61000.0) tmp = t_0; elseif (z <= 1.52e-15) tmp = x + cos(y); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(1.0 + x), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -61000.0], t$95$0, If[LessEqual[z, 1.52e-15], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 + x\right) - z \cdot \sin y\\
\mathbf{if}\;z \leq -61000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.52 \cdot 10^{-15}:\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -61000 or 1.52000000000000005e-15 < z Initial program 99.8%
Taylor expanded in y around 0
Applied rewrites99.1%
if -61000 < z < 1.52000000000000005e-15Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
lower-cos.f64100.0
Applied rewrites100.0%
Final simplification99.6%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* (- z) (sin y)))) (if (<= z -3.5e+129) t_0 (if (<= z 3.3e+214) (+ x (cos y)) t_0))))
double code(double x, double y, double z) {
double t_0 = -z * sin(y);
double tmp;
if (z <= -3.5e+129) {
tmp = t_0;
} else if (z <= 3.3e+214) {
tmp = x + cos(y);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = -z * sin(y)
if (z <= (-3.5d+129)) then
tmp = t_0
else if (z <= 3.3d+214) then
tmp = x + cos(y)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -z * Math.sin(y);
double tmp;
if (z <= -3.5e+129) {
tmp = t_0;
} else if (z <= 3.3e+214) {
tmp = x + Math.cos(y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -z * math.sin(y) tmp = 0 if z <= -3.5e+129: tmp = t_0 elif z <= 3.3e+214: tmp = x + math.cos(y) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(-z) * sin(y)) tmp = 0.0 if (z <= -3.5e+129) tmp = t_0; elseif (z <= 3.3e+214) tmp = Float64(x + cos(y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -z * sin(y); tmp = 0.0; if (z <= -3.5e+129) tmp = t_0; elseif (z <= 3.3e+214) tmp = x + cos(y); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[((-z) * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.5e+129], t$95$0, If[LessEqual[z, 3.3e+214], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(-z\right) \cdot \sin y\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{+129}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+214}:\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -3.4999999999999998e129 or 3.30000000000000011e214 < z Initial program 99.8%
Taylor expanded in z around inf
mul-1-negN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f6474.6
Applied rewrites74.6%
if -3.4999999999999998e129 < z < 3.30000000000000011e214Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
lower-cos.f6489.1
Applied rewrites89.1%
Final simplification85.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (cos y))))
(if (<= y -0.023)
t_0
(if (<= y 2e+18) (fma (- (* -0.5 y) z) y (+ 1.0 x)) t_0))))
double code(double x, double y, double z) {
double t_0 = x + cos(y);
double tmp;
if (y <= -0.023) {
tmp = t_0;
} else if (y <= 2e+18) {
tmp = fma(((-0.5 * y) - z), y, (1.0 + x));
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(x + cos(y)) tmp = 0.0 if (y <= -0.023) tmp = t_0; elseif (y <= 2e+18) tmp = fma(Float64(Float64(-0.5 * y) - z), y, Float64(1.0 + x)); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -0.023], t$95$0, If[LessEqual[y, 2e+18], N[(N[(N[(-0.5 * y), $MachinePrecision] - z), $MachinePrecision] * y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \cos y\\
\mathbf{if}\;y \leq -0.023:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+18}:\\
\;\;\;\;\mathsf{fma}\left(-0.5 \cdot y - z, y, 1 + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -0.023 or 2e18 < y Initial program 99.8%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
lower-cos.f6462.2
Applied rewrites62.2%
if -0.023 < y < 2e18Initial program 100.0%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6498.7
Applied rewrites98.7%
Final simplification81.6%
(FPCore (x y z) :precision binary64 (if (<= y -6500.0) (+ 1.0 x) (if (<= y 1.15e+42) (fma (- (* -0.5 y) z) y (+ 1.0 x)) (+ 1.0 x))))
double code(double x, double y, double z) {
double tmp;
if (y <= -6500.0) {
tmp = 1.0 + x;
} else if (y <= 1.15e+42) {
tmp = fma(((-0.5 * y) - z), y, (1.0 + x));
} else {
tmp = 1.0 + x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (y <= -6500.0) tmp = Float64(1.0 + x); elseif (y <= 1.15e+42) tmp = fma(Float64(Float64(-0.5 * y) - z), y, Float64(1.0 + x)); else tmp = Float64(1.0 + x); end return tmp end
code[x_, y_, z_] := If[LessEqual[y, -6500.0], N[(1.0 + x), $MachinePrecision], If[LessEqual[y, 1.15e+42], N[(N[(N[(-0.5 * y), $MachinePrecision] - z), $MachinePrecision] * y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6500:\\
\;\;\;\;1 + x\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+42}:\\
\;\;\;\;\mathsf{fma}\left(-0.5 \cdot y - z, y, 1 + x\right)\\
\mathbf{else}:\\
\;\;\;\;1 + x\\
\end{array}
\end{array}
if y < -6500 or 1.15e42 < y Initial program 99.8%
Taylor expanded in y around 0
lower-+.f6439.4
Applied rewrites39.4%
if -6500 < y < 1.15e42Initial program 100.0%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6494.0
Applied rewrites94.0%
(FPCore (x y z) :precision binary64 (if (<= y -6.6e+94) (+ 1.0 x) (if (<= y 1.28e+42) (- x (fma z y -1.0)) (+ 1.0 x))))
double code(double x, double y, double z) {
double tmp;
if (y <= -6.6e+94) {
tmp = 1.0 + x;
} else if (y <= 1.28e+42) {
tmp = x - fma(z, y, -1.0);
} else {
tmp = 1.0 + x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (y <= -6.6e+94) tmp = Float64(1.0 + x); elseif (y <= 1.28e+42) tmp = Float64(x - fma(z, y, -1.0)); else tmp = Float64(1.0 + x); end return tmp end
code[x_, y_, z_] := If[LessEqual[y, -6.6e+94], N[(1.0 + x), $MachinePrecision], If[LessEqual[y, 1.28e+42], N[(x - N[(z * y + -1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.6 \cdot 10^{+94}:\\
\;\;\;\;1 + x\\
\mathbf{elif}\;y \leq 1.28 \cdot 10^{+42}:\\
\;\;\;\;x - \mathsf{fma}\left(z, y, -1\right)\\
\mathbf{else}:\\
\;\;\;\;1 + x\\
\end{array}
\end{array}
if y < -6.6e94 or 1.28000000000000004e42 < y Initial program 99.8%
Taylor expanded in y around 0
lower-+.f6440.2
Applied rewrites40.2%
if -6.6e94 < y < 1.28000000000000004e42Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
lower--.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6489.2
Applied rewrites89.2%
(FPCore (x y z) :precision binary64 (if (<= x -7.5e-34) (+ 1.0 x) (if (<= x 1.8e-15) (fma (- z) y 1.0) (+ 1.0 x))))
double code(double x, double y, double z) {
double tmp;
if (x <= -7.5e-34) {
tmp = 1.0 + x;
} else if (x <= 1.8e-15) {
tmp = fma(-z, y, 1.0);
} else {
tmp = 1.0 + x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= -7.5e-34) tmp = Float64(1.0 + x); elseif (x <= 1.8e-15) tmp = fma(Float64(-z), y, 1.0); else tmp = Float64(1.0 + x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, -7.5e-34], N[(1.0 + x), $MachinePrecision], If[LessEqual[x, 1.8e-15], N[((-z) * y + 1.0), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{-34}:\\
\;\;\;\;1 + x\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(-z, y, 1\right)\\
\mathbf{else}:\\
\;\;\;\;1 + x\\
\end{array}
\end{array}
if x < -7.5000000000000004e-34 or 1.8000000000000001e-15 < x Initial program 99.9%
Taylor expanded in y around 0
lower-+.f6478.4
Applied rewrites78.4%
if -7.5000000000000004e-34 < x < 1.8000000000000001e-15Initial program 99.9%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6451.1
Applied rewrites51.1%
Taylor expanded in x around 0
Applied rewrites51.1%
Taylor expanded in z around inf
Applied rewrites52.8%
(FPCore (x y z) :precision binary64 (+ 1.0 x))
double code(double x, double y, double z) {
return 1.0 + x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0 + x
end function
public static double code(double x, double y, double z) {
return 1.0 + x;
}
def code(x, y, z): return 1.0 + x
function code(x, y, z) return Float64(1.0 + x) end
function tmp = code(x, y, z) tmp = 1.0 + x; end
code[x_, y_, z_] := N[(1.0 + x), $MachinePrecision]
\begin{array}{l}
\\
1 + x
\end{array}
Initial program 99.9%
Taylor expanded in y around 0
lower-+.f6463.2
Applied rewrites63.2%
(FPCore (x y z) :precision binary64 1.0)
double code(double x, double y, double z) {
return 1.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0
end function
public static double code(double x, double y, double z) {
return 1.0;
}
def code(x, y, z): return 1.0
function code(x, y, z) return 1.0 end
function tmp = code(x, y, z) tmp = 1.0; end
code[x_, y_, z_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 99.9%
Taylor expanded in y around 0
lower-+.f6463.2
Applied rewrites63.2%
Taylor expanded in x around 0
Applied rewrites18.6%
herbie shell --seed 2024249
(FPCore (x y z)
:name "Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, B"
:precision binary64
(- (+ x (cos y)) (* z (sin y))))