
(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 11 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 (* (sin y) (- z))))
(if (<= z -1.9e+139)
t_0
(if (<= z 4.8e+36)
(+ x (cos y))
(if (or (<= z 2.1e+60) (not (<= z 3e+138)))
t_0
(+ x (- 1.0 (* y z))))))))
double code(double x, double y, double z) {
double t_0 = sin(y) * -z;
double tmp;
if (z <= -1.9e+139) {
tmp = t_0;
} else if (z <= 4.8e+36) {
tmp = x + cos(y);
} else if ((z <= 2.1e+60) || !(z <= 3e+138)) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = sin(y) * -z
if (z <= (-1.9d+139)) then
tmp = t_0
else if (z <= 4.8d+36) then
tmp = x + cos(y)
else if ((z <= 2.1d+60) .or. (.not. (z <= 3d+138))) then
tmp = t_0
else
tmp = x + (1.0d0 - (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.sin(y) * -z;
double tmp;
if (z <= -1.9e+139) {
tmp = t_0;
} else if (z <= 4.8e+36) {
tmp = x + Math.cos(y);
} else if ((z <= 2.1e+60) || !(z <= 3e+138)) {
tmp = t_0;
} else {
tmp = x + (1.0 - (y * z));
}
return tmp;
}
def code(x, y, z): t_0 = math.sin(y) * -z tmp = 0 if z <= -1.9e+139: tmp = t_0 elif z <= 4.8e+36: tmp = x + math.cos(y) elif (z <= 2.1e+60) or not (z <= 3e+138): tmp = t_0 else: tmp = x + (1.0 - (y * z)) return tmp
function code(x, y, z) t_0 = Float64(sin(y) * Float64(-z)) tmp = 0.0 if (z <= -1.9e+139) tmp = t_0; elseif (z <= 4.8e+36) tmp = Float64(x + cos(y)); elseif ((z <= 2.1e+60) || !(z <= 3e+138)) tmp = t_0; else tmp = Float64(x + Float64(1.0 - Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = sin(y) * -z; tmp = 0.0; if (z <= -1.9e+139) tmp = t_0; elseif (z <= 4.8e+36) tmp = x + cos(y); elseif ((z <= 2.1e+60) || ~((z <= 3e+138))) tmp = t_0; else tmp = x + (1.0 - (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] * (-z)), $MachinePrecision]}, If[LessEqual[z, -1.9e+139], t$95$0, If[LessEqual[z, 4.8e+36], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 2.1e+60], N[Not[LessEqual[z, 3e+138]], $MachinePrecision]], t$95$0, N[(x + N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin y \cdot \left(-z\right)\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{+139}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+36}:\\
\;\;\;\;x + \cos y\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+60} \lor \neg \left(z \leq 3 \cdot 10^{+138}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x + \left(1 - y \cdot z\right)\\
\end{array}
\end{array}
if z < -1.9e139 or 4.79999999999999985e36 < z < 2.1000000000000001e60 or 3.0000000000000001e138 < z Initial program 99.8%
Taylor expanded in z around inf 82.0%
associate-*r*82.0%
neg-mul-182.0%
*-commutative82.0%
Simplified82.0%
if -1.9e139 < z < 4.79999999999999985e36Initial program 99.9%
add-cube-cbrt98.4%
pow398.4%
associate--l+98.4%
Applied egg-rr98.4%
Taylor expanded in z around 0 93.9%
pow-base-193.9%
*-rgt-identity93.9%
Simplified93.9%
if 2.1000000000000001e60 < z < 3.0000000000000001e138Initial program 99.9%
Taylor expanded in y around 0 70.6%
associate-+r+70.6%
+-commutative70.6%
mul-1-neg70.6%
unsub-neg70.6%
Simplified70.6%
Final simplification88.6%
(FPCore (x y z) :precision binary64 (if (or (<= z -18.0) (not (<= z 1.15))) (- (+ x 1.0) (* z (sin y))) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -18.0) || !(z <= 1.15)) {
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 <= (-18.0d0)) .or. (.not. (z <= 1.15d0))) 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 <= -18.0) || !(z <= 1.15)) {
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 <= -18.0) or not (z <= 1.15): 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 <= -18.0) || !(z <= 1.15)) 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 <= -18.0) || ~((z <= 1.15))) 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, -18.0], N[Not[LessEqual[z, 1.15]], $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 -18 \lor \neg \left(z \leq 1.15\right):\\
\;\;\;\;\left(x + 1\right) - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -18 or 1.1499999999999999 < z Initial program 99.8%
Taylor expanded in y around 0 97.9%
+-commutative97.9%
Simplified97.9%
if -18 < z < 1.1499999999999999Initial program 99.9%
add-cube-cbrt98.4%
pow398.4%
associate--l+98.4%
Applied egg-rr98.4%
Taylor expanded in z around 0 99.4%
pow-base-199.4%
*-rgt-identity99.4%
Simplified99.4%
Final simplification98.6%
(FPCore (x y z) :precision binary64 (if (or (<= z -125000000000.0) (not (<= z 26.0))) (- x (* z (sin y))) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -125000000000.0) || !(z <= 26.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 <= (-125000000000.0d0)) .or. (.not. (z <= 26.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 <= -125000000000.0) || !(z <= 26.0)) {
tmp = x - (z * Math.sin(y));
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -125000000000.0) or not (z <= 26.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 <= -125000000000.0) || !(z <= 26.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 <= -125000000000.0) || ~((z <= 26.0))) tmp = x - (z * sin(y)); else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -125000000000.0], N[Not[LessEqual[z, 26.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 -125000000000 \lor \neg \left(z \leq 26\right):\\
\;\;\;\;x - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -1.25e11 or 26 < z Initial program 99.8%
Taylor expanded in x around inf 89.7%
if -1.25e11 < z < 26Initial program 99.9%
add-cube-cbrt98.4%
pow398.4%
associate--l+98.4%
Applied egg-rr98.4%
Taylor expanded in z around 0 98.7%
pow-base-198.7%
*-rgt-identity98.7%
Simplified98.7%
Final simplification94.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -450000.0) (not (<= y 0.0003))) (+ x (cos y)) (+ x (- 1.0 (* y z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -450000.0) || !(y <= 0.0003)) {
tmp = x + cos(y);
} 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 <= (-450000.0d0)) .or. (.not. (y <= 0.0003d0))) then
tmp = x + cos(y)
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 <= -450000.0) || !(y <= 0.0003)) {
tmp = x + Math.cos(y);
} else {
tmp = x + (1.0 - (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -450000.0) or not (y <= 0.0003): tmp = x + math.cos(y) else: tmp = x + (1.0 - (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -450000.0) || !(y <= 0.0003)) tmp = Float64(x + cos(y)); 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 <= -450000.0) || ~((y <= 0.0003))) tmp = x + cos(y); else tmp = x + (1.0 - (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -450000.0], N[Not[LessEqual[y, 0.0003]], $MachinePrecision]], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -450000 \lor \neg \left(y \leq 0.0003\right):\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;x + \left(1 - y \cdot z\right)\\
\end{array}
\end{array}
if y < -4.5e5 or 2.99999999999999974e-4 < y Initial program 99.7%
add-cube-cbrt98.0%
pow398.1%
associate--l+98.1%
Applied egg-rr98.1%
Taylor expanded in z around 0 57.3%
pow-base-157.3%
*-rgt-identity57.3%
Simplified57.3%
if -4.5e5 < y < 2.99999999999999974e-4Initial program 100.0%
Taylor expanded in y around 0 98.7%
associate-+r+98.7%
+-commutative98.7%
mul-1-neg98.7%
unsub-neg98.7%
Simplified98.7%
Final simplification78.5%
(FPCore (x y z) :precision binary64 (if (<= y -175000000.0) (+ x 1.0) (if (<= y 7.5e+77) (+ x (- 1.0 (* y z))) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -175000000.0) {
tmp = x + 1.0;
} else if (y <= 7.5e+77) {
tmp = x + (1.0 - (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 (y <= (-175000000.0d0)) then
tmp = x + 1.0d0
else if (y <= 7.5d+77) then
tmp = x + (1.0d0 - (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 (y <= -175000000.0) {
tmp = x + 1.0;
} else if (y <= 7.5e+77) {
tmp = x + (1.0 - (y * z));
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -175000000.0: tmp = x + 1.0 elif y <= 7.5e+77: tmp = x + (1.0 - (y * z)) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -175000000.0) tmp = Float64(x + 1.0); elseif (y <= 7.5e+77) tmp = Float64(x + Float64(1.0 - Float64(y * z))); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -175000000.0) tmp = x + 1.0; elseif (y <= 7.5e+77) tmp = x + (1.0 - (y * z)); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -175000000.0], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 7.5e+77], N[(x + N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -175000000:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+77}:\\
\;\;\;\;x + \left(1 - y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if y < -1.75e8 or 7.49999999999999955e77 < y Initial program 99.7%
add-cube-cbrt98.0%
pow398.0%
associate--l+98.0%
Applied egg-rr98.0%
Taylor expanded in y around 0 39.2%
pow-base-139.2%
*-lft-identity39.2%
Simplified39.2%
if -1.75e8 < y < 7.49999999999999955e77Initial program 100.0%
Taylor expanded in y around 0 90.7%
associate-+r+90.7%
+-commutative90.7%
mul-1-neg90.7%
unsub-neg90.7%
Simplified90.7%
Final simplification69.6%
(FPCore (x y z) :precision binary64 (if (or (<= z -4.2e+188) (not (<= z 9e+142))) (- 1.0 (* y z)) (+ x 1.0)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4.2e+188) || !(z <= 9e+142)) {
tmp = 1.0 - (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 <= (-4.2d+188)) .or. (.not. (z <= 9d+142))) then
tmp = 1.0d0 - (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 <= -4.2e+188) || !(z <= 9e+142)) {
tmp = 1.0 - (y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4.2e+188) or not (z <= 9e+142): tmp = 1.0 - (y * z) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4.2e+188) || !(z <= 9e+142)) tmp = Float64(1.0 - 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 <= -4.2e+188) || ~((z <= 9e+142))) tmp = 1.0 - (y * z); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4.2e+188], N[Not[LessEqual[z, 9e+142]], $MachinePrecision]], N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+188} \lor \neg \left(z \leq 9 \cdot 10^{+142}\right):\\
\;\;\;\;1 - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if z < -4.19999999999999973e188 or 8.9999999999999998e142 < z Initial program 99.8%
Taylor expanded in x around 0 89.1%
Taylor expanded in y around 0 47.0%
mul-1-neg47.0%
unsub-neg47.0%
Simplified47.0%
if -4.19999999999999973e188 < z < 8.9999999999999998e142Initial program 99.9%
add-cube-cbrt98.4%
pow398.4%
associate--l+98.4%
Applied egg-rr98.4%
Taylor expanded in y around 0 72.7%
pow-base-172.7%
*-lft-identity72.7%
Simplified72.7%
Final simplification65.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.8e+209) (not (<= z 1.05e+143))) (* z (- y)) (+ x 1.0)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.8e+209) || !(z <= 1.05e+143)) {
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 <= (-2.8d+209)) .or. (.not. (z <= 1.05d+143))) 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 <= -2.8e+209) || !(z <= 1.05e+143)) {
tmp = z * -y;
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.8e+209) or not (z <= 1.05e+143): tmp = z * -y else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.8e+209) || !(z <= 1.05e+143)) 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 <= -2.8e+209) || ~((z <= 1.05e+143))) tmp = z * -y; else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.8e+209], N[Not[LessEqual[z, 1.05e+143]], $MachinePrecision]], N[(z * (-y)), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+209} \lor \neg \left(z \leq 1.05 \cdot 10^{+143}\right):\\
\;\;\;\;z \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if z < -2.80000000000000013e209 or 1.04999999999999994e143 < z Initial program 99.9%
Taylor expanded in z around inf 82.4%
associate-*r*82.4%
neg-mul-182.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in y around 0 40.6%
mul-1-neg40.6%
distribute-rgt-neg-in40.6%
Simplified40.6%
if -2.80000000000000013e209 < z < 1.04999999999999994e143Initial program 99.9%
add-cube-cbrt98.4%
pow398.4%
associate--l+98.4%
Applied egg-rr98.4%
Taylor expanded in y around 0 71.8%
pow-base-171.8%
*-lft-identity71.8%
Simplified71.8%
Final simplification63.5%
(FPCore (x y z) :precision binary64 (if (<= x -0.00011) x (if (<= x 5.5e-13) 1.0 x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -0.00011) {
tmp = x;
} else if (x <= 5.5e-13) {
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.00011d0)) then
tmp = x
else if (x <= 5.5d-13) 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.00011) {
tmp = x;
} else if (x <= 5.5e-13) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -0.00011: tmp = x elif x <= 5.5e-13: tmp = 1.0 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -0.00011) tmp = x; elseif (x <= 5.5e-13) tmp = 1.0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -0.00011) tmp = x; elseif (x <= 5.5e-13) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -0.00011], x, If[LessEqual[x, 5.5e-13], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.00011:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-13}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.10000000000000004e-4 or 5.49999999999999979e-13 < x Initial program 99.9%
add-sqr-sqrt58.7%
pow258.7%
Applied egg-rr58.7%
Taylor expanded in x around inf 73.3%
if -1.10000000000000004e-4 < x < 5.49999999999999979e-13Initial program 99.8%
Taylor expanded in x around 0 99.1%
Taylor expanded in y around 0 39.4%
Final simplification57.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.3%
pow398.3%
associate--l+98.3%
Applied egg-rr98.3%
Taylor expanded in y around 0 57.7%
pow-base-157.7%
*-lft-identity57.7%
Simplified57.7%
Final simplification57.7%
(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 x around 0 60.7%
Taylor expanded in y around 0 20.1%
Final simplification20.1%
herbie shell --seed 2023195
(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))))