
(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(x + Float64(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[(x + N[(N[Cos[y], $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\cos y - z \cdot \sin y\right)
\end{array}
Initial program 99.9%
associate--l+99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= x -3.4e-7) (not (<= x 4e-53))) (+ x (- 1.0 (* z (sin y)))) (* z (- (/ (cos y) z) (sin y)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -3.4e-7) || !(x <= 4e-53)) {
tmp = x + (1.0 - (z * sin(y)));
} else {
tmp = z * ((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 <= (-3.4d-7)) .or. (.not. (x <= 4d-53))) then
tmp = x + (1.0d0 - (z * sin(y)))
else
tmp = z * ((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 <= -3.4e-7) || !(x <= 4e-53)) {
tmp = x + (1.0 - (z * Math.sin(y)));
} else {
tmp = z * ((Math.cos(y) / z) - Math.sin(y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -3.4e-7) or not (x <= 4e-53): tmp = x + (1.0 - (z * math.sin(y))) else: tmp = z * ((math.cos(y) / z) - math.sin(y)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -3.4e-7) || !(x <= 4e-53)) tmp = Float64(x + Float64(1.0 - Float64(z * sin(y)))); else tmp = Float64(z * Float64(Float64(cos(y) / z) - sin(y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -3.4e-7) || ~((x <= 4e-53))) tmp = x + (1.0 - (z * sin(y))); else tmp = z * ((cos(y) / z) - sin(y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -3.4e-7], N[Not[LessEqual[x, 4e-53]], $MachinePrecision]], N[(x + N[(1.0 - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(N[Cos[y], $MachinePrecision] / z), $MachinePrecision] - N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-7} \lor \neg \left(x \leq 4 \cdot 10^{-53}\right):\\
\;\;\;\;x + \left(1 - z \cdot \sin y\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\frac{\cos y}{z} - \sin y\right)\\
\end{array}
\end{array}
if x < -3.39999999999999974e-7 or 4.00000000000000012e-53 < x Initial program 99.9%
associate--l+100.0%
Simplified100.0%
Taylor expanded in z around inf 99.9%
Taylor expanded in y around 0 98.8%
Taylor expanded in z around 0 98.8%
mul-1-neg98.8%
unsub-neg98.8%
Simplified98.8%
if -3.39999999999999974e-7 < x < 4.00000000000000012e-53Initial program 99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in z around inf 99.8%
Taylor expanded in x around 0 99.8%
Final simplification99.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -3000000000.0) (not (<= z 3.1e-6))) (+ x (- 1.0 (* z (sin y)))) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3000000000.0) || !(z <= 3.1e-6)) {
tmp = x + (1.0 - (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 <= (-3000000000.0d0)) .or. (.not. (z <= 3.1d-6))) then
tmp = x + (1.0d0 - (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 <= -3000000000.0) || !(z <= 3.1e-6)) {
tmp = x + (1.0 - (z * Math.sin(y)));
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3000000000.0) or not (z <= 3.1e-6): tmp = x + (1.0 - (z * math.sin(y))) else: tmp = x + math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3000000000.0) || !(z <= 3.1e-6)) tmp = Float64(x + Float64(1.0 - Float64(z * sin(y)))); else tmp = Float64(x + cos(y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -3000000000.0) || ~((z <= 3.1e-6))) tmp = x + (1.0 - (z * sin(y))); else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3000000000.0], N[Not[LessEqual[z, 3.1e-6]], $MachinePrecision]], N[(x + N[(1.0 - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3000000000 \lor \neg \left(z \leq 3.1 \cdot 10^{-6}\right):\\
\;\;\;\;x + \left(1 - z \cdot \sin y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -3e9 or 3.1e-6 < z Initial program 99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in y around 0 98.6%
Taylor expanded in z around 0 98.7%
mul-1-neg98.7%
unsub-neg98.7%
Simplified98.7%
if -3e9 < z < 3.1e-6Initial program 100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in z around 0 99.8%
+-commutative99.8%
Simplified99.8%
Final simplification99.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -62000000000.0) (not (<= z 3.9e+62))) (- x (* z (sin y))) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -62000000000.0) || !(z <= 3.9e+62)) {
tmp = x - (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 <= (-62000000000.0d0)) .or. (.not. (z <= 3.9d+62))) then
tmp = x - (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 <= -62000000000.0) || !(z <= 3.9e+62)) {
tmp = x - (z * Math.sin(y));
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -62000000000.0) or not (z <= 3.9e+62): tmp = x - (z * math.sin(y)) else: tmp = x + math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -62000000000.0) || !(z <= 3.9e+62)) tmp = Float64(x - Float64(z * sin(y))); else tmp = Float64(x + cos(y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -62000000000.0) || ~((z <= 3.9e+62))) tmp = x - (z * sin(y)); else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -62000000000.0], N[Not[LessEqual[z, 3.9e+62]], $MachinePrecision]], N[(x - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -62000000000 \lor \neg \left(z \leq 3.9 \cdot 10^{+62}\right):\\
\;\;\;\;x - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -6.2e10 or 3.9e62 < z Initial program 99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in z around inf 91.1%
associate-*r*91.1%
neg-mul-191.1%
*-commutative91.1%
Simplified91.1%
if -6.2e10 < z < 3.9e62Initial program 99.9%
associate--l+100.0%
Simplified100.0%
Taylor expanded in z around 0 96.8%
+-commutative96.8%
Simplified96.8%
Final simplification94.0%
(FPCore (x y z) :precision binary64 (if (or (<= y -0.96) (not (<= y 16000000.0))) (+ x (cos y)) (+ x (+ 1.0 (* y (- (* y -0.5) z))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -0.96) || !(y <= 16000000.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 <= (-0.96d0)) .or. (.not. (y <= 16000000.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 <= -0.96) || !(y <= 16000000.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 <= -0.96) or not (y <= 16000000.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 <= -0.96) || !(y <= 16000000.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 <= -0.96) || ~((y <= 16000000.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, -0.96], N[Not[LessEqual[y, 16000000.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 -0.96 \lor \neg \left(y \leq 16000000\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 < -0.95999999999999996 or 1.6e7 < y Initial program 99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in z around 0 52.3%
+-commutative52.3%
Simplified52.3%
if -0.95999999999999996 < y < 1.6e7Initial program 100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in y around 0 99.4%
Final simplification77.5%
(FPCore (x y z) :precision binary64 (if (<= y -9e-5) (+ x 1.0) (if (<= y 1.2e+141) (+ x (- 1.0 (* y z))) (cos y))))
double code(double x, double y, double z) {
double tmp;
if (y <= -9e-5) {
tmp = x + 1.0;
} else if (y <= 1.2e+141) {
tmp = x + (1.0 - (y * z));
} else {
tmp = 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 (y <= (-9d-5)) then
tmp = x + 1.0d0
else if (y <= 1.2d+141) then
tmp = x + (1.0d0 - (y * z))
else
tmp = cos(y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -9e-5) {
tmp = x + 1.0;
} else if (y <= 1.2e+141) {
tmp = x + (1.0 - (y * z));
} else {
tmp = Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -9e-5: tmp = x + 1.0 elif y <= 1.2e+141: tmp = x + (1.0 - (y * z)) else: tmp = math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -9e-5) tmp = Float64(x + 1.0); elseif (y <= 1.2e+141) tmp = Float64(x + Float64(1.0 - Float64(y * z))); else tmp = cos(y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -9e-5) tmp = x + 1.0; elseif (y <= 1.2e+141) tmp = x + (1.0 - (y * z)); else tmp = cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -9e-5], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 1.2e+141], N[(x + N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Cos[y], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-5}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+141}:\\
\;\;\;\;x + \left(1 - y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\cos y\\
\end{array}
\end{array}
if y < -9.00000000000000057e-5Initial program 99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in y around 0 44.1%
if -9.00000000000000057e-5 < y < 1.19999999999999999e141Initial program 100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in z around inf 99.9%
Taylor expanded in y around 0 85.4%
+-commutative85.4%
associate-+r+85.4%
mul-1-neg85.4%
*-commutative85.4%
unsub-neg85.4%
*-commutative85.4%
Simplified85.4%
if 1.19999999999999999e141 < y Initial program 99.8%
associate--l+99.8%
Simplified99.8%
add-sqr-sqrt58.5%
pow258.5%
Applied egg-rr58.5%
add-log-exp22.8%
+-commutative22.8%
sub-neg22.8%
associate-+l+22.8%
unpow222.8%
add-sqr-sqrt35.9%
distribute-lft-neg-in35.9%
add-sqr-sqrt23.2%
sqrt-unprod35.0%
sqr-neg35.0%
sqrt-unprod11.8%
add-sqr-sqrt32.5%
Applied egg-rr32.5%
Taylor expanded in z around 0 34.1%
Taylor expanded in x around 0 34.0%
Final simplification69.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -5.9e+150) (not (<= z 8.2e+155))) (- x (* y z)) (+ x 1.0)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.9e+150) || !(z <= 8.2e+155)) {
tmp = x - (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 ((z <= (-5.9d+150)) .or. (.not. (z <= 8.2d+155))) then
tmp = x - (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 ((z <= -5.9e+150) || !(z <= 8.2e+155)) {
tmp = x - (y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.9e+150) or not (z <= 8.2e+155): tmp = x - (y * z) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.9e+150) || !(z <= 8.2e+155)) tmp = Float64(x - Float64(y * z)); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -5.9e+150) || ~((z <= 8.2e+155))) tmp = x - (y * z); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.9e+150], N[Not[LessEqual[z, 8.2e+155]], $MachinePrecision]], N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.9 \cdot 10^{+150} \lor \neg \left(z \leq 8.2 \cdot 10^{+155}\right):\\
\;\;\;\;x - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if z < -5.90000000000000023e150 or 8.1999999999999996e155 < z Initial program 99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in z around inf 97.1%
associate-*r*97.1%
neg-mul-197.1%
*-commutative97.1%
Simplified97.1%
Taylor expanded in y around 0 53.5%
mul-1-neg53.5%
*-commutative53.5%
distribute-rgt-neg-in53.5%
Simplified53.5%
if -5.90000000000000023e150 < z < 8.1999999999999996e155Initial program 99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in y around 0 70.0%
Final simplification65.3%
(FPCore (x y z) :precision binary64 (if (<= y -9e-5) (+ x 1.0) (+ x (- 1.0 (* y z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -9e-5) {
tmp = x + 1.0;
} else {
tmp = x + (1.0 - (y * 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 <= (-9d-5)) then
tmp = x + 1.0d0
else
tmp = x + (1.0d0 - (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -9e-5) {
tmp = x + 1.0;
} else {
tmp = x + (1.0 - (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -9e-5: tmp = x + 1.0 else: tmp = x + (1.0 - (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -9e-5) tmp = Float64(x + 1.0); else tmp = Float64(x + Float64(1.0 - Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -9e-5) tmp = x + 1.0; else tmp = x + (1.0 - (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -9e-5], N[(x + 1.0), $MachinePrecision], N[(x + N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-5}:\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;x + \left(1 - y \cdot z\right)\\
\end{array}
\end{array}
if y < -9.00000000000000057e-5Initial program 99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in y around 0 44.1%
if -9.00000000000000057e-5 < y Initial program 99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
Taylor expanded in y around 0 72.6%
+-commutative72.6%
associate-+r+72.6%
mul-1-neg72.6%
*-commutative72.6%
unsub-neg72.6%
*-commutative72.6%
Simplified72.6%
Final simplification66.1%
(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%
associate--l+99.9%
Simplified99.9%
Taylor expanded in y around 0 57.8%
Final simplification57.8%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in x around inf 38.1%
Final simplification38.1%
herbie shell --seed 2024080
(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))))