
(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 14 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 100.0%
Final simplification100.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.4e+62) (not (<= z 2e-17))) (- (+ x 1.0) (* z (sin y))) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.4e+62) || !(z <= 2e-17)) {
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 <= (-2.4d+62)) .or. (.not. (z <= 2d-17))) 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 <= -2.4e+62) || !(z <= 2e-17)) {
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 <= -2.4e+62) or not (z <= 2e-17): 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 <= -2.4e+62) || !(z <= 2e-17)) 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 <= -2.4e+62) || ~((z <= 2e-17))) 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, -2.4e+62], N[Not[LessEqual[z, 2e-17]], $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 -2.4 \cdot 10^{+62} \lor \neg \left(z \leq 2 \cdot 10^{-17}\right):\\
\;\;\;\;\left(x + 1\right) - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -2.4e62 or 2.00000000000000014e-17 < z Initial program 99.9%
Taylor expanded in y around 0 98.8%
+-commutative98.8%
Simplified98.8%
if -2.4e62 < z < 2.00000000000000014e-17Initial program 100.0%
Taylor expanded in y around 0 87.2%
Taylor expanded in z around 0 100.0%
Final simplification99.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (sin y)))))
(if (<= z -4.6e+191)
t_0
(if (<= z 1.1e+148)
(+ x (cos y))
(if (<= z 2.6e+235) (- (+ x 1.0) (* y z)) t_0)))))
double code(double x, double y, double z) {
double t_0 = z * -sin(y);
double tmp;
if (z <= -4.6e+191) {
tmp = t_0;
} else if (z <= 1.1e+148) {
tmp = x + cos(y);
} else if (z <= 2.6e+235) {
tmp = (x + 1.0) - (y * 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 * -sin(y)
if (z <= (-4.6d+191)) then
tmp = t_0
else if (z <= 1.1d+148) then
tmp = x + cos(y)
else if (z <= 2.6d+235) then
tmp = (x + 1.0d0) - (y * 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.sin(y);
double tmp;
if (z <= -4.6e+191) {
tmp = t_0;
} else if (z <= 1.1e+148) {
tmp = x + Math.cos(y);
} else if (z <= 2.6e+235) {
tmp = (x + 1.0) - (y * z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * -math.sin(y) tmp = 0 if z <= -4.6e+191: tmp = t_0 elif z <= 1.1e+148: tmp = x + math.cos(y) elif z <= 2.6e+235: tmp = (x + 1.0) - (y * z) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(-sin(y))) tmp = 0.0 if (z <= -4.6e+191) tmp = t_0; elseif (z <= 1.1e+148) tmp = Float64(x + cos(y)); elseif (z <= 2.6e+235) tmp = Float64(Float64(x + 1.0) - Float64(y * z)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * -sin(y); tmp = 0.0; if (z <= -4.6e+191) tmp = t_0; elseif (z <= 1.1e+148) tmp = x + cos(y); elseif (z <= 2.6e+235) tmp = (x + 1.0) - (y * z); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * (-N[Sin[y], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[z, -4.6e+191], t$95$0, If[LessEqual[z, 1.1e+148], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e+235], N[(N[(x + 1.0), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(-\sin y\right)\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{+191}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+148}:\\
\;\;\;\;x + \cos y\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+235}:\\
\;\;\;\;\left(x + 1\right) - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -4.5999999999999999e191 or 2.5999999999999998e235 < z Initial program 99.9%
Taylor expanded in x around 0 80.7%
Taylor expanded in z around inf 72.0%
mul-1-neg72.0%
*-commutative72.0%
distribute-rgt-neg-in72.0%
Simplified72.0%
if -4.5999999999999999e191 < z < 1.0999999999999999e148Initial program 100.0%
Taylor expanded in y around 0 79.4%
Taylor expanded in z around 0 91.9%
if 1.0999999999999999e148 < z < 2.5999999999999998e235Initial program 99.9%
Taylor expanded in y around 0 99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 82.6%
Final simplification88.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.7e+190) (not (<= z 8.8e+58))) (- 1.0 (* z (sin y))) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.7e+190) || !(z <= 8.8e+58)) {
tmp = 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 <= (-1.7d+190)) .or. (.not. (z <= 8.8d+58))) then
tmp = 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 <= -1.7e+190) || !(z <= 8.8e+58)) {
tmp = 1.0 - (z * Math.sin(y));
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.7e+190) or not (z <= 8.8e+58): tmp = 1.0 - (z * math.sin(y)) else: tmp = x + math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.7e+190) || !(z <= 8.8e+58)) tmp = Float64(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 <= -1.7e+190) || ~((z <= 8.8e+58))) tmp = 1.0 - (z * sin(y)); else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.7e+190], N[Not[LessEqual[z, 8.8e+58]], $MachinePrecision]], N[(1.0 - 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 -1.7 \cdot 10^{+190} \lor \neg \left(z \leq 8.8 \cdot 10^{+58}\right):\\
\;\;\;\;1 - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -1.7e190 or 8.8000000000000003e58 < z Initial program 99.9%
Taylor expanded in x around 0 70.8%
Taylor expanded in y around 0 70.8%
if -1.7e190 < z < 8.8000000000000003e58Initial program 100.0%
Taylor expanded in y around 0 82.4%
Taylor expanded in z around 0 95.2%
Final simplification88.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -6.2e+161) (not (<= z 1.25e+35))) (- x (* z (sin y))) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -6.2e+161) || !(z <= 1.25e+35)) {
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 <= (-6.2d+161)) .or. (.not. (z <= 1.25d+35))) 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 <= -6.2e+161) || !(z <= 1.25e+35)) {
tmp = x - (z * Math.sin(y));
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -6.2e+161) or not (z <= 1.25e+35): tmp = x - (z * math.sin(y)) else: tmp = x + math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -6.2e+161) || !(z <= 1.25e+35)) 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 <= -6.2e+161) || ~((z <= 1.25e+35))) tmp = x - (z * sin(y)); else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -6.2e+161], N[Not[LessEqual[z, 1.25e+35]], $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 -6.2 \cdot 10^{+161} \lor \neg \left(z \leq 1.25 \cdot 10^{+35}\right):\\
\;\;\;\;x - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -6.20000000000000013e161 or 1.25000000000000005e35 < z Initial program 99.9%
Taylor expanded in x around inf 88.3%
if -6.20000000000000013e161 < z < 1.25000000000000005e35Initial program 100.0%
Taylor expanded in y around 0 84.5%
Taylor expanded in z around 0 96.1%
Final simplification93.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -450.0) (not (<= y 3.25e-34))) (+ x (cos y)) (+ (* y (- (* y -0.5) z)) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -450.0) || !(y <= 3.25e-34)) {
tmp = x + cos(y);
} else {
tmp = (y * ((y * -0.5) - z)) + (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 <= (-450.0d0)) .or. (.not. (y <= 3.25d-34))) then
tmp = x + cos(y)
else
tmp = (y * ((y * (-0.5d0)) - z)) + (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -450.0) || !(y <= 3.25e-34)) {
tmp = x + Math.cos(y);
} else {
tmp = (y * ((y * -0.5) - z)) + (x + 1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -450.0) or not (y <= 3.25e-34): tmp = x + math.cos(y) else: tmp = (y * ((y * -0.5) - z)) + (x + 1.0) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -450.0) || !(y <= 3.25e-34)) tmp = Float64(x + cos(y)); else tmp = Float64(Float64(y * Float64(Float64(y * -0.5) - z)) + Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -450.0) || ~((y <= 3.25e-34))) tmp = x + cos(y); else tmp = (y * ((y * -0.5) - z)) + (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -450.0], N[Not[LessEqual[y, 3.25e-34]], $MachinePrecision]], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(N[(y * -0.5), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -450 \lor \neg \left(y \leq 3.25 \cdot 10^{-34}\right):\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(y \cdot -0.5 - z\right) + \left(x + 1\right)\\
\end{array}
\end{array}
if y < -450 or 3.24999999999999993e-34 < y Initial program 99.9%
Taylor expanded in y around 0 52.0%
Taylor expanded in z around 0 73.8%
if -450 < y < 3.24999999999999993e-34Initial program 100.0%
Taylor expanded in y around 0 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in y around 0 99.9%
Taylor expanded in x around 0 99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
*-commutative99.9%
unpow299.9%
associate-*r*99.9%
*-commutative99.9%
associate-+r-99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
+-commutative99.9%
Simplified99.9%
Final simplification87.0%
(FPCore (x y z) :precision binary64 (if (<= x -1.6e-8) (+ x 1.0) (if (<= x 6e-21) (cos y) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.6e-8) {
tmp = x + 1.0;
} else if (x <= 6e-21) {
tmp = cos(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 (x <= (-1.6d-8)) then
tmp = x + 1.0d0
else if (x <= 6d-21) then
tmp = cos(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 (x <= -1.6e-8) {
tmp = x + 1.0;
} else if (x <= 6e-21) {
tmp = Math.cos(y);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.6e-8: tmp = x + 1.0 elif x <= 6e-21: tmp = math.cos(y) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.6e-8) tmp = Float64(x + 1.0); elseif (x <= 6e-21) tmp = cos(y); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.6e-8) tmp = x + 1.0; elseif (x <= 6e-21) tmp = cos(y); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.6e-8], N[(x + 1.0), $MachinePrecision], If[LessEqual[x, 6e-21], N[Cos[y], $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{-8}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-21}:\\
\;\;\;\;\cos y\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if x < -1.6000000000000001e-8 or 5.99999999999999982e-21 < x Initial program 100.0%
Taylor expanded in y around 0 76.7%
Taylor expanded in y around 0 85.3%
if -1.6000000000000001e-8 < x < 5.99999999999999982e-21Initial program 99.9%
Taylor expanded in x around 0 99.4%
Taylor expanded in z around 0 72.7%
Final simplification79.3%
(FPCore (x y z) :precision binary64 (if (<= y -2.4e+28) (+ x 1.0) (if (<= y 1.45e+34) (+ (* y (- (* y -0.5) z)) (+ x 1.0)) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.4e+28) {
tmp = x + 1.0;
} else if (y <= 1.45e+34) {
tmp = (y * ((y * -0.5) - z)) + (x + 1.0);
} 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 <= (-2.4d+28)) then
tmp = x + 1.0d0
else if (y <= 1.45d+34) then
tmp = (y * ((y * (-0.5d0)) - z)) + (x + 1.0d0)
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 <= -2.4e+28) {
tmp = x + 1.0;
} else if (y <= 1.45e+34) {
tmp = (y * ((y * -0.5) - z)) + (x + 1.0);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.4e+28: tmp = x + 1.0 elif y <= 1.45e+34: tmp = (y * ((y * -0.5) - z)) + (x + 1.0) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.4e+28) tmp = Float64(x + 1.0); elseif (y <= 1.45e+34) tmp = Float64(Float64(y * Float64(Float64(y * -0.5) - z)) + Float64(x + 1.0)); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.4e+28) tmp = x + 1.0; elseif (y <= 1.45e+34) tmp = (y * ((y * -0.5) - z)) + (x + 1.0); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.4e+28], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 1.45e+34], N[(N[(y * N[(N[(y * -0.5), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] + N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+28}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+34}:\\
\;\;\;\;y \cdot \left(y \cdot -0.5 - z\right) + \left(x + 1\right)\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if y < -2.39999999999999981e28 or 1.4500000000000001e34 < y Initial program 99.9%
Taylor expanded in y around 0 46.5%
Taylor expanded in y around 0 50.8%
if -2.39999999999999981e28 < y < 1.4500000000000001e34Initial program 100.0%
Taylor expanded in y around 0 98.5%
unpow298.5%
Simplified98.5%
Taylor expanded in y around 0 95.9%
Taylor expanded in x around 0 95.9%
+-commutative95.9%
associate-+r+95.9%
+-commutative95.9%
*-commutative95.9%
unpow295.9%
associate-*r*95.9%
*-commutative95.9%
associate-+r-95.9%
+-commutative95.9%
*-commutative95.9%
distribute-rgt-out--95.9%
+-commutative95.9%
Simplified95.9%
Final simplification77.4%
(FPCore (x y z) :precision binary64 (if (<= y -2.4e+28) (+ x 1.0) (if (<= y 5.2e+56) (- (+ x 1.0) (* y z)) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.4e+28) {
tmp = x + 1.0;
} else if (y <= 5.2e+56) {
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 <= (-2.4d+28)) then
tmp = x + 1.0d0
else if (y <= 5.2d+56) 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 <= -2.4e+28) {
tmp = x + 1.0;
} else if (y <= 5.2e+56) {
tmp = (x + 1.0) - (y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.4e+28: tmp = x + 1.0 elif y <= 5.2e+56: tmp = (x + 1.0) - (y * z) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.4e+28) tmp = Float64(x + 1.0); elseif (y <= 5.2e+56) tmp = Float64(Float64(x + 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 <= -2.4e+28) tmp = x + 1.0; elseif (y <= 5.2e+56) tmp = (x + 1.0) - (y * z); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.4e+28], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 5.2e+56], N[(N[(x + 1.0), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+28}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+56}:\\
\;\;\;\;\left(x + 1\right) - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if y < -2.39999999999999981e28 or 5.20000000000000022e56 < y Initial program 99.9%
Taylor expanded in y around 0 45.3%
Taylor expanded in y around 0 49.8%
if -2.39999999999999981e28 < y < 5.20000000000000022e56Initial program 100.0%
Taylor expanded in y around 0 98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in y around 0 95.1%
Final simplification77.2%
(FPCore (x y z) :precision binary64 (if (<= x -3.9e-31) (+ x 1.0) (if (<= x 1.75e-11) (- 1.0 (* y z)) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.9e-31) {
tmp = x + 1.0;
} else if (x <= 1.75e-11) {
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 (x <= (-3.9d-31)) then
tmp = x + 1.0d0
else if (x <= 1.75d-11) 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 (x <= -3.9e-31) {
tmp = x + 1.0;
} else if (x <= 1.75e-11) {
tmp = 1.0 - (y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.9e-31: tmp = x + 1.0 elif x <= 1.75e-11: tmp = 1.0 - (y * z) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.9e-31) tmp = Float64(x + 1.0); elseif (x <= 1.75e-11) 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 (x <= -3.9e-31) tmp = x + 1.0; elseif (x <= 1.75e-11) tmp = 1.0 - (y * z); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.9e-31], N[(x + 1.0), $MachinePrecision], If[LessEqual[x, 1.75e-11], N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.9 \cdot 10^{-31}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{-11}:\\
\;\;\;\;1 - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if x < -3.9000000000000001e-31 or 1.7500000000000001e-11 < x Initial program 100.0%
Taylor expanded in y around 0 76.3%
Taylor expanded in y around 0 85.0%
if -3.9000000000000001e-31 < x < 1.7500000000000001e-11Initial program 99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in y around 0 64.1%
mul-1-neg64.1%
*-commutative64.1%
unsub-neg64.1%
*-commutative64.1%
Simplified64.1%
Final simplification75.3%
(FPCore (x y z) :precision binary64 (if (<= z -8.8e+210) (- (* y z)) (+ x 1.0)))
double code(double x, double y, double z) {
double tmp;
if (z <= -8.8e+210) {
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+210)) 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+210) {
tmp = -(y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -8.8e+210: tmp = -(y * z) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (z <= -8.8e+210) tmp = Float64(-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 <= -8.8e+210) tmp = -(y * z); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -8.8e+210], (-N[(y * z), $MachinePrecision]), N[(x + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{+210}:\\
\;\;\;\;-y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if z < -8.79999999999999948e210Initial program 99.9%
Taylor expanded in y around 0 65.1%
Taylor expanded in y around inf 46.3%
associate-*r*46.3%
neg-mul-146.3%
*-commutative46.3%
Simplified46.3%
if -8.79999999999999948e210 < z Initial program 100.0%
Taylor expanded in y around 0 76.8%
Taylor expanded in y around 0 73.3%
Final simplification71.8%
(FPCore (x y z) :precision binary64 (if (<= x -0.95) x (if (<= x 0.68) 1.0 x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -0.95) {
tmp = x;
} else if (x <= 0.68) {
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.95d0)) then
tmp = x
else if (x <= 0.68d0) 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.95) {
tmp = x;
} else if (x <= 0.68) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -0.95: tmp = x elif x <= 0.68: tmp = 1.0 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -0.95) tmp = x; elseif (x <= 0.68) tmp = 1.0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -0.95) tmp = x; elseif (x <= 0.68) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -0.95], x, If[LessEqual[x, 0.68], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.95:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 0.68:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -0.94999999999999996 or 0.680000000000000049 < x Initial program 100.0%
Taylor expanded in y around 0 77.1%
Taylor expanded in x around inf 86.1%
if -0.94999999999999996 < x < 0.680000000000000049Initial program 99.9%
Taylor expanded in x around 0 98.2%
Taylor expanded in y around 0 51.8%
Final simplification69.1%
(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 100.0%
Taylor expanded in y around 0 76.1%
Taylor expanded in y around 0 70.2%
Final simplification70.2%
(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 100.0%
Taylor expanded in x around 0 55.6%
Taylor expanded in y around 0 27.3%
Final simplification27.3%
herbie shell --seed 2023238
(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))))