
(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 10 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 (- (+ 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%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= x -0.0052) (not (<= x 7e-5))) (+ x (cos y)) (- (cos y) (* z (sin y)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -0.0052) || !(x <= 7e-5)) {
tmp = x + cos(y);
} else {
tmp = cos(y) - (z * sin(y));
}
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) :: tmp
if ((x <= (-0.0052d0)) .or. (.not. (x <= 7d-5))) then
tmp = x + cos(y)
else
tmp = cos(y) - (z * sin(y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -0.0052) || !(x <= 7e-5)) {
tmp = x + Math.cos(y);
} else {
tmp = Math.cos(y) - (z * Math.sin(y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -0.0052) or not (x <= 7e-5): tmp = x + math.cos(y) else: tmp = math.cos(y) - (z * math.sin(y)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -0.0052) || !(x <= 7e-5)) tmp = Float64(x + cos(y)); else tmp = Float64(cos(y) - Float64(z * sin(y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -0.0052) || ~((x <= 7e-5))) tmp = x + cos(y); else tmp = cos(y) - (z * sin(y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -0.0052], N[Not[LessEqual[x, 7e-5]], $MachinePrecision]], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(N[Cos[y], $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.0052 \lor \neg \left(x \leq 7 \cdot 10^{-5}\right):\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;\cos y - z \cdot \sin y\\
\end{array}
\end{array}
if x < -0.0051999999999999998 or 6.9999999999999994e-5 < x Initial program 99.9%
Taylor expanded in z around 0 83.7%
+-commutative83.7%
Simplified83.7%
if -0.0051999999999999998 < x < 6.9999999999999994e-5Initial program 99.9%
Taylor expanded in x around 0 98.9%
Final simplification91.6%
(FPCore (x y z) :precision binary64 (if (or (<= z -9.6e+131) (not (<= z 1.7e+220))) (* z (- (sin y))) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -9.6e+131) || !(z <= 1.7e+220)) {
tmp = z * -sin(y);
} else {
tmp = x + cos(y);
}
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) :: tmp
if ((z <= (-9.6d+131)) .or. (.not. (z <= 1.7d+220))) then
tmp = z * -sin(y)
else
tmp = x + cos(y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -9.6e+131) || !(z <= 1.7e+220)) {
tmp = z * -Math.sin(y);
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -9.6e+131) or not (z <= 1.7e+220): tmp = z * -math.sin(y) else: tmp = x + math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -9.6e+131) || !(z <= 1.7e+220)) tmp = Float64(z * Float64(-sin(y))); else tmp = Float64(x + cos(y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -9.6e+131) || ~((z <= 1.7e+220))) tmp = z * -sin(y); else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -9.6e+131], N[Not[LessEqual[z, 1.7e+220]], $MachinePrecision]], N[(z * (-N[Sin[y], $MachinePrecision])), $MachinePrecision], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.6 \cdot 10^{+131} \lor \neg \left(z \leq 1.7 \cdot 10^{+220}\right):\\
\;\;\;\;z \cdot \left(-\sin y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -9.5999999999999998e131 or 1.7e220 < z Initial program 99.9%
Taylor expanded in z around inf 74.3%
mul-1-neg74.3%
distribute-rgt-neg-in74.3%
Simplified74.3%
if -9.5999999999999998e131 < z < 1.7e220Initial program 99.9%
Taylor expanded in z around 0 85.6%
+-commutative85.6%
Simplified85.6%
Final simplification82.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -260.0) (not (<= y 50000.0))) (+ x (cos y)) (+ x (+ 1.0 (* y (- (* y -0.5) z))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -260.0) || !(y <= 50000.0)) {
tmp = x + cos(y);
} else {
tmp = x + (1.0 + (y * ((y * -0.5) - z)));
}
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) :: tmp
if ((y <= (-260.0d0)) .or. (.not. (y <= 50000.0d0))) then
tmp = x + cos(y)
else
tmp = x + (1.0d0 + (y * ((y * (-0.5d0)) - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -260.0) || !(y <= 50000.0)) {
tmp = x + Math.cos(y);
} else {
tmp = x + (1.0 + (y * ((y * -0.5) - z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -260.0) or not (y <= 50000.0): tmp = x + math.cos(y) else: tmp = x + (1.0 + (y * ((y * -0.5) - z))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -260.0) || !(y <= 50000.0)) tmp = Float64(x + cos(y)); else tmp = Float64(x + Float64(1.0 + Float64(y * Float64(Float64(y * -0.5) - z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -260.0) || ~((y <= 50000.0))) tmp = x + cos(y); else tmp = x + (1.0 + (y * ((y * -0.5) - z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -260.0], N[Not[LessEqual[y, 50000.0]], $MachinePrecision]], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 + N[(y * N[(N[(y * -0.5), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -260 \lor \neg \left(y \leq 50000\right):\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;x + \left(1 + y \cdot \left(y \cdot -0.5 - z\right)\right)\\
\end{array}
\end{array}
if y < -260 or 5e4 < y Initial program 99.9%
Taylor expanded in z around 0 64.1%
+-commutative64.1%
Simplified64.1%
if -260 < y < 5e4Initial program 100.0%
Taylor expanded in y around 0 97.8%
associate-+r+97.8%
+-commutative97.8%
associate-+l+97.8%
+-commutative97.8%
mul-1-neg97.8%
unsub-neg97.8%
*-commutative97.8%
unpow297.8%
associate-*l*97.8%
distribute-lft-out--97.8%
Simplified97.8%
Final simplification79.9%
(FPCore (x y z)
:precision binary64
(if (<= x -6.4e-35)
(+ x 1.0)
(if (<= x 7.8e-153)
(cos y)
(if (<= x 1.35e+124) (- (+ x 1.0) (* y z)) (+ x 1.0)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -6.4e-35) {
tmp = x + 1.0;
} else if (x <= 7.8e-153) {
tmp = cos(y);
} else if (x <= 1.35e+124) {
tmp = (x + 1.0) - (y * z);
} else {
tmp = x + 1.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) :: tmp
if (x <= (-6.4d-35)) then
tmp = x + 1.0d0
else if (x <= 7.8d-153) then
tmp = cos(y)
else if (x <= 1.35d+124) then
tmp = (x + 1.0d0) - (y * z)
else
tmp = x + 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -6.4e-35) {
tmp = x + 1.0;
} else if (x <= 7.8e-153) {
tmp = Math.cos(y);
} else if (x <= 1.35e+124) {
tmp = (x + 1.0) - (y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -6.4e-35: tmp = x + 1.0 elif x <= 7.8e-153: tmp = math.cos(y) elif x <= 1.35e+124: tmp = (x + 1.0) - (y * z) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -6.4e-35) tmp = Float64(x + 1.0); elseif (x <= 7.8e-153) tmp = cos(y); elseif (x <= 1.35e+124) tmp = Float64(Float64(x + 1.0) - Float64(y * z)); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -6.4e-35) tmp = x + 1.0; elseif (x <= 7.8e-153) tmp = cos(y); elseif (x <= 1.35e+124) tmp = (x + 1.0) - (y * z); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -6.4e-35], N[(x + 1.0), $MachinePrecision], If[LessEqual[x, 7.8e-153], N[Cos[y], $MachinePrecision], If[LessEqual[x, 1.35e+124], N[(N[(x + 1.0), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.4 \cdot 10^{-35}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{-153}:\\
\;\;\;\;\cos y\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+124}:\\
\;\;\;\;\left(x + 1\right) - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if x < -6.3999999999999996e-35 or 1.34999999999999989e124 < x Initial program 99.9%
Taylor expanded in y around 0 83.3%
+-commutative83.3%
Simplified83.3%
if -6.3999999999999996e-35 < x < 7.8000000000000004e-153Initial program 99.9%
add-sqr-sqrt66.7%
pow266.7%
associate--l+66.7%
Applied egg-rr66.7%
Taylor expanded in x around 0 66.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in z around 0 66.2%
if 7.8000000000000004e-153 < x < 1.34999999999999989e124Initial program 99.9%
Taylor expanded in y around 0 63.8%
associate-+r+63.8%
mul-1-neg63.8%
unsub-neg63.8%
+-commutative63.8%
Simplified63.8%
Final simplification73.1%
(FPCore (x y z) :precision binary64 (if (<= x -9.5e-10) (+ x 1.0) (if (<= x 5.8e+122) (- (+ x 1.0) (* y z)) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -9.5e-10) {
tmp = x + 1.0;
} else if (x <= 5.8e+122) {
tmp = (x + 1.0) - (y * z);
} else {
tmp = x + 1.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) :: tmp
if (x <= (-9.5d-10)) then
tmp = x + 1.0d0
else if (x <= 5.8d+122) then
tmp = (x + 1.0d0) - (y * z)
else
tmp = x + 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -9.5e-10) {
tmp = x + 1.0;
} else if (x <= 5.8e+122) {
tmp = (x + 1.0) - (y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -9.5e-10: tmp = x + 1.0 elif x <= 5.8e+122: tmp = (x + 1.0) - (y * z) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -9.5e-10) tmp = Float64(x + 1.0); elseif (x <= 5.8e+122) tmp = Float64(Float64(x + 1.0) - Float64(y * z)); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -9.5e-10) tmp = x + 1.0; elseif (x <= 5.8e+122) tmp = (x + 1.0) - (y * z); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -9.5e-10], N[(x + 1.0), $MachinePrecision], If[LessEqual[x, 5.8e+122], N[(N[(x + 1.0), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{-10}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{+122}:\\
\;\;\;\;\left(x + 1\right) - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if x < -9.50000000000000028e-10 or 5.8000000000000002e122 < x Initial program 99.9%
Taylor expanded in y around 0 84.0%
+-commutative84.0%
Simplified84.0%
if -9.50000000000000028e-10 < x < 5.8000000000000002e122Initial program 99.9%
Taylor expanded in y around 0 54.7%
associate-+r+54.7%
mul-1-neg54.7%
unsub-neg54.7%
+-commutative54.7%
Simplified54.7%
Final simplification66.6%
(FPCore (x y z) :precision binary64 (if (<= x -3.5e-13) (+ x 1.0) (if (<= x 3e-25) (- 1.0 (* y z)) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.5e-13) {
tmp = x + 1.0;
} else if (x <= 3e-25) {
tmp = 1.0 - (y * z);
} else {
tmp = x + 1.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) :: tmp
if (x <= (-3.5d-13)) then
tmp = x + 1.0d0
else if (x <= 3d-25) then
tmp = 1.0d0 - (y * z)
else
tmp = x + 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.5e-13) {
tmp = x + 1.0;
} else if (x <= 3e-25) {
tmp = 1.0 - (y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.5e-13: tmp = x + 1.0 elif x <= 3e-25: tmp = 1.0 - (y * z) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.5e-13) tmp = Float64(x + 1.0); elseif (x <= 3e-25) tmp = Float64(1.0 - Float64(y * z)); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.5e-13) tmp = x + 1.0; elseif (x <= 3e-25) tmp = 1.0 - (y * z); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.5e-13], N[(x + 1.0), $MachinePrecision], If[LessEqual[x, 3e-25], N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{-13}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-25}:\\
\;\;\;\;1 - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if x < -3.5000000000000002e-13 or 2.9999999999999998e-25 < x Initial program 99.9%
Taylor expanded in y around 0 79.5%
+-commutative79.5%
Simplified79.5%
if -3.5000000000000002e-13 < x < 2.9999999999999998e-25Initial program 99.9%
add-sqr-sqrt67.0%
pow267.0%
associate--l+67.0%
Applied egg-rr67.0%
Taylor expanded in x around 0 67.0%
*-commutative67.0%
Simplified67.0%
Taylor expanded in y around 0 50.6%
mul-1-neg50.6%
Simplified50.6%
Final simplification65.7%
(FPCore (x y z) :precision binary64 (if (<= x -9.5e-10) x (if (<= x 0.00016) 1.0 x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -9.5e-10) {
tmp = x;
} else if (x <= 0.00016) {
tmp = 1.0;
} else {
tmp = x;
}
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) :: tmp
if (x <= (-9.5d-10)) then
tmp = x
else if (x <= 0.00016d0) then
tmp = 1.0d0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -9.5e-10) {
tmp = x;
} else if (x <= 0.00016) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -9.5e-10: tmp = x elif x <= 0.00016: tmp = 1.0 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -9.5e-10) tmp = x; elseif (x <= 0.00016) tmp = 1.0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -9.5e-10) tmp = x; elseif (x <= 0.00016) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -9.5e-10], x, If[LessEqual[x, 0.00016], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{-10}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 0.00016:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -9.50000000000000028e-10 or 1.60000000000000013e-4 < x Initial program 99.9%
Taylor expanded in x around inf 81.6%
if -9.50000000000000028e-10 < x < 1.60000000000000013e-4Initial program 99.9%
add-sqr-sqrt68.6%
pow268.6%
associate--l+68.6%
Applied egg-rr68.6%
Taylor expanded in x around 0 67.6%
*-commutative67.6%
Simplified67.6%
Taylor expanded in y around 0 37.4%
Final simplification58.8%
(FPCore (x y z) :precision binary64 (+ x 1.0))
double code(double x, double y, double z) {
return x + 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 = x + 1.0d0
end function
public static double code(double x, double y, double z) {
return x + 1.0;
}
def code(x, y, z): return x + 1.0
function code(x, y, z) return Float64(x + 1.0) end
function tmp = code(x, y, z) tmp = x + 1.0; end
code[x_, y_, z_] := N[(x + 1.0), $MachinePrecision]
\begin{array}{l}
\\
x + 1
\end{array}
Initial program 99.9%
Taylor expanded in y around 0 59.4%
+-commutative59.4%
Simplified59.4%
Final simplification59.4%
(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%
add-sqr-sqrt56.7%
pow256.7%
associate--l+56.7%
Applied egg-rr56.7%
Taylor expanded in x around 0 38.4%
*-commutative38.4%
Simplified38.4%
Taylor expanded in y around 0 20.6%
Final simplification20.6%
herbie shell --seed 2023277
(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))))