
(FPCore (x y z) :precision binary64 (+ (+ x (sin y)) (* z (cos y))))
double code(double x, double y, double z) {
return (x + sin(y)) + (z * cos(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 + sin(y)) + (z * cos(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.sin(y)) + (z * Math.cos(y));
}
def code(x, y, z): return (x + math.sin(y)) + (z * math.cos(y))
function code(x, y, z) return Float64(Float64(x + sin(y)) + Float64(z * cos(y))) end
function tmp = code(x, y, z) tmp = (x + sin(y)) + (z * cos(y)); end
code[x_, y_, z_] := N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \sin y\right) + z \cdot \cos y
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ (+ x (sin y)) (* z (cos y))))
double code(double x, double y, double z) {
return (x + sin(y)) + (z * cos(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 + sin(y)) + (z * cos(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.sin(y)) + (z * Math.cos(y));
}
def code(x, y, z): return (x + math.sin(y)) + (z * math.cos(y))
function code(x, y, z) return Float64(Float64(x + sin(y)) + Float64(z * cos(y))) end
function tmp = code(x, y, z) tmp = (x + sin(y)) + (z * cos(y)); end
code[x_, y_, z_] := N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \sin y\right) + z \cdot \cos y
\end{array}
(FPCore (x y z) :precision binary64 (+ (+ x (sin y)) (* z (cos y))))
double code(double x, double y, double z) {
return (x + sin(y)) + (z * cos(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 + sin(y)) + (z * cos(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.sin(y)) + (z * Math.cos(y));
}
def code(x, y, z): return (x + math.sin(y)) + (z * math.cos(y))
function code(x, y, z) return Float64(Float64(x + sin(y)) + Float64(z * cos(y))) end
function tmp = code(x, y, z) tmp = (x + sin(y)) + (z * cos(y)); end
code[x_, y_, z_] := N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \sin y\right) + z \cdot \cos y
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (cos y))))
(if (<= z -8.6e+121)
t_0
(if (<= z -2.8e-228)
(+ x z)
(if (<= z 2.4e-149) (+ z (+ x y)) (if (<= z 7e+127) (+ x z) t_0))))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -8.6e+121) {
tmp = t_0;
} else if (z <= -2.8e-228) {
tmp = x + z;
} else if (z <= 2.4e-149) {
tmp = z + (x + y);
} else if (z <= 7e+127) {
tmp = x + z;
} else {
tmp = 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 * cos(y)
if (z <= (-8.6d+121)) then
tmp = t_0
else if (z <= (-2.8d-228)) then
tmp = x + z
else if (z <= 2.4d-149) then
tmp = z + (x + y)
else if (z <= 7d+127) then
tmp = x + z
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * Math.cos(y);
double tmp;
if (z <= -8.6e+121) {
tmp = t_0;
} else if (z <= -2.8e-228) {
tmp = x + z;
} else if (z <= 2.4e-149) {
tmp = z + (x + y);
} else if (z <= 7e+127) {
tmp = x + z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -8.6e+121: tmp = t_0 elif z <= -2.8e-228: tmp = x + z elif z <= 2.4e-149: tmp = z + (x + y) elif z <= 7e+127: tmp = x + z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * cos(y)) tmp = 0.0 if (z <= -8.6e+121) tmp = t_0; elseif (z <= -2.8e-228) tmp = Float64(x + z); elseif (z <= 2.4e-149) tmp = Float64(z + Float64(x + y)); elseif (z <= 7e+127) tmp = Float64(x + z); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * cos(y); tmp = 0.0; if (z <= -8.6e+121) tmp = t_0; elseif (z <= -2.8e-228) tmp = x + z; elseif (z <= 2.4e-149) tmp = z + (x + y); elseif (z <= 7e+127) tmp = x + z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.6e+121], t$95$0, If[LessEqual[z, -2.8e-228], N[(x + z), $MachinePrecision], If[LessEqual[z, 2.4e-149], N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e+127], N[(x + z), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -8.6 \cdot 10^{+121}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-228}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-149}:\\
\;\;\;\;z + \left(x + y\right)\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+127}:\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -8.5999999999999994e121 or 6.99999999999999956e127 < z Initial program 99.9%
Taylor expanded in z around inf 88.5%
if -8.5999999999999994e121 < z < -2.8000000000000003e-228 or 2.4000000000000001e-149 < z < 6.99999999999999956e127Initial program 100.0%
Taylor expanded in y around 0 73.5%
+-commutative73.5%
Simplified73.5%
if -2.8000000000000003e-228 < z < 2.4000000000000001e-149Initial program 100.0%
Taylor expanded in y around 0 75.4%
+-commutative75.4%
+-commutative75.4%
associate-+l+75.4%
Simplified75.4%
Final simplification78.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (cos y))))
(if (<= z -1.8e+122)
t_0
(if (<= z -1.3e-24)
(+ x z)
(if (<= z 2800000000.0)
(+ x (sin y))
(if (<= z 7e+127) (+ x z) t_0))))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -1.8e+122) {
tmp = t_0;
} else if (z <= -1.3e-24) {
tmp = x + z;
} else if (z <= 2800000000.0) {
tmp = x + sin(y);
} else if (z <= 7e+127) {
tmp = x + z;
} else {
tmp = 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 * cos(y)
if (z <= (-1.8d+122)) then
tmp = t_0
else if (z <= (-1.3d-24)) then
tmp = x + z
else if (z <= 2800000000.0d0) then
tmp = x + sin(y)
else if (z <= 7d+127) then
tmp = x + z
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * Math.cos(y);
double tmp;
if (z <= -1.8e+122) {
tmp = t_0;
} else if (z <= -1.3e-24) {
tmp = x + z;
} else if (z <= 2800000000.0) {
tmp = x + Math.sin(y);
} else if (z <= 7e+127) {
tmp = x + z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -1.8e+122: tmp = t_0 elif z <= -1.3e-24: tmp = x + z elif z <= 2800000000.0: tmp = x + math.sin(y) elif z <= 7e+127: tmp = x + z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * cos(y)) tmp = 0.0 if (z <= -1.8e+122) tmp = t_0; elseif (z <= -1.3e-24) tmp = Float64(x + z); elseif (z <= 2800000000.0) tmp = Float64(x + sin(y)); elseif (z <= 7e+127) tmp = Float64(x + z); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * cos(y); tmp = 0.0; if (z <= -1.8e+122) tmp = t_0; elseif (z <= -1.3e-24) tmp = x + z; elseif (z <= 2800000000.0) tmp = x + sin(y); elseif (z <= 7e+127) tmp = x + z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e+122], t$95$0, If[LessEqual[z, -1.3e-24], N[(x + z), $MachinePrecision], If[LessEqual[z, 2800000000.0], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e+127], N[(x + z), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+122}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-24}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;z \leq 2800000000:\\
\;\;\;\;x + \sin y\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+127}:\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.8000000000000001e122 or 6.99999999999999956e127 < z Initial program 99.9%
Taylor expanded in z around inf 88.5%
if -1.8000000000000001e122 < z < -1.3e-24 or 2.8e9 < z < 6.99999999999999956e127Initial program 100.0%
Taylor expanded in y around 0 87.3%
+-commutative87.3%
Simplified87.3%
if -1.3e-24 < z < 2.8e9Initial program 100.0%
Taylor expanded in z around 0 92.5%
+-commutative92.5%
Simplified92.5%
Final simplification90.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.05e-25) (not (<= z 7e-31))) (+ x (* z (cos y))) (+ x (sin y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.05e-25) || !(z <= 7e-31)) {
tmp = x + (z * cos(y));
} else {
tmp = x + 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 ((z <= (-2.05d-25)) .or. (.not. (z <= 7d-31))) then
tmp = x + (z * cos(y))
else
tmp = x + sin(y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2.05e-25) || !(z <= 7e-31)) {
tmp = x + (z * Math.cos(y));
} else {
tmp = x + Math.sin(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.05e-25) or not (z <= 7e-31): tmp = x + (z * math.cos(y)) else: tmp = x + math.sin(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.05e-25) || !(z <= 7e-31)) tmp = Float64(x + Float64(z * cos(y))); else tmp = Float64(x + sin(y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.05e-25) || ~((z <= 7e-31))) tmp = x + (z * cos(y)); else tmp = x + sin(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.05e-25], N[Not[LessEqual[z, 7e-31]], $MachinePrecision]], N[(x + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{-25} \lor \neg \left(z \leq 7 \cdot 10^{-31}\right):\\
\;\;\;\;x + z \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;x + \sin y\\
\end{array}
\end{array}
if z < -2.04999999999999994e-25 or 6.99999999999999971e-31 < z Initial program 99.9%
Taylor expanded in x around inf 99.9%
Taylor expanded in x around inf 97.4%
if -2.04999999999999994e-25 < z < 6.99999999999999971e-31Initial program 100.0%
Taylor expanded in z around 0 94.7%
+-commutative94.7%
Simplified94.7%
Final simplification96.1%
(FPCore (x y z) :precision binary64 (if (or (<= z -23.0) (not (<= z 0.084))) (+ x (* z (cos y))) (+ (+ x (sin y)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -23.0) || !(z <= 0.084)) {
tmp = x + (z * cos(y));
} else {
tmp = (x + sin(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 <= (-23.0d0)) .or. (.not. (z <= 0.084d0))) then
tmp = x + (z * cos(y))
else
tmp = (x + sin(y)) + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -23.0) || !(z <= 0.084)) {
tmp = x + (z * Math.cos(y));
} else {
tmp = (x + Math.sin(y)) + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -23.0) or not (z <= 0.084): tmp = x + (z * math.cos(y)) else: tmp = (x + math.sin(y)) + z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -23.0) || !(z <= 0.084)) tmp = Float64(x + Float64(z * cos(y))); else tmp = Float64(Float64(x + sin(y)) + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -23.0) || ~((z <= 0.084))) tmp = x + (z * cos(y)); else tmp = (x + sin(y)) + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -23.0], N[Not[LessEqual[z, 0.084]], $MachinePrecision]], N[(x + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -23 \lor \neg \left(z \leq 0.084\right):\\
\;\;\;\;x + z \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;\left(x + \sin y\right) + z\\
\end{array}
\end{array}
if z < -23 or 0.0840000000000000052 < z Initial program 99.9%
Taylor expanded in x around inf 99.9%
Taylor expanded in x around inf 98.6%
if -23 < z < 0.0840000000000000052Initial program 100.0%
Taylor expanded in y around 0 99.3%
Final simplification99.0%
(FPCore (x y z)
:precision binary64
(if (or (<= y -22.0) (not (<= y 25500.0)))
(+ x z)
(+
x
(+
z
(*
y
(+
1.0
(*
y
(+
(* z -0.5)
(*
y
(-
(* y (+ (* y 0.008333333333333333) (* z 0.041666666666666664)))
0.16666666666666666))))))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -22.0) || !(y <= 25500.0)) {
tmp = x + z;
} else {
tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * ((y * ((y * 0.008333333333333333) + (z * 0.041666666666666664))) - 0.16666666666666666)))))));
}
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 <= (-22.0d0)) .or. (.not. (y <= 25500.0d0))) then
tmp = x + z
else
tmp = x + (z + (y * (1.0d0 + (y * ((z * (-0.5d0)) + (y * ((y * ((y * 0.008333333333333333d0) + (z * 0.041666666666666664d0))) - 0.16666666666666666d0)))))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -22.0) || !(y <= 25500.0)) {
tmp = x + z;
} else {
tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * ((y * ((y * 0.008333333333333333) + (z * 0.041666666666666664))) - 0.16666666666666666)))))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -22.0) or not (y <= 25500.0): tmp = x + z else: tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * ((y * ((y * 0.008333333333333333) + (z * 0.041666666666666664))) - 0.16666666666666666))))))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -22.0) || !(y <= 25500.0)) tmp = Float64(x + z); else tmp = Float64(x + Float64(z + Float64(y * Float64(1.0 + Float64(y * Float64(Float64(z * -0.5) + Float64(y * Float64(Float64(y * Float64(Float64(y * 0.008333333333333333) + Float64(z * 0.041666666666666664))) - 0.16666666666666666)))))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -22.0) || ~((y <= 25500.0))) tmp = x + z; else tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * ((y * ((y * 0.008333333333333333) + (z * 0.041666666666666664))) - 0.16666666666666666))))))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -22.0], N[Not[LessEqual[y, 25500.0]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(x + N[(z + N[(y * N[(1.0 + N[(y * N[(N[(z * -0.5), $MachinePrecision] + N[(y * N[(N[(y * N[(N[(y * 0.008333333333333333), $MachinePrecision] + N[(z * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -22 \lor \neg \left(y \leq 25500\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;x + \left(z + y \cdot \left(1 + y \cdot \left(z \cdot -0.5 + y \cdot \left(y \cdot \left(y \cdot 0.008333333333333333 + z \cdot 0.041666666666666664\right) - 0.16666666666666666\right)\right)\right)\right)\\
\end{array}
\end{array}
if y < -22 or 25500 < y Initial program 99.9%
Taylor expanded in y around 0 45.5%
+-commutative45.5%
Simplified45.5%
if -22 < y < 25500Initial program 100.0%
Taylor expanded in y around 0 99.2%
Final simplification73.4%
(FPCore (x y z)
:precision binary64
(if (or (<= y -5.9) (not (<= y 6.1)))
(+ x z)
(+
x
(+
z
(*
y
(+
1.0
(*
y
(+
(* z -0.5)
(* y (- (* 0.041666666666666664 (* y z)) 0.16666666666666666))))))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -5.9) || !(y <= 6.1)) {
tmp = x + z;
} else {
tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * ((0.041666666666666664 * (y * z)) - 0.16666666666666666)))))));
}
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 <= (-5.9d0)) .or. (.not. (y <= 6.1d0))) then
tmp = x + z
else
tmp = x + (z + (y * (1.0d0 + (y * ((z * (-0.5d0)) + (y * ((0.041666666666666664d0 * (y * z)) - 0.16666666666666666d0)))))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -5.9) || !(y <= 6.1)) {
tmp = x + z;
} else {
tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * ((0.041666666666666664 * (y * z)) - 0.16666666666666666)))))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -5.9) or not (y <= 6.1): tmp = x + z else: tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * ((0.041666666666666664 * (y * z)) - 0.16666666666666666))))))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -5.9) || !(y <= 6.1)) tmp = Float64(x + z); else tmp = Float64(x + Float64(z + Float64(y * Float64(1.0 + Float64(y * Float64(Float64(z * -0.5) + Float64(y * Float64(Float64(0.041666666666666664 * Float64(y * z)) - 0.16666666666666666)))))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -5.9) || ~((y <= 6.1))) tmp = x + z; else tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * ((0.041666666666666664 * (y * z)) - 0.16666666666666666))))))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -5.9], N[Not[LessEqual[y, 6.1]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(x + N[(z + N[(y * N[(1.0 + N[(y * N[(N[(z * -0.5), $MachinePrecision] + N[(y * N[(N[(0.041666666666666664 * N[(y * z), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.9 \lor \neg \left(y \leq 6.1\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;x + \left(z + y \cdot \left(1 + y \cdot \left(z \cdot -0.5 + y \cdot \left(0.041666666666666664 \cdot \left(y \cdot z\right) - 0.16666666666666666\right)\right)\right)\right)\\
\end{array}
\end{array}
if y < -5.9000000000000004 or 6.0999999999999996 < y Initial program 99.9%
Taylor expanded in y around 0 45.2%
+-commutative45.2%
Simplified45.2%
if -5.9000000000000004 < y < 6.0999999999999996Initial program 100.0%
Taylor expanded in y around 0 99.7%
Final simplification73.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -4.8) (not (<= y 29500.0))) (+ x z) (+ x (+ z (* y (+ 1.0 (* y (+ (* z -0.5) (* y -0.16666666666666666)))))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4.8) || !(y <= 29500.0)) {
tmp = x + z;
} else {
tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666))))));
}
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.8d0)) .or. (.not. (y <= 29500.0d0))) then
tmp = x + z
else
tmp = x + (z + (y * (1.0d0 + (y * ((z * (-0.5d0)) + (y * (-0.16666666666666666d0)))))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -4.8) || !(y <= 29500.0)) {
tmp = x + z;
} else {
tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666))))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4.8) or not (y <= 29500.0): tmp = x + z else: tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666)))))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4.8) || !(y <= 29500.0)) tmp = Float64(x + z); else tmp = Float64(x + Float64(z + Float64(y * Float64(1.0 + Float64(y * Float64(Float64(z * -0.5) + Float64(y * -0.16666666666666666))))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -4.8) || ~((y <= 29500.0))) tmp = x + z; else tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666)))))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4.8], N[Not[LessEqual[y, 29500.0]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(x + N[(z + N[(y * N[(1.0 + N[(y * N[(N[(z * -0.5), $MachinePrecision] + N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \lor \neg \left(y \leq 29500\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;x + \left(z + y \cdot \left(1 + y \cdot \left(z \cdot -0.5 + y \cdot -0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if y < -4.79999999999999982 or 29500 < y Initial program 99.9%
Taylor expanded in y around 0 45.2%
+-commutative45.2%
Simplified45.2%
if -4.79999999999999982 < y < 29500Initial program 100.0%
Taylor expanded in y around 0 99.5%
Final simplification73.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -6.3) (not (<= y 3.8e+31))) (+ x z) (+ x (+ z (* y (+ 1.0 (* y (* y -0.16666666666666666))))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -6.3) || !(y <= 3.8e+31)) {
tmp = x + z;
} else {
tmp = x + (z + (y * (1.0 + (y * (y * -0.16666666666666666)))));
}
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 <= (-6.3d0)) .or. (.not. (y <= 3.8d+31))) then
tmp = x + z
else
tmp = x + (z + (y * (1.0d0 + (y * (y * (-0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -6.3) || !(y <= 3.8e+31)) {
tmp = x + z;
} else {
tmp = x + (z + (y * (1.0 + (y * (y * -0.16666666666666666)))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -6.3) or not (y <= 3.8e+31): tmp = x + z else: tmp = x + (z + (y * (1.0 + (y * (y * -0.16666666666666666))))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -6.3) || !(y <= 3.8e+31)) tmp = Float64(x + z); else tmp = Float64(x + Float64(z + Float64(y * Float64(1.0 + Float64(y * Float64(y * -0.16666666666666666)))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -6.3) || ~((y <= 3.8e+31))) tmp = x + z; else tmp = x + (z + (y * (1.0 + (y * (y * -0.16666666666666666))))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -6.3], N[Not[LessEqual[y, 3.8e+31]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(x + N[(z + N[(y * N[(1.0 + N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.3 \lor \neg \left(y \leq 3.8 \cdot 10^{+31}\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;x + \left(z + y \cdot \left(1 + y \cdot \left(y \cdot -0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if y < -6.29999999999999982 or 3.8000000000000001e31 < y Initial program 99.9%
Taylor expanded in y around 0 45.9%
+-commutative45.9%
Simplified45.9%
if -6.29999999999999982 < y < 3.8000000000000001e31Initial program 100.0%
Taylor expanded in y around 0 96.7%
Taylor expanded in z around 0 96.7%
*-commutative96.7%
Simplified96.7%
Final simplification73.1%
(FPCore (x y z) :precision binary64 (if (or (<= y -3.5e+14) (not (<= y 2.15e+61))) (+ x z) (+ z (+ x y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.5e+14) || !(y <= 2.15e+61)) {
tmp = x + z;
} else {
tmp = z + (x + 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 <= (-3.5d+14)) .or. (.not. (y <= 2.15d+61))) then
tmp = x + z
else
tmp = z + (x + y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -3.5e+14) || !(y <= 2.15e+61)) {
tmp = x + z;
} else {
tmp = z + (x + y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -3.5e+14) or not (y <= 2.15e+61): tmp = x + z else: tmp = z + (x + y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -3.5e+14) || !(y <= 2.15e+61)) tmp = Float64(x + z); else tmp = Float64(z + Float64(x + y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -3.5e+14) || ~((y <= 2.15e+61))) tmp = x + z; else tmp = z + (x + y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -3.5e+14], N[Not[LessEqual[y, 2.15e+61]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+14} \lor \neg \left(y \leq 2.15 \cdot 10^{+61}\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;z + \left(x + y\right)\\
\end{array}
\end{array}
if y < -3.5e14 or 2.1500000000000001e61 < y Initial program 99.9%
Taylor expanded in y around 0 46.0%
+-commutative46.0%
Simplified46.0%
if -3.5e14 < y < 2.1500000000000001e61Initial program 100.0%
Taylor expanded in y around 0 92.3%
+-commutative92.3%
+-commutative92.3%
associate-+l+92.3%
Simplified92.3%
Final simplification73.0%
(FPCore (x y z) :precision binary64 (if (or (<= x -2.3e-93) (not (<= x 2.4e-189))) (+ x z) (+ y z)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -2.3e-93) || !(x <= 2.4e-189)) {
tmp = x + z;
} 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 ((x <= (-2.3d-93)) .or. (.not. (x <= 2.4d-189))) then
tmp = x + z
else
tmp = y + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -2.3e-93) || !(x <= 2.4e-189)) {
tmp = x + z;
} else {
tmp = y + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -2.3e-93) or not (x <= 2.4e-189): tmp = x + z else: tmp = y + z return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -2.3e-93) || !(x <= 2.4e-189)) tmp = Float64(x + z); else tmp = Float64(y + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -2.3e-93) || ~((x <= 2.4e-189))) tmp = x + z; else tmp = y + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -2.3e-93], N[Not[LessEqual[x, 2.4e-189]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(y + z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{-93} \lor \neg \left(x \leq 2.4 \cdot 10^{-189}\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;y + z\\
\end{array}
\end{array}
if x < -2.2999999999999998e-93 or 2.3999999999999998e-189 < x Initial program 100.0%
Taylor expanded in y around 0 78.5%
+-commutative78.5%
Simplified78.5%
if -2.2999999999999998e-93 < x < 2.3999999999999998e-189Initial program 99.9%
Taylor expanded in x around 0 98.2%
Taylor expanded in y around 0 54.2%
Final simplification71.6%
(FPCore (x y z) :precision binary64 (if (<= x -3700000000000.0) x (if (<= x 8e-86) (+ y z) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -3700000000000.0) {
tmp = x;
} else if (x <= 8e-86) {
tmp = y + z;
} 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 <= (-3700000000000.0d0)) then
tmp = x
else if (x <= 8d-86) then
tmp = y + z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3700000000000.0) {
tmp = x;
} else if (x <= 8e-86) {
tmp = y + z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3700000000000.0: tmp = x elif x <= 8e-86: tmp = y + z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3700000000000.0) tmp = x; elseif (x <= 8e-86) tmp = Float64(y + z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3700000000000.0) tmp = x; elseif (x <= 8e-86) tmp = y + z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3700000000000.0], x, If[LessEqual[x, 8e-86], N[(y + z), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3700000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-86}:\\
\;\;\;\;y + z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.7e12 or 8.00000000000000068e-86 < x Initial program 100.0%
Taylor expanded in x around inf 70.1%
if -3.7e12 < x < 8.00000000000000068e-86Initial program 99.9%
Taylor expanded in x around 0 92.9%
Taylor expanded in y around 0 48.6%
Final simplification60.7%
(FPCore (x y z) :precision binary64 (if (<= z -1.65e+39) z (if (<= z 2.15e+86) x z)))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.65e+39) {
tmp = z;
} else if (z <= 2.15e+86) {
tmp = x;
} else {
tmp = 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 <= (-1.65d+39)) then
tmp = z
else if (z <= 2.15d+86) then
tmp = x
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.65e+39) {
tmp = z;
} else if (z <= 2.15e+86) {
tmp = x;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.65e+39: tmp = z elif z <= 2.15e+86: tmp = x else: tmp = z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.65e+39) tmp = z; elseif (z <= 2.15e+86) tmp = x; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.65e+39) tmp = z; elseif (z <= 2.15e+86) tmp = x; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.65e+39], z, If[LessEqual[z, 2.15e+86], x, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+39}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{+86}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -1.6500000000000001e39 or 2.1500000000000001e86 < z Initial program 99.9%
Taylor expanded in x around 0 83.0%
Taylor expanded in y around 0 49.8%
if -1.6500000000000001e39 < z < 2.1500000000000001e86Initial program 100.0%
Taylor expanded in x around inf 59.3%
Final simplification55.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 100.0%
Taylor expanded in x around inf 43.9%
Final simplification43.9%
herbie shell --seed 2024055
(FPCore (x y z)
:name "Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, C"
:precision binary64
(+ (+ x (sin y)) (* z (cos y))))