
(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%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (sin y))))
(if (or (<= x -1.15e-7) (not (<= x 3.55e-9)))
(- (+ x 1.0) 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.15e-7) || !(x <= 3.55e-9)) {
tmp = (x + 1.0) - 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.15d-7)) .or. (.not. (x <= 3.55d-9))) then
tmp = (x + 1.0d0) - 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.15e-7) || !(x <= 3.55e-9)) {
tmp = (x + 1.0) - 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.15e-7) or not (x <= 3.55e-9): tmp = (x + 1.0) - 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.15e-7) || !(x <= 3.55e-9)) tmp = Float64(Float64(x + 1.0) - 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.15e-7) || ~((x <= 3.55e-9))) tmp = (x + 1.0) - 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.15e-7], N[Not[LessEqual[x, 3.55e-9]], $MachinePrecision]], N[(N[(x + 1.0), $MachinePrecision] - 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.15 \cdot 10^{-7} \lor \neg \left(x \leq 3.55 \cdot 10^{-9}\right):\\
\;\;\;\;\left(x + 1\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;\cos y - t\_0\\
\end{array}
\end{array}
if x < -1.14999999999999997e-7 or 3.54999999999999994e-9 < x Initial program 99.9%
Taylor expanded in y around 0 98.4%
+-commutative98.4%
Simplified98.4%
if -1.14999999999999997e-7 < x < 3.54999999999999994e-9Initial program 99.9%
Taylor expanded in x around 0 99.9%
Final simplification99.2%
(FPCore (x y z)
:precision binary64
(if (or (<= z -3.15e+81)
(not (or (<= z 61000.0) (and (not (<= z 9.5e+55)) (<= z 5.2e+95)))))
(* (sin y) (- z))
(+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3.15e+81) || !((z <= 61000.0) || (!(z <= 9.5e+55) && (z <= 5.2e+95)))) {
tmp = sin(y) * -z;
} 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 <= (-3.15d+81)) .or. (.not. (z <= 61000.0d0) .or. (.not. (z <= 9.5d+55)) .and. (z <= 5.2d+95))) then
tmp = sin(y) * -z
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 <= -3.15e+81) || !((z <= 61000.0) || (!(z <= 9.5e+55) && (z <= 5.2e+95)))) {
tmp = Math.sin(y) * -z;
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3.15e+81) or not ((z <= 61000.0) or (not (z <= 9.5e+55) and (z <= 5.2e+95))): tmp = math.sin(y) * -z else: tmp = x + math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3.15e+81) || !((z <= 61000.0) || (!(z <= 9.5e+55) && (z <= 5.2e+95)))) tmp = Float64(sin(y) * Float64(-z)); else tmp = Float64(x + cos(y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -3.15e+81) || ~(((z <= 61000.0) || (~((z <= 9.5e+55)) && (z <= 5.2e+95))))) tmp = sin(y) * -z; else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3.15e+81], N[Not[Or[LessEqual[z, 61000.0], And[N[Not[LessEqual[z, 9.5e+55]], $MachinePrecision], LessEqual[z, 5.2e+95]]]], $MachinePrecision]], N[(N[Sin[y], $MachinePrecision] * (-z)), $MachinePrecision], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.15 \cdot 10^{+81} \lor \neg \left(z \leq 61000 \lor \neg \left(z \leq 9.5 \cdot 10^{+55}\right) \land z \leq 5.2 \cdot 10^{+95}\right):\\
\;\;\;\;\sin y \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -3.1500000000000002e81 or 61000 < z < 9.49999999999999989e55 or 5.19999999999999981e95 < z Initial program 99.8%
Taylor expanded in z around inf 76.3%
associate-*r*76.3%
neg-mul-176.3%
*-commutative76.3%
Simplified76.3%
if -3.1500000000000002e81 < z < 61000 or 9.49999999999999989e55 < z < 5.19999999999999981e95Initial program 100.0%
Taylor expanded in z around 0 93.3%
+-commutative93.3%
Simplified93.3%
Final simplification87.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -700000.0) (not (<= z 0.05))) (- (+ x 1.0) (* z (sin y))) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -700000.0) || !(z <= 0.05)) {
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 <= (-700000.0d0)) .or. (.not. (z <= 0.05d0))) 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 <= -700000.0) || !(z <= 0.05)) {
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 <= -700000.0) or not (z <= 0.05): 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 <= -700000.0) || !(z <= 0.05)) tmp = Float64(Float64(x + 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 <= -700000.0) || ~((z <= 0.05))) 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, -700000.0], N[Not[LessEqual[z, 0.05]], $MachinePrecision]], N[(N[(x + 1.0), $MachinePrecision] - 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 -700000 \lor \neg \left(z \leq 0.05\right):\\
\;\;\;\;\left(x + 1\right) - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -7e5 or 0.050000000000000003 < z Initial program 99.8%
Taylor expanded in y around 0 98.7%
+-commutative98.7%
Simplified98.7%
if -7e5 < z < 0.050000000000000003Initial program 100.0%
Taylor expanded in z around 0 99.6%
+-commutative99.6%
Simplified99.6%
Final simplification99.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -320000000000.0) (not (<= z 2500.0))) (- x (* z (sin y))) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -320000000000.0) || !(z <= 2500.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 <= (-320000000000.0d0)) .or. (.not. (z <= 2500.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 <= -320000000000.0) || !(z <= 2500.0)) {
tmp = x - (z * Math.sin(y));
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -320000000000.0) or not (z <= 2500.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 <= -320000000000.0) || !(z <= 2500.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 <= -320000000000.0) || ~((z <= 2500.0))) tmp = x - (z * sin(y)); else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -320000000000.0], N[Not[LessEqual[z, 2500.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 -320000000000 \lor \neg \left(z \leq 2500\right):\\
\;\;\;\;x - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -3.2e11 or 2500 < z Initial program 99.8%
Taylor expanded in x around inf 87.3%
if -3.2e11 < z < 2500Initial program 100.0%
Taylor expanded in z around 0 98.9%
+-commutative98.9%
Simplified98.9%
Final simplification93.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -0.0016) (not (<= y 0.58))) (+ 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.0016) || !(y <= 0.58)) {
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.0016d0)) .or. (.not. (y <= 0.58d0))) 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.0016) || !(y <= 0.58)) {
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.0016) or not (y <= 0.58): 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.0016) || !(y <= 0.58)) 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.0016) || ~((y <= 0.58))) 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.0016], N[Not[LessEqual[y, 0.58]], $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.0016 \lor \neg \left(y \leq 0.58\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.00160000000000000008 or 0.57999999999999996 < y Initial program 99.9%
Taylor expanded in z around 0 58.7%
+-commutative58.7%
Simplified58.7%
if -0.00160000000000000008 < y < 0.57999999999999996Initial program 100.0%
Taylor expanded in y around 0 99.4%
Final simplification76.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -23000000000.0) (not (<= y 18.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 <= -23000000000.0) || !(y <= 18.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 <= (-23000000000.0d0)) .or. (.not. (y <= 18.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 <= -23000000000.0) || !(y <= 18.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 <= -23000000000.0) or not (y <= 18.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 <= -23000000000.0) || !(y <= 18.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 <= -23000000000.0) || ~((y <= 18.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, -23000000000.0], N[Not[LessEqual[y, 18.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 -23000000000 \lor \neg \left(y \leq 18\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 < -2.3e10 or 18 < y Initial program 99.9%
add-cube-cbrt97.9%
pow398.0%
associate--l+98.0%
Applied egg-rr98.0%
Taylor expanded in y around 0 40.4%
+-commutative40.4%
Simplified40.4%
if -2.3e10 < y < 18Initial program 100.0%
Taylor expanded in y around 0 97.8%
Final simplification66.9%
(FPCore (x y z)
:precision binary64
(if (<= y -140000000000.0)
(+ x 1.0)
(if (<= y 160000000.0)
(+ 1.0 (+ x (* y (- (* y -0.5) z))))
(* x (+ 1.0 (/ 1.0 x))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -140000000000.0) {
tmp = x + 1.0;
} else if (y <= 160000000.0) {
tmp = 1.0 + (x + (y * ((y * -0.5) - z)));
} else {
tmp = x * (1.0 + (1.0 / 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 (y <= (-140000000000.0d0)) then
tmp = x + 1.0d0
else if (y <= 160000000.0d0) then
tmp = 1.0d0 + (x + (y * ((y * (-0.5d0)) - z)))
else
tmp = x * (1.0d0 + (1.0d0 / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -140000000000.0) {
tmp = x + 1.0;
} else if (y <= 160000000.0) {
tmp = 1.0 + (x + (y * ((y * -0.5) - z)));
} else {
tmp = x * (1.0 + (1.0 / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -140000000000.0: tmp = x + 1.0 elif y <= 160000000.0: tmp = 1.0 + (x + (y * ((y * -0.5) - z))) else: tmp = x * (1.0 + (1.0 / x)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -140000000000.0) tmp = Float64(x + 1.0); elseif (y <= 160000000.0) tmp = Float64(1.0 + Float64(x + Float64(y * Float64(Float64(y * -0.5) - z)))); else tmp = Float64(x * Float64(1.0 + Float64(1.0 / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -140000000000.0) tmp = x + 1.0; elseif (y <= 160000000.0) tmp = 1.0 + (x + (y * ((y * -0.5) - z))); else tmp = x * (1.0 + (1.0 / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -140000000000.0], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 160000000.0], N[(1.0 + N[(x + N[(y * N[(N[(y * -0.5), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -140000000000:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;y \leq 160000000:\\
\;\;\;\;1 + \left(x + y \cdot \left(y \cdot -0.5 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + \frac{1}{x}\right)\\
\end{array}
\end{array}
if y < -1.4e11Initial program 99.9%
add-cube-cbrt97.8%
pow397.9%
associate--l+97.9%
Applied egg-rr97.9%
Taylor expanded in y around 0 39.7%
+-commutative39.7%
Simplified39.7%
if -1.4e11 < y < 1.6e8Initial program 100.0%
Taylor expanded in y around 0 96.2%
if 1.6e8 < y Initial program 99.8%
Taylor expanded in x around inf 90.6%
associate--l+90.6%
div-sub90.6%
Simplified90.6%
Taylor expanded in y around 0 41.2%
Final simplification66.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -7.2e+21) (not (<= y 5800.0))) (+ x 1.0) (+ 1.0 (- x (* y z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -7.2e+21) || !(y <= 5800.0)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x - (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 <= (-7.2d+21)) .or. (.not. (y <= 5800.0d0))) then
tmp = x + 1.0d0
else
tmp = 1.0d0 + (x - (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -7.2e+21) || !(y <= 5800.0)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x - (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -7.2e+21) or not (y <= 5800.0): tmp = x + 1.0 else: tmp = 1.0 + (x - (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -7.2e+21) || !(y <= 5800.0)) tmp = Float64(x + 1.0); else tmp = Float64(1.0 + Float64(x - Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -7.2e+21) || ~((y <= 5800.0))) tmp = x + 1.0; else tmp = 1.0 + (x - (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -7.2e+21], N[Not[LessEqual[y, 5800.0]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[(1.0 + N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+21} \lor \neg \left(y \leq 5800\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x - y \cdot z\right)\\
\end{array}
\end{array}
if y < -7.2e21 or 5800 < y Initial program 99.9%
add-cube-cbrt97.9%
pow398.0%
associate--l+98.0%
Applied egg-rr98.0%
Taylor expanded in y around 0 40.3%
+-commutative40.3%
Simplified40.3%
if -7.2e21 < y < 5800Initial program 100.0%
Taylor expanded in y around 0 94.5%
mul-1-neg94.5%
unsub-neg94.5%
Simplified94.5%
Final simplification66.6%
(FPCore (x y z) :precision binary64 (if (or (<= x -3.7e-42) (not (<= x 0.019))) (+ x 1.0) (- 1.0 (* y z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -3.7e-42) || !(x <= 0.019)) {
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 <= (-3.7d-42)) .or. (.not. (x <= 0.019d0))) 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 <= -3.7e-42) || !(x <= 0.019)) {
tmp = x + 1.0;
} else {
tmp = 1.0 - (y * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -3.7e-42) or not (x <= 0.019): tmp = x + 1.0 else: tmp = 1.0 - (y * z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -3.7e-42) || !(x <= 0.019)) 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 <= -3.7e-42) || ~((x <= 0.019))) tmp = x + 1.0; else tmp = 1.0 - (y * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -3.7e-42], N[Not[LessEqual[x, 0.019]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.7 \cdot 10^{-42} \lor \neg \left(x \leq 0.019\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;1 - y \cdot z\\
\end{array}
\end{array}
if x < -3.7000000000000002e-42 or 0.0189999999999999995 < x Initial program 99.9%
add-cube-cbrt98.1%
pow398.1%
associate--l+98.1%
Applied egg-rr98.1%
Taylor expanded in y around 0 79.9%
+-commutative79.9%
Simplified79.9%
if -3.7000000000000002e-42 < x < 0.0189999999999999995Initial program 99.9%
Taylor expanded in x around inf 81.0%
associate--l+81.0%
div-sub81.0%
Simplified81.0%
Taylor expanded in y around 0 46.8%
mul-1-neg46.8%
unsub-neg46.8%
Simplified46.8%
Taylor expanded in x around 0 53.0%
Final simplification65.6%
(FPCore (x y z) :precision binary64 (if (<= z 4e+210) (+ x 1.0) (- (* y z))))
double code(double x, double y, double z) {
double tmp;
if (z <= 4e+210) {
tmp = x + 1.0;
} else {
tmp = -(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 (z <= 4d+210) then
tmp = x + 1.0d0
else
tmp = -(y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 4e+210) {
tmp = x + 1.0;
} else {
tmp = -(y * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 4e+210: tmp = x + 1.0 else: tmp = -(y * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= 4e+210) tmp = Float64(x + 1.0); else tmp = Float64(-Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 4e+210) tmp = x + 1.0; else tmp = -(y * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 4e+210], N[(x + 1.0), $MachinePrecision], (-N[(y * z), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4 \cdot 10^{+210}:\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;-y \cdot z\\
\end{array}
\end{array}
if z < 3.99999999999999971e210Initial program 99.9%
add-cube-cbrt98.4%
pow398.5%
associate--l+98.5%
Applied egg-rr98.5%
Taylor expanded in y around 0 62.3%
+-commutative62.3%
Simplified62.3%
if 3.99999999999999971e210 < z Initial program 99.8%
Taylor expanded in x around inf 73.6%
associate--l+73.6%
div-sub73.6%
Simplified73.6%
Taylor expanded in y around 0 30.2%
mul-1-neg30.2%
unsub-neg30.2%
Simplified30.2%
Taylor expanded in y around inf 35.7%
associate-*r*35.7%
mul-1-neg35.7%
Simplified35.7%
Final simplification60.4%
(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%
add-cube-cbrt98.4%
pow398.5%
associate--l+98.5%
Applied egg-rr98.5%
Taylor expanded in y around 0 58.5%
+-commutative58.5%
Simplified58.5%
Final simplification58.5%
(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%
add-cube-cbrt98.4%
pow398.5%
associate--l+98.5%
Applied egg-rr98.5%
Taylor expanded in x around inf 37.6%
Final simplification37.6%
herbie shell --seed 2024130
(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))))