
(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.0) (not (<= x 0.75))) (- 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.75)) {
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.75d0))) 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.75)) {
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.75): 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.75)) 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.75))) 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.75]], $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.75\right):\\
\;\;\;\;x - t\_0\\
\mathbf{else}:\\
\;\;\;\;\cos y - t\_0\\
\end{array}
\end{array}
if x < -1 or 0.75 < x Initial program 100.0%
Taylor expanded in z around -inf 78.7%
mul-1-neg78.7%
distribute-rgt-neg-in78.7%
distribute-lft-out--78.7%
mul-1-neg78.7%
remove-double-neg78.7%
+-commutative78.7%
Simplified78.7%
Taylor expanded in x around inf 77.4%
sub-neg77.4%
distribute-rgt-in77.4%
div-inv77.2%
associate-*l*98.5%
lft-mult-inverse98.6%
*-rgt-identity98.6%
Applied egg-rr98.6%
if -1 < x < 0.75Initial program 99.9%
Taylor expanded in x around 0 99.0%
Final simplification98.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -8e+79) (not (<= z 5.1e+106))) (- x (* z (sin y))) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -8e+79) || !(z <= 5.1e+106)) {
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 <= (-8d+79)) .or. (.not. (z <= 5.1d+106))) 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 <= -8e+79) || !(z <= 5.1e+106)) {
tmp = x - (z * Math.sin(y));
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -8e+79) or not (z <= 5.1e+106): tmp = x - (z * math.sin(y)) else: tmp = x + math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -8e+79) || !(z <= 5.1e+106)) 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 <= -8e+79) || ~((z <= 5.1e+106))) tmp = x - (z * sin(y)); else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -8e+79], N[Not[LessEqual[z, 5.1e+106]], $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 -8 \cdot 10^{+79} \lor \neg \left(z \leq 5.1 \cdot 10^{+106}\right):\\
\;\;\;\;x - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -7.99999999999999974e79 or 5.09999999999999971e106 < 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 95.9%
sub-neg95.9%
distribute-rgt-in95.9%
div-inv95.8%
associate-*l*95.9%
lft-mult-inverse96.0%
*-rgt-identity96.0%
Applied egg-rr96.0%
if -7.99999999999999974e79 < z < 5.09999999999999971e106Initial program 100.0%
Taylor expanded in z around 0 94.8%
+-commutative94.8%
Simplified94.8%
Final simplification95.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -3.6e+127) (not (<= z 1.46e+133))) (* (sin y) (- z)) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3.6e+127) || !(z <= 1.46e+133)) {
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.6d+127)) .or. (.not. (z <= 1.46d+133))) 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.6e+127) || !(z <= 1.46e+133)) {
tmp = Math.sin(y) * -z;
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3.6e+127) or not (z <= 1.46e+133): tmp = math.sin(y) * -z else: tmp = x + math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3.6e+127) || !(z <= 1.46e+133)) 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.6e+127) || ~((z <= 1.46e+133))) tmp = sin(y) * -z; else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3.6e+127], N[Not[LessEqual[z, 1.46e+133]], $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.6 \cdot 10^{+127} \lor \neg \left(z \leq 1.46 \cdot 10^{+133}\right):\\
\;\;\;\;\sin y \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -3.59999999999999979e127 or 1.46000000000000005e133 < z Initial program 99.8%
Taylor expanded in z around inf 79.0%
associate-*r*79.0%
neg-mul-179.0%
*-commutative79.0%
Simplified79.0%
if -3.59999999999999979e127 < z < 1.46000000000000005e133Initial program 100.0%
Taylor expanded in z around 0 93.1%
+-commutative93.1%
Simplified93.1%
Final simplification89.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -0.029) (not (<= y 13000000000000.0))) (+ 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.029) || !(y <= 13000000000000.0)) {
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.029d0)) .or. (.not. (y <= 13000000000000.0d0))) 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.029) || !(y <= 13000000000000.0)) {
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.029) or not (y <= 13000000000000.0): 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.029) || !(y <= 13000000000000.0)) 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.029) || ~((y <= 13000000000000.0))) 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.029], N[Not[LessEqual[y, 13000000000000.0]], $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.029 \lor \neg \left(y \leq 13000000000000\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.0290000000000000015 or 1.3e13 < y Initial program 99.9%
Taylor expanded in z around 0 66.0%
+-commutative66.0%
Simplified66.0%
if -0.0290000000000000015 < y < 1.3e13Initial program 100.0%
Taylor expanded in y around 0 98.4%
Final simplification83.0%
(FPCore (x y z) :precision binary64 (if (or (<= y -3.8e+43) (not (<= y 3.75e+31))) (+ 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 <= -3.8e+43) || !(y <= 3.75e+31)) {
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 <= (-3.8d+43)) .or. (.not. (y <= 3.75d+31))) 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 <= -3.8e+43) || !(y <= 3.75e+31)) {
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 <= -3.8e+43) or not (y <= 3.75e+31): 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 <= -3.8e+43) || !(y <= 3.75e+31)) 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 <= -3.8e+43) || ~((y <= 3.75e+31))) 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, -3.8e+43], N[Not[LessEqual[y, 3.75e+31]], $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 -3.8 \cdot 10^{+43} \lor \neg \left(y \leq 3.75 \cdot 10^{+31}\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 < -3.80000000000000008e43 or 3.75e31 < y Initial program 99.9%
Taylor expanded in y around 0 44.8%
+-commutative44.8%
Simplified44.8%
if -3.80000000000000008e43 < y < 3.75e31Initial program 100.0%
Taylor expanded in y around 0 93.2%
Final simplification72.4%
(FPCore (x y z) :precision binary64 (if (or (<= y -4.5e+24) (not (<= y 5.8e+31))) (+ x 1.0) (+ 1.0 (+ x (* y (- (* y -0.5) z))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4.5e+24) || !(y <= 5.8e+31)) {
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 <= (-4.5d+24)) .or. (.not. (y <= 5.8d+31))) 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 <= -4.5e+24) || !(y <= 5.8e+31)) {
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 <= -4.5e+24) or not (y <= 5.8e+31): 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 <= -4.5e+24) || !(y <= 5.8e+31)) 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 <= -4.5e+24) || ~((y <= 5.8e+31))) 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, -4.5e+24], N[Not[LessEqual[y, 5.8e+31]], $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 -4.5 \cdot 10^{+24} \lor \neg \left(y \leq 5.8 \cdot 10^{+31}\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x + y \cdot \left(y \cdot -0.5 - z\right)\right)\\
\end{array}
\end{array}
if y < -4.50000000000000019e24 or 5.8000000000000001e31 < y Initial program 99.9%
Taylor expanded in y around 0 44.1%
+-commutative44.1%
Simplified44.1%
if -4.50000000000000019e24 < y < 5.8000000000000001e31Initial program 100.0%
Taylor expanded in y around 0 94.2%
Final simplification72.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.3e+23) (not (<= y 1.35e+32))) (+ x 1.0) (+ 1.0 (- x (* y z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.3e+23) || !(y <= 1.35e+32)) {
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 <= (-2.3d+23)) .or. (.not. (y <= 1.35d+32))) 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 <= -2.3e+23) || !(y <= 1.35e+32)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x - (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.3e+23) or not (y <= 1.35e+32): tmp = x + 1.0 else: tmp = 1.0 + (x - (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.3e+23) || !(y <= 1.35e+32)) 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 <= -2.3e+23) || ~((y <= 1.35e+32))) tmp = x + 1.0; else tmp = 1.0 + (x - (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.3e+23], N[Not[LessEqual[y, 1.35e+32]], $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 -2.3 \cdot 10^{+23} \lor \neg \left(y \leq 1.35 \cdot 10^{+32}\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x - y \cdot z\right)\\
\end{array}
\end{array}
if y < -2.3e23 or 1.35000000000000006e32 < y Initial program 99.9%
Taylor expanded in y around 0 44.1%
+-commutative44.1%
Simplified44.1%
if -2.3e23 < y < 1.35000000000000006e32Initial program 100.0%
Taylor expanded in y around 0 93.7%
mul-1-neg93.7%
unsub-neg93.7%
Simplified93.7%
Final simplification72.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -3.4e+217) (not (<= z 5.7e+127))) (- x (* y z)) (+ x 1.0)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3.4e+217) || !(z <= 5.7e+127)) {
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 <= (-3.4d+217)) .or. (.not. (z <= 5.7d+127))) 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 <= -3.4e+217) || !(z <= 5.7e+127)) {
tmp = x - (y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3.4e+217) or not (z <= 5.7e+127): tmp = x - (y * z) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3.4e+217) || !(z <= 5.7e+127)) 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 <= -3.4e+217) || ~((z <= 5.7e+127))) tmp = x - (y * z); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3.4e+217], N[Not[LessEqual[z, 5.7e+127]], $MachinePrecision]], N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+217} \lor \neg \left(z \leq 5.7 \cdot 10^{+127}\right):\\
\;\;\;\;x - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if z < -3.3999999999999999e217 or 5.70000000000000043e127 < 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 97.4%
Taylor expanded in y around 0 52.0%
mul-1-neg52.0%
unsub-neg52.0%
Simplified52.0%
if -3.3999999999999999e217 < z < 5.70000000000000043e127Initial program 100.0%
Taylor expanded in y around 0 74.6%
+-commutative74.6%
Simplified74.6%
Final simplification69.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -8.8e+249) (not (<= z 7.4e+133))) (* y (- z)) (+ x 1.0)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -8.8e+249) || !(z <= 7.4e+133)) {
tmp = 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 <= (-8.8d+249)) .or. (.not. (z <= 7.4d+133))) then
tmp = 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 <= -8.8e+249) || !(z <= 7.4e+133)) {
tmp = y * -z;
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -8.8e+249) or not (z <= 7.4e+133): tmp = y * -z else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -8.8e+249) || !(z <= 7.4e+133)) tmp = Float64(y * Float64(-z)); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -8.8e+249) || ~((z <= 7.4e+133))) tmp = y * -z; else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -8.8e+249], N[Not[LessEqual[z, 7.4e+133]], $MachinePrecision]], N[(y * (-z)), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{+249} \lor \neg \left(z \leq 7.4 \cdot 10^{+133}\right):\\
\;\;\;\;y \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if z < -8.7999999999999993e249 or 7.40000000000000047e133 < z Initial program 99.8%
add-cube-cbrt97.7%
pow397.9%
associate--l+97.9%
Applied egg-rr97.9%
Taylor expanded in z around -inf 86.7%
neg-mul-186.7%
Simplified86.7%
Taylor expanded in y around 0 43.0%
associate-*r*43.0%
mul-1-neg43.0%
Simplified43.0%
if -8.7999999999999993e249 < z < 7.40000000000000047e133Initial program 100.0%
Taylor expanded in y around 0 72.9%
+-commutative72.9%
Simplified72.9%
Final simplification68.0%
(FPCore (x y z) :precision binary64 (if (<= x -0.82) x (if (<= x 1.3e-15) 1.0 x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -0.82) {
tmp = x;
} else if (x <= 1.3e-15) {
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 <= (-0.82d0)) then
tmp = x
else if (x <= 1.3d-15) 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 <= -0.82) {
tmp = x;
} else if (x <= 1.3e-15) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -0.82: tmp = x elif x <= 1.3e-15: tmp = 1.0 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -0.82) tmp = x; elseif (x <= 1.3e-15) tmp = 1.0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -0.82) tmp = x; elseif (x <= 1.3e-15) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -0.82], x, If[LessEqual[x, 1.3e-15], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.82:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-15}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -0.819999999999999951 or 1.30000000000000002e-15 < x Initial program 100.0%
Taylor expanded in x around inf 78.9%
if -0.819999999999999951 < x < 1.30000000000000002e-15Initial 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 43.5%
+-commutative43.5%
Simplified43.5%
Taylor expanded in x around 0 43.1%
Final simplification62.2%
(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 63.0%
+-commutative63.0%
Simplified63.0%
Final simplification63.0%
(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 z around -inf 88.7%
mul-1-neg88.7%
distribute-rgt-neg-in88.7%
distribute-lft-out--88.7%
mul-1-neg88.7%
remove-double-neg88.7%
+-commutative88.7%
Simplified88.7%
Taylor expanded in y around 0 51.8%
+-commutative51.8%
Simplified51.8%
Taylor expanded in x around 0 21.6%
Final simplification21.6%
herbie shell --seed 2024055
(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))))