
(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 13 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%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* z (sin y)))) (if (or (<= x -1.0) (not (<= x 0.84))) (- x t_0) (- (cos y) t_0))))
double code(double x, double y, double z) {
double t_0 = z * sin(y);
double tmp;
if ((x <= -1.0) || !(x <= 0.84)) {
tmp = x - t_0;
} else {
tmp = cos(y) - 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 ((x <= (-1.0d0)) .or. (.not. (x <= 0.84d0))) then
tmp = x - t_0
else
tmp = cos(y) - 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 ((x <= -1.0) || !(x <= 0.84)) {
tmp = x - t_0;
} else {
tmp = Math.cos(y) - t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.sin(y) tmp = 0 if (x <= -1.0) or not (x <= 0.84): tmp = x - t_0 else: tmp = math.cos(y) - t_0 return tmp
function code(x, y, z) t_0 = Float64(z * sin(y)) tmp = 0.0 if ((x <= -1.0) || !(x <= 0.84)) tmp = Float64(x - t_0); else tmp = Float64(cos(y) - t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * sin(y); tmp = 0.0; if ((x <= -1.0) || ~((x <= 0.84))) tmp = x - t_0; else tmp = cos(y) - t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -1.0], N[Not[LessEqual[x, 0.84]], $MachinePrecision]], N[(x - t$95$0), $MachinePrecision], N[(N[Cos[y], $MachinePrecision] - t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \sin y\\
\mathbf{if}\;x \leq -1 \lor \neg \left(x \leq 0.84\right):\\
\;\;\;\;x - t\_0\\
\mathbf{else}:\\
\;\;\;\;\cos y - t\_0\\
\end{array}
\end{array}
if x < -1 or 0.839999999999999969 < x Initial program 99.9%
Taylor expanded in x around inf 99.9%
Taylor expanded in x around inf 97.3%
if -1 < x < 0.839999999999999969Initial program 99.9%
Taylor expanded in x around 0 97.4%
Final simplification97.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.9e+15) (not (<= z 61000000000.0))) (- x (* z (sin y))) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.9e+15) || !(z <= 61000000000.0)) {
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 <= (-2.9d+15)) .or. (.not. (z <= 61000000000.0d0))) 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 <= -2.9e+15) || !(z <= 61000000000.0)) {
tmp = x - (z * Math.sin(y));
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.9e+15) or not (z <= 61000000000.0): tmp = x - (z * math.sin(y)) else: tmp = x + math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.9e+15) || !(z <= 61000000000.0)) 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 <= -2.9e+15) || ~((z <= 61000000000.0))) tmp = x - (z * sin(y)); else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.9e+15], N[Not[LessEqual[z, 61000000000.0]], $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 -2.9 \cdot 10^{+15} \lor \neg \left(z \leq 61000000000\right):\\
\;\;\;\;x - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -2.9e15 or 6.1e10 < z Initial program 99.8%
Taylor expanded in x around inf 99.8%
Taylor expanded in x around inf 90.0%
if -2.9e15 < z < 6.1e10Initial program 100.0%
Taylor expanded in z around 0 100.0%
+-commutative100.0%
Simplified100.0%
Final simplification95.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -5.2e+65) (not (<= z 1.45e+85))) (* z (- (sin y))) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.2e+65) || !(z <= 1.45e+85)) {
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 <= (-5.2d+65)) .or. (.not. (z <= 1.45d+85))) 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 <= -5.2e+65) || !(z <= 1.45e+85)) {
tmp = z * -Math.sin(y);
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.2e+65) or not (z <= 1.45e+85): tmp = z * -math.sin(y) else: tmp = x + math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.2e+65) || !(z <= 1.45e+85)) 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 <= -5.2e+65) || ~((z <= 1.45e+85))) tmp = z * -sin(y); else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.2e+65], N[Not[LessEqual[z, 1.45e+85]], $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 -5.2 \cdot 10^{+65} \lor \neg \left(z \leq 1.45 \cdot 10^{+85}\right):\\
\;\;\;\;z \cdot \left(-\sin y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -5.20000000000000005e65 or 1.44999999999999999e85 < z Initial program 99.8%
Taylor expanded in z around inf 67.9%
associate-*r*67.9%
neg-mul-167.9%
*-commutative67.9%
Simplified67.9%
if -5.20000000000000005e65 < z < 1.44999999999999999e85Initial program 100.0%
Taylor expanded in z around 0 93.6%
+-commutative93.6%
Simplified93.6%
Final simplification84.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -0.205) (not (<= y 0.116))) (+ x (cos y)) (+ 1.0 (+ x (* y (- (* y (- (* 0.16666666666666666 (* y z)) 0.5)) z))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -0.205) || !(y <= 0.116)) {
tmp = x + cos(y);
} else {
tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 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.205d0)) .or. (.not. (y <= 0.116d0))) then
tmp = x + cos(y)
else
tmp = 1.0d0 + (x + (y * ((y * ((0.16666666666666666d0 * (y * z)) - 0.5d0)) - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -0.205) || !(y <= 0.116)) {
tmp = x + Math.cos(y);
} else {
tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -0.205) or not (y <= 0.116): tmp = x + math.cos(y) else: tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -0.205) || !(y <= 0.116)) tmp = Float64(x + cos(y)); else tmp = Float64(1.0 + Float64(x + Float64(y * Float64(Float64(y * Float64(Float64(0.16666666666666666 * Float64(y * z)) - 0.5)) - z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -0.205) || ~((y <= 0.116))) tmp = x + cos(y); else tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -0.205], N[Not[LessEqual[y, 0.116]], $MachinePrecision]], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x + N[(y * N[(N[(y * N[(N[(0.16666666666666666 * N[(y * z), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.205 \lor \neg \left(y \leq 0.116\right):\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x + y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \left(y \cdot z\right) - 0.5\right) - z\right)\right)\\
\end{array}
\end{array}
if y < -0.204999999999999988 or 0.116000000000000006 < y Initial program 99.8%
Taylor expanded in z around 0 66.4%
+-commutative66.4%
Simplified66.4%
if -0.204999999999999988 < y < 0.116000000000000006Initial program 100.0%
Taylor expanded in y around 0 99.7%
Final simplification83.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -6000000000000.0) (not (<= y 150.0))) (+ x 1.0) (+ 1.0 (+ x (* y (- (* y (- (* 0.16666666666666666 (* y z)) 0.5)) z))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -6000000000000.0) || !(y <= 150.0)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 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 <= (-6000000000000.0d0)) .or. (.not. (y <= 150.0d0))) then
tmp = x + 1.0d0
else
tmp = 1.0d0 + (x + (y * ((y * ((0.16666666666666666d0 * (y * z)) - 0.5d0)) - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -6000000000000.0) || !(y <= 150.0)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -6000000000000.0) or not (y <= 150.0): tmp = x + 1.0 else: tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -6000000000000.0) || !(y <= 150.0)) tmp = Float64(x + 1.0); else tmp = Float64(1.0 + Float64(x + Float64(y * Float64(Float64(y * Float64(Float64(0.16666666666666666 * Float64(y * z)) - 0.5)) - z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -6000000000000.0) || ~((y <= 150.0))) tmp = x + 1.0; else tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -6000000000000.0], N[Not[LessEqual[y, 150.0]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[(1.0 + N[(x + N[(y * N[(N[(y * N[(N[(0.16666666666666666 * N[(y * z), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6000000000000 \lor \neg \left(y \leq 150\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x + y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \left(y \cdot z\right) - 0.5\right) - z\right)\right)\\
\end{array}
\end{array}
if y < -6e12 or 150 < y Initial program 99.8%
Taylor expanded in y around 0 42.1%
+-commutative42.1%
Simplified42.1%
if -6e12 < y < 150Initial program 100.0%
Taylor expanded in y around 0 99.2%
Final simplification73.1%
(FPCore (x y z) :precision binary64 (if (or (<= y -18500000000000.0) (not (<= y 480000.0))) (+ x 1.0) (+ 1.0 (+ x (* y (- (* y -0.5) z))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -18500000000000.0) || !(y <= 480000.0)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x + (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 <= (-18500000000000.0d0)) .or. (.not. (y <= 480000.0d0))) then
tmp = x + 1.0d0
else
tmp = 1.0d0 + (x + (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 <= -18500000000000.0) || !(y <= 480000.0)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x + (y * ((y * -0.5) - z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -18500000000000.0) or not (y <= 480000.0): tmp = x + 1.0 else: tmp = 1.0 + (x + (y * ((y * -0.5) - z))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -18500000000000.0) || !(y <= 480000.0)) tmp = Float64(x + 1.0); else tmp = Float64(1.0 + Float64(x + Float64(y * Float64(Float64(y * -0.5) - z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -18500000000000.0) || ~((y <= 480000.0))) tmp = x + 1.0; else tmp = 1.0 + (x + (y * ((y * -0.5) - z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -18500000000000.0], N[Not[LessEqual[y, 480000.0]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[(1.0 + N[(x + N[(y * N[(N[(y * -0.5), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -18500000000000 \lor \neg \left(y \leq 480000\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x + y \cdot \left(y \cdot -0.5 - z\right)\right)\\
\end{array}
\end{array}
if y < -1.85e13 or 4.8e5 < y Initial program 99.8%
Taylor expanded in y around 0 42.1%
+-commutative42.1%
Simplified42.1%
if -1.85e13 < y < 4.8e5Initial program 100.0%
Taylor expanded in y around 0 98.8%
Final simplification72.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -0.39) (not (<= y 3600000.0))) (+ x 1.0) (+ x (- 1.0 (* y z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -0.39) || !(y <= 3600000.0)) {
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 <= (-0.39d0)) .or. (.not. (y <= 3600000.0d0))) 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 <= -0.39) || !(y <= 3600000.0)) {
tmp = x + 1.0;
} else {
tmp = x + (1.0 - (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -0.39) or not (y <= 3600000.0): tmp = x + 1.0 else: tmp = x + (1.0 - (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -0.39) || !(y <= 3600000.0)) 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 <= -0.39) || ~((y <= 3600000.0))) tmp = x + 1.0; else tmp = x + (1.0 - (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -0.39], N[Not[LessEqual[y, 3600000.0]], $MachinePrecision]], 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 -0.39 \lor \neg \left(y \leq 3600000\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;x + \left(1 - y \cdot z\right)\\
\end{array}
\end{array}
if y < -0.39000000000000001 or 3.6e6 < y Initial program 99.8%
Taylor expanded in y around 0 43.4%
+-commutative43.4%
Simplified43.4%
if -0.39000000000000001 < y < 3.6e6Initial program 100.0%
Taylor expanded in y around 0 99.3%
associate-+r+99.3%
+-commutative99.3%
associate-+l+99.3%
mul-1-neg99.3%
unsub-neg99.3%
Simplified99.3%
Final simplification72.8%
(FPCore (x y z) :precision binary64 (if (or (<= x -9.5e-10) (not (<= x 8.4e-10))) (+ x 1.0) (- 1.0 (* y z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -9.5e-10) || !(x <= 8.4e-10)) {
tmp = x + 1.0;
} else {
tmp = 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 ((x <= (-9.5d-10)) .or. (.not. (x <= 8.4d-10))) then
tmp = x + 1.0d0
else
tmp = 1.0d0 - (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -9.5e-10) || !(x <= 8.4e-10)) {
tmp = x + 1.0;
} else {
tmp = 1.0 - (y * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -9.5e-10) or not (x <= 8.4e-10): tmp = x + 1.0 else: tmp = 1.0 - (y * z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -9.5e-10) || !(x <= 8.4e-10)) tmp = Float64(x + 1.0); else tmp = Float64(1.0 - Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -9.5e-10) || ~((x <= 8.4e-10))) tmp = x + 1.0; else tmp = 1.0 - (y * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -9.5e-10], N[Not[LessEqual[x, 8.4e-10]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{-10} \lor \neg \left(x \leq 8.4 \cdot 10^{-10}\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;1 - y \cdot z\\
\end{array}
\end{array}
if x < -9.50000000000000028e-10 or 8.3999999999999999e-10 < x Initial program 99.9%
Taylor expanded in y around 0 81.9%
+-commutative81.9%
Simplified81.9%
if -9.50000000000000028e-10 < x < 8.3999999999999999e-10Initial program 99.9%
Taylor expanded in z around -inf 99.7%
mul-1-neg99.7%
distribute-rgt-neg-in99.7%
distribute-lft-out--99.7%
mul-1-neg99.7%
remove-double-neg99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in y around 0 58.2%
associate-*r*58.2%
*-commutative58.2%
distribute-rgt-out58.2%
+-commutative58.2%
mul-1-neg58.2%
unsub-neg58.2%
+-commutative58.2%
Simplified58.2%
Taylor expanded in x around 0 58.1%
sub-neg58.1%
distribute-rgt-in58.1%
lft-mult-inverse58.3%
distribute-lft-neg-out58.3%
distribute-rgt-neg-in58.3%
Simplified58.3%
Final simplification70.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -6.2e+65) (not (<= z 2.25e+95))) (- x (* y z)) (+ x 1.0)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -6.2e+65) || !(z <= 2.25e+95)) {
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 <= (-6.2d+65)) .or. (.not. (z <= 2.25d+95))) 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 <= -6.2e+65) || !(z <= 2.25e+95)) {
tmp = x - (y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -6.2e+65) or not (z <= 2.25e+95): tmp = x - (y * z) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -6.2e+65) || !(z <= 2.25e+95)) 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 <= -6.2e+65) || ~((z <= 2.25e+95))) tmp = x - (y * z); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -6.2e+65], N[Not[LessEqual[z, 2.25e+95]], $MachinePrecision]], N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+65} \lor \neg \left(z \leq 2.25 \cdot 10^{+95}\right):\\
\;\;\;\;x - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if z < -6.19999999999999981e65 or 2.25000000000000008e95 < z Initial program 99.8%
Taylor expanded in z around -inf 99.7%
mul-1-neg99.7%
distribute-rgt-neg-in99.7%
distribute-lft-out--99.7%
mul-1-neg99.7%
remove-double-neg99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 93.1%
Taylor expanded in y around 0 58.3%
mul-1-neg58.3%
unsub-neg58.3%
Simplified58.3%
if -6.19999999999999981e65 < z < 2.25000000000000008e95Initial program 100.0%
Taylor expanded in y around 0 74.1%
+-commutative74.1%
Simplified74.1%
Final simplification68.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.5e+163) (not (<= z 2.7e+222))) (* z (- y)) (+ x 1.0)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.5e+163) || !(z <= 2.7e+222)) {
tmp = z * -y;
} 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 <= (-1.5d+163)) .or. (.not. (z <= 2.7d+222))) then
tmp = z * -y
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 <= -1.5e+163) || !(z <= 2.7e+222)) {
tmp = z * -y;
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.5e+163) or not (z <= 2.7e+222): tmp = z * -y else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.5e+163) || !(z <= 2.7e+222)) tmp = Float64(z * Float64(-y)); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.5e+163) || ~((z <= 2.7e+222))) tmp = z * -y; else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.5e+163], N[Not[LessEqual[z, 2.7e+222]], $MachinePrecision]], N[(z * (-y)), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+163} \lor \neg \left(z \leq 2.7 \cdot 10^{+222}\right):\\
\;\;\;\;z \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if z < -1.50000000000000007e163 or 2.70000000000000013e222 < z Initial program 99.8%
Taylor expanded in z around -inf 99.7%
mul-1-neg99.7%
distribute-rgt-neg-in99.7%
distribute-lft-out--99.7%
mul-1-neg99.7%
remove-double-neg99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in y around 0 69.4%
associate-*r*69.4%
*-commutative69.4%
distribute-rgt-out69.4%
+-commutative69.4%
mul-1-neg69.4%
unsub-neg69.4%
+-commutative69.4%
Simplified69.4%
Taylor expanded in z around inf 49.5%
mul-1-neg49.5%
distribute-lft-neg-out49.5%
*-commutative49.5%
Simplified49.5%
if -1.50000000000000007e163 < z < 2.70000000000000013e222Initial program 100.0%
Taylor expanded in y around 0 68.3%
+-commutative68.3%
Simplified68.3%
Final simplification64.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 60.0%
+-commutative60.0%
Simplified60.0%
(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%
Taylor expanded in x around inf 42.0%
herbie shell --seed 2024094
(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))))