
(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 99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (cos y))))
(if (<= z -3.55e+33)
t_0
(if (<= z -1.05e-152)
(+ x z)
(if (<= z 4.8e-13) (+ x (sin y)) (if (<= z 3.1e+114) (+ x z) t_0))))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -3.55e+33) {
tmp = t_0;
} else if (z <= -1.05e-152) {
tmp = x + z;
} else if (z <= 4.8e-13) {
tmp = x + sin(y);
} else if (z <= 3.1e+114) {
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 <= (-3.55d+33)) then
tmp = t_0
else if (z <= (-1.05d-152)) then
tmp = x + z
else if (z <= 4.8d-13) then
tmp = x + sin(y)
else if (z <= 3.1d+114) 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 <= -3.55e+33) {
tmp = t_0;
} else if (z <= -1.05e-152) {
tmp = x + z;
} else if (z <= 4.8e-13) {
tmp = x + Math.sin(y);
} else if (z <= 3.1e+114) {
tmp = x + z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -3.55e+33: tmp = t_0 elif z <= -1.05e-152: tmp = x + z elif z <= 4.8e-13: tmp = x + math.sin(y) elif z <= 3.1e+114: 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 <= -3.55e+33) tmp = t_0; elseif (z <= -1.05e-152) tmp = Float64(x + z); elseif (z <= 4.8e-13) tmp = Float64(x + sin(y)); elseif (z <= 3.1e+114) 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 <= -3.55e+33) tmp = t_0; elseif (z <= -1.05e-152) tmp = x + z; elseif (z <= 4.8e-13) tmp = x + sin(y); elseif (z <= 3.1e+114) 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, -3.55e+33], t$95$0, If[LessEqual[z, -1.05e-152], N[(x + z), $MachinePrecision], If[LessEqual[z, 4.8e-13], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e+114], N[(x + z), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -3.55 \cdot 10^{+33}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-152}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-13}:\\
\;\;\;\;x + \sin y\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+114}:\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -3.54999999999999989e33 or 3.1e114 < z Initial program 99.9%
Taylor expanded in z around inf
*-lowering-*.f64N/A
cos-lowering-cos.f6485.8%
Simplified85.8%
if -3.54999999999999989e33 < z < -1.04999999999999999e-152 or 4.7999999999999997e-13 < z < 3.1e114Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6489.1%
Simplified89.1%
if -1.04999999999999999e-152 < z < 4.7999999999999997e-13Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6493.0%
Simplified93.0%
Final simplification88.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (* z (cos y)))))
(if (<= z -65000000000000.0)
t_0
(if (<= z 0.0001) (+ (+ x (sin y)) z) t_0))))
double code(double x, double y, double z) {
double t_0 = x + (z * cos(y));
double tmp;
if (z <= -65000000000000.0) {
tmp = t_0;
} else if (z <= 0.0001) {
tmp = (x + sin(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 = x + (z * cos(y))
if (z <= (-65000000000000.0d0)) then
tmp = t_0
else if (z <= 0.0001d0) then
tmp = (x + sin(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 = x + (z * Math.cos(y));
double tmp;
if (z <= -65000000000000.0) {
tmp = t_0;
} else if (z <= 0.0001) {
tmp = (x + Math.sin(y)) + z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + (z * math.cos(y)) tmp = 0 if z <= -65000000000000.0: tmp = t_0 elif z <= 0.0001: tmp = (x + math.sin(y)) + z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + Float64(z * cos(y))) tmp = 0.0 if (z <= -65000000000000.0) tmp = t_0; elseif (z <= 0.0001) tmp = Float64(Float64(x + sin(y)) + z); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (z * cos(y)); tmp = 0.0; if (z <= -65000000000000.0) tmp = t_0; elseif (z <= 0.0001) tmp = (x + sin(y)) + z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -65000000000000.0], t$95$0, If[LessEqual[z, 0.0001], N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + z \cdot \cos y\\
\mathbf{if}\;z \leq -65000000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 0.0001:\\
\;\;\;\;\left(x + \sin y\right) + z\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -6.5e13 or 1.00000000000000005e-4 < z Initial program 99.9%
Taylor expanded in x around inf
Simplified99.9%
if -6.5e13 < z < 1.00000000000000005e-4Initial program 100.0%
Taylor expanded in y around 0
Simplified99.9%
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ x (* z (cos y))))) (if (<= z -1.05e-152) t_0 (if (<= z 1.35e-10) (+ x (sin y)) t_0))))
double code(double x, double y, double z) {
double t_0 = x + (z * cos(y));
double tmp;
if (z <= -1.05e-152) {
tmp = t_0;
} else if (z <= 1.35e-10) {
tmp = x + sin(y);
} 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 = x + (z * cos(y))
if (z <= (-1.05d-152)) then
tmp = t_0
else if (z <= 1.35d-10) then
tmp = x + sin(y)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (z * Math.cos(y));
double tmp;
if (z <= -1.05e-152) {
tmp = t_0;
} else if (z <= 1.35e-10) {
tmp = x + Math.sin(y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + (z * math.cos(y)) tmp = 0 if z <= -1.05e-152: tmp = t_0 elif z <= 1.35e-10: tmp = x + math.sin(y) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + Float64(z * cos(y))) tmp = 0.0 if (z <= -1.05e-152) tmp = t_0; elseif (z <= 1.35e-10) tmp = Float64(x + sin(y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (z * cos(y)); tmp = 0.0; if (z <= -1.05e-152) tmp = t_0; elseif (z <= 1.35e-10) tmp = x + sin(y); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e-152], t$95$0, If[LessEqual[z, 1.35e-10], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + z \cdot \cos y\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{-152}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-10}:\\
\;\;\;\;x + \sin y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.04999999999999999e-152 or 1.35e-10 < z Initial program 99.9%
Taylor expanded in x around inf
Simplified98.2%
if -1.04999999999999999e-152 < z < 1.35e-10Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6493.0%
Simplified93.0%
Final simplification96.5%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* z (cos y)))) (if (<= z -2.95e+35) t_0 (if (<= z 4.3e+112) (+ x z) t_0))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -2.95e+35) {
tmp = t_0;
} else if (z <= 4.3e+112) {
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 <= (-2.95d+35)) then
tmp = t_0
else if (z <= 4.3d+112) 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 <= -2.95e+35) {
tmp = t_0;
} else if (z <= 4.3e+112) {
tmp = x + z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -2.95e+35: tmp = t_0 elif z <= 4.3e+112: 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 <= -2.95e+35) tmp = t_0; elseif (z <= 4.3e+112) 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 <= -2.95e+35) tmp = t_0; elseif (z <= 4.3e+112) 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, -2.95e+35], t$95$0, If[LessEqual[z, 4.3e+112], N[(x + z), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -2.95 \cdot 10^{+35}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{+112}:\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.94999999999999993e35 or 4.29999999999999983e112 < z Initial program 99.9%
Taylor expanded in z around inf
*-lowering-*.f64N/A
cos-lowering-cos.f6485.8%
Simplified85.8%
if -2.94999999999999993e35 < z < 4.29999999999999983e112Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6472.6%
Simplified72.6%
Final simplification78.6%
(FPCore (x y z)
:precision binary64
(if (<= y -80.0)
(+ x z)
(if (<= y 5e-25)
(+
(+
x
(*
y
(+
1.0
(*
(* y y)
(+ -0.16666666666666666 (* (* y y) 0.008333333333333333))))))
(*
z
(+
1.0
(*
(* y y)
(+
-0.5
(*
(* y y)
(+ 0.041666666666666664 (* (* y y) -0.001388888888888889))))))))
(+ x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -80.0) {
tmp = x + z;
} else if (y <= 5e-25) {
tmp = (x + (y * (1.0 + ((y * y) * (-0.16666666666666666 + ((y * y) * 0.008333333333333333)))))) + (z * (1.0 + ((y * y) * (-0.5 + ((y * y) * (0.041666666666666664 + ((y * y) * -0.001388888888888889)))))));
} else {
tmp = x + 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 <= (-80.0d0)) then
tmp = x + z
else if (y <= 5d-25) then
tmp = (x + (y * (1.0d0 + ((y * y) * ((-0.16666666666666666d0) + ((y * y) * 0.008333333333333333d0)))))) + (z * (1.0d0 + ((y * y) * ((-0.5d0) + ((y * y) * (0.041666666666666664d0 + ((y * y) * (-0.001388888888888889d0))))))))
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -80.0) {
tmp = x + z;
} else if (y <= 5e-25) {
tmp = (x + (y * (1.0 + ((y * y) * (-0.16666666666666666 + ((y * y) * 0.008333333333333333)))))) + (z * (1.0 + ((y * y) * (-0.5 + ((y * y) * (0.041666666666666664 + ((y * y) * -0.001388888888888889)))))));
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -80.0: tmp = x + z elif y <= 5e-25: tmp = (x + (y * (1.0 + ((y * y) * (-0.16666666666666666 + ((y * y) * 0.008333333333333333)))))) + (z * (1.0 + ((y * y) * (-0.5 + ((y * y) * (0.041666666666666664 + ((y * y) * -0.001388888888888889))))))) else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -80.0) tmp = Float64(x + z); elseif (y <= 5e-25) tmp = Float64(Float64(x + Float64(y * Float64(1.0 + Float64(Float64(y * y) * Float64(-0.16666666666666666 + Float64(Float64(y * y) * 0.008333333333333333)))))) + Float64(z * Float64(1.0 + Float64(Float64(y * y) * Float64(-0.5 + Float64(Float64(y * y) * Float64(0.041666666666666664 + Float64(Float64(y * y) * -0.001388888888888889)))))))); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -80.0) tmp = x + z; elseif (y <= 5e-25) tmp = (x + (y * (1.0 + ((y * y) * (-0.16666666666666666 + ((y * y) * 0.008333333333333333)))))) + (z * (1.0 + ((y * y) * (-0.5 + ((y * y) * (0.041666666666666664 + ((y * y) * -0.001388888888888889))))))); else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -80.0], N[(x + z), $MachinePrecision], If[LessEqual[y, 5e-25], N[(N[(x + N[(y * N[(1.0 + N[(N[(y * y), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(y * y), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z * N[(1.0 + N[(N[(y * y), $MachinePrecision] * N[(-0.5 + N[(N[(y * y), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(y * y), $MachinePrecision] * -0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -80:\\
\;\;\;\;x + z\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-25}:\\
\;\;\;\;\left(x + y \cdot \left(1 + \left(y \cdot y\right) \cdot \left(-0.16666666666666666 + \left(y \cdot y\right) \cdot 0.008333333333333333\right)\right)\right) + z \cdot \left(1 + \left(y \cdot y\right) \cdot \left(-0.5 + \left(y \cdot y\right) \cdot \left(0.041666666666666664 + \left(y \cdot y\right) \cdot -0.001388888888888889\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if y < -80 or 4.99999999999999962e-25 < y Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6442.9%
Simplified42.9%
if -80 < y < 4.99999999999999962e-25Initial program 100.0%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.6%
Simplified99.6%
Final simplification71.2%
(FPCore (x y z)
:precision binary64
(if (<= y -7.5)
(+ x z)
(if (<= y 6.2e-25)
(+
(+
x
(*
y
(+
1.0
(*
(* y y)
(+ -0.16666666666666666 (* (* y y) 0.008333333333333333))))))
(+ z (* (* y y) (* z (+ -0.5 (* (* y y) 0.041666666666666664))))))
(+ x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -7.5) {
tmp = x + z;
} else if (y <= 6.2e-25) {
tmp = (x + (y * (1.0 + ((y * y) * (-0.16666666666666666 + ((y * y) * 0.008333333333333333)))))) + (z + ((y * y) * (z * (-0.5 + ((y * y) * 0.041666666666666664)))));
} else {
tmp = x + z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-7.5d0)) then
tmp = x + z
else if (y <= 6.2d-25) then
tmp = (x + (y * (1.0d0 + ((y * y) * ((-0.16666666666666666d0) + ((y * y) * 0.008333333333333333d0)))))) + (z + ((y * y) * (z * ((-0.5d0) + ((y * y) * 0.041666666666666664d0)))))
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -7.5) {
tmp = x + z;
} else if (y <= 6.2e-25) {
tmp = (x + (y * (1.0 + ((y * y) * (-0.16666666666666666 + ((y * y) * 0.008333333333333333)))))) + (z + ((y * y) * (z * (-0.5 + ((y * y) * 0.041666666666666664)))));
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -7.5: tmp = x + z elif y <= 6.2e-25: tmp = (x + (y * (1.0 + ((y * y) * (-0.16666666666666666 + ((y * y) * 0.008333333333333333)))))) + (z + ((y * y) * (z * (-0.5 + ((y * y) * 0.041666666666666664))))) else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -7.5) tmp = Float64(x + z); elseif (y <= 6.2e-25) tmp = Float64(Float64(x + Float64(y * Float64(1.0 + Float64(Float64(y * y) * Float64(-0.16666666666666666 + Float64(Float64(y * y) * 0.008333333333333333)))))) + Float64(z + Float64(Float64(y * y) * Float64(z * Float64(-0.5 + Float64(Float64(y * y) * 0.041666666666666664)))))); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -7.5) tmp = x + z; elseif (y <= 6.2e-25) tmp = (x + (y * (1.0 + ((y * y) * (-0.16666666666666666 + ((y * y) * 0.008333333333333333)))))) + (z + ((y * y) * (z * (-0.5 + ((y * y) * 0.041666666666666664))))); else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -7.5], N[(x + z), $MachinePrecision], If[LessEqual[y, 6.2e-25], N[(N[(x + N[(y * N[(1.0 + N[(N[(y * y), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(y * y), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z + N[(N[(y * y), $MachinePrecision] * N[(z * N[(-0.5 + N[(N[(y * y), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5:\\
\;\;\;\;x + z\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-25}:\\
\;\;\;\;\left(x + y \cdot \left(1 + \left(y \cdot y\right) \cdot \left(-0.16666666666666666 + \left(y \cdot y\right) \cdot 0.008333333333333333\right)\right)\right) + \left(z + \left(y \cdot y\right) \cdot \left(z \cdot \left(-0.5 + \left(y \cdot y\right) \cdot 0.041666666666666664\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if y < -7.5 or 6.19999999999999989e-25 < y Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6442.9%
Simplified42.9%
if -7.5 < y < 6.19999999999999989e-25Initial program 100.0%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.5%
Simplified99.5%
Final simplification71.2%
(FPCore (x y z)
:precision binary64
(if (<= y -370.0)
(+ x z)
(if (<= y 6.2e-25)
(+ (+ x z) (* y (+ 1.0 (* y (+ (* z -0.5) (* y -0.16666666666666666))))))
(+ x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -370.0) {
tmp = x + z;
} else if (y <= 6.2e-25) {
tmp = (x + z) + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666)))));
} else {
tmp = x + 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 <= (-370.0d0)) then
tmp = x + z
else if (y <= 6.2d-25) then
tmp = (x + z) + (y * (1.0d0 + (y * ((z * (-0.5d0)) + (y * (-0.16666666666666666d0))))))
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -370.0) {
tmp = x + z;
} else if (y <= 6.2e-25) {
tmp = (x + z) + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666)))));
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -370.0: tmp = x + z elif y <= 6.2e-25: tmp = (x + z) + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666))))) else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -370.0) tmp = Float64(x + z); elseif (y <= 6.2e-25) tmp = Float64(Float64(x + z) + Float64(y * Float64(1.0 + Float64(y * Float64(Float64(z * -0.5) + Float64(y * -0.16666666666666666)))))); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -370.0) tmp = x + z; elseif (y <= 6.2e-25) tmp = (x + z) + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666))))); else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -370.0], N[(x + z), $MachinePrecision], If[LessEqual[y, 6.2e-25], N[(N[(x + z), $MachinePrecision] + N[(y * N[(1.0 + N[(y * N[(N[(z * -0.5), $MachinePrecision] + N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -370:\\
\;\;\;\;x + z\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-25}:\\
\;\;\;\;\left(x + z\right) + y \cdot \left(1 + y \cdot \left(z \cdot -0.5 + y \cdot -0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if y < -370 or 6.19999999999999989e-25 < y Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6442.9%
Simplified42.9%
if -370 < y < 6.19999999999999989e-25Initial program 100.0%
Taylor expanded in y around 0
associate-+r+N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6499.5%
Simplified99.5%
Final simplification71.2%
(FPCore (x y z) :precision binary64 (if (<= y -4.6) (+ x z) (if (<= y 6.2e-25) (+ (+ x y) (* z (+ 1.0 (* y (* y -0.5))))) (+ x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -4.6) {
tmp = x + z;
} else if (y <= 6.2e-25) {
tmp = (x + y) + (z * (1.0 + (y * (y * -0.5))));
} else {
tmp = x + 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.6d0)) then
tmp = x + z
else if (y <= 6.2d-25) then
tmp = (x + y) + (z * (1.0d0 + (y * (y * (-0.5d0)))))
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -4.6) {
tmp = x + z;
} else if (y <= 6.2e-25) {
tmp = (x + y) + (z * (1.0 + (y * (y * -0.5))));
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -4.6: tmp = x + z elif y <= 6.2e-25: tmp = (x + y) + (z * (1.0 + (y * (y * -0.5)))) else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -4.6) tmp = Float64(x + z); elseif (y <= 6.2e-25) tmp = Float64(Float64(x + y) + Float64(z * Float64(1.0 + Float64(y * Float64(y * -0.5))))); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -4.6) tmp = x + z; elseif (y <= 6.2e-25) tmp = (x + y) + (z * (1.0 + (y * (y * -0.5)))); else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -4.6], N[(x + z), $MachinePrecision], If[LessEqual[y, 6.2e-25], N[(N[(x + y), $MachinePrecision] + N[(z * N[(1.0 + N[(y * N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6:\\
\;\;\;\;x + z\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-25}:\\
\;\;\;\;\left(x + y\right) + z \cdot \left(1 + y \cdot \left(y \cdot -0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if y < -4.5999999999999996 or 6.19999999999999989e-25 < y Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6442.9%
Simplified42.9%
if -4.5999999999999996 < y < 6.19999999999999989e-25Initial program 100.0%
Taylor expanded in y around 0
distribute-rgt-inN/A
*-lft-identityN/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
unpow2N/A
associate-+r+N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
Simplified99.5%
Final simplification71.2%
(FPCore (x y z) :precision binary64 (if (<= y -1.22e+71) (+ x z) (if (<= y 1.26e+21) (+ z (+ x y)) (+ x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.22e+71) {
tmp = x + z;
} else if (y <= 1.26e+21) {
tmp = z + (x + y);
} else {
tmp = x + 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 <= (-1.22d+71)) then
tmp = x + z
else if (y <= 1.26d+21) then
tmp = z + (x + y)
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.22e+71) {
tmp = x + z;
} else if (y <= 1.26e+21) {
tmp = z + (x + y);
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.22e+71: tmp = x + z elif y <= 1.26e+21: tmp = z + (x + y) else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.22e+71) tmp = Float64(x + z); elseif (y <= 1.26e+21) tmp = Float64(z + Float64(x + y)); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.22e+71) tmp = x + z; elseif (y <= 1.26e+21) tmp = z + (x + y); else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.22e+71], N[(x + z), $MachinePrecision], If[LessEqual[y, 1.26e+21], N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.22 \cdot 10^{+71}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;y \leq 1.26 \cdot 10^{+21}:\\
\;\;\;\;z + \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if y < -1.22000000000000001e71 or 1.26e21 < y Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6442.3%
Simplified42.3%
if -1.22000000000000001e71 < y < 1.26e21Initial program 100.0%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f6492.9%
Simplified92.9%
Final simplification71.2%
(FPCore (x y z) :precision binary64 (if (<= x -8e-39) x (if (<= x 2.3e+18) z x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -8e-39) {
tmp = x;
} else if (x <= 2.3e+18) {
tmp = 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 <= (-8d-39)) then
tmp = x
else if (x <= 2.3d+18) then
tmp = z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -8e-39) {
tmp = x;
} else if (x <= 2.3e+18) {
tmp = z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -8e-39: tmp = x elif x <= 2.3e+18: tmp = z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -8e-39) tmp = x; elseif (x <= 2.3e+18) tmp = z; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -8e-39) tmp = x; elseif (x <= 2.3e+18) tmp = z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -8e-39], x, If[LessEqual[x, 2.3e+18], z, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{-39}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+18}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -7.99999999999999943e-39 or 2.3e18 < x Initial program 99.9%
Taylor expanded in x around inf
Simplified65.3%
if -7.99999999999999943e-39 < x < 2.3e18Initial program 99.9%
Taylor expanded in z around inf
*-lowering-*.f64N/A
cos-lowering-cos.f6465.3%
Simplified65.3%
Taylor expanded in y around 0
Simplified40.3%
(FPCore (x y z) :precision binary64 (if (<= x -2.4e-65) x (if (<= x 1.4e-159) y x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.4e-65) {
tmp = x;
} else if (x <= 1.4e-159) {
tmp = y;
} 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 <= (-2.4d-65)) then
tmp = x
else if (x <= 1.4d-159) then
tmp = y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2.4e-65) {
tmp = x;
} else if (x <= 1.4e-159) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.4e-65: tmp = x elif x <= 1.4e-159: tmp = y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.4e-65) tmp = x; elseif (x <= 1.4e-159) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.4e-65) tmp = x; elseif (x <= 1.4e-159) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.4e-65], x, If[LessEqual[x, 1.4e-159], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{-65}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-159}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.4000000000000002e-65 or 1.4000000000000001e-159 < x Initial program 99.9%
Taylor expanded in x around inf
Simplified54.1%
if -2.4000000000000002e-65 < x < 1.4000000000000001e-159Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6437.2%
Simplified37.2%
Taylor expanded in y around 0
Simplified17.4%
Taylor expanded in y around inf
Simplified16.1%
(FPCore (x y z) :precision binary64 (+ x z))
double code(double x, double y, double z) {
return x + z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + z
end function
public static double code(double x, double y, double z) {
return x + z;
}
def code(x, y, z): return x + z
function code(x, y, z) return Float64(x + z) end
function tmp = code(x, y, z) tmp = x + z; end
code[x_, y_, z_] := N[(x + z), $MachinePrecision]
\begin{array}{l}
\\
x + z
\end{array}
Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6466.6%
Simplified66.6%
Final simplification66.6%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.9%
Taylor expanded in x around inf
Simplified39.1%
herbie shell --seed 2024160
(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))))