
(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 12 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%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* z (sin y))) (t_1 (- x t_0))) (if (<= x -1.0) t_1 (if (<= x 0.9) (- (cos y) t_0) t_1))))
double code(double x, double y, double z) {
double t_0 = z * sin(y);
double t_1 = x - t_0;
double tmp;
if (x <= -1.0) {
tmp = t_1;
} else if (x <= 0.9) {
tmp = cos(y) - t_0;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = z * sin(y)
t_1 = x - t_0
if (x <= (-1.0d0)) then
tmp = t_1
else if (x <= 0.9d0) then
tmp = cos(y) - t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * Math.sin(y);
double t_1 = x - t_0;
double tmp;
if (x <= -1.0) {
tmp = t_1;
} else if (x <= 0.9) {
tmp = Math.cos(y) - t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.sin(y) t_1 = x - t_0 tmp = 0 if x <= -1.0: tmp = t_1 elif x <= 0.9: tmp = math.cos(y) - t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(z * sin(y)) t_1 = Float64(x - t_0) tmp = 0.0 if (x <= -1.0) tmp = t_1; elseif (x <= 0.9) tmp = Float64(cos(y) - t_0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * sin(y); t_1 = x - t_0; tmp = 0.0; if (x <= -1.0) tmp = t_1; elseif (x <= 0.9) tmp = cos(y) - t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x - t$95$0), $MachinePrecision]}, If[LessEqual[x, -1.0], t$95$1, If[LessEqual[x, 0.9], N[(N[Cos[y], $MachinePrecision] - t$95$0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \sin y\\
t_1 := x - t\_0\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 0.9:\\
\;\;\;\;\cos y - t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1 or 0.900000000000000022 < x Initial program 99.9%
Taylor expanded in x around inf
Simplified97.9%
if -1 < x < 0.900000000000000022Initial program 99.9%
Taylor expanded in x around 0
--lowering--.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6499.2%
Simplified99.2%
(FPCore (x y z) :precision binary64 (let* ((t_0 (- x (* z (sin y))))) (if (<= z -5.9e+32) t_0 (if (<= z 8500.0) (+ x (cos y)) t_0))))
double code(double x, double y, double z) {
double t_0 = x - (z * sin(y));
double tmp;
if (z <= -5.9e+32) {
tmp = t_0;
} else if (z <= 8500.0) {
tmp = x + cos(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 * sin(y))
if (z <= (-5.9d+32)) then
tmp = t_0
else if (z <= 8500.0d0) then
tmp = x + cos(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.sin(y));
double tmp;
if (z <= -5.9e+32) {
tmp = t_0;
} else if (z <= 8500.0) {
tmp = x + Math.cos(y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x - (z * math.sin(y)) tmp = 0 if z <= -5.9e+32: tmp = t_0 elif z <= 8500.0: tmp = x + math.cos(y) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x - Float64(z * sin(y))) tmp = 0.0 if (z <= -5.9e+32) tmp = t_0; elseif (z <= 8500.0) tmp = Float64(x + cos(y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x - (z * sin(y)); tmp = 0.0; if (z <= -5.9e+32) tmp = t_0; elseif (z <= 8500.0) tmp = x + cos(y); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.9e+32], t$95$0, If[LessEqual[z, 8500.0], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x - z \cdot \sin y\\
\mathbf{if}\;z \leq -5.9 \cdot 10^{+32}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 8500:\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -5.89999999999999965e32 or 8500 < z Initial program 99.9%
Taylor expanded in x around inf
Simplified87.5%
if -5.89999999999999965e32 < z < 8500Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
cos-lowering-cos.f6499.5%
Simplified99.5%
Final simplification93.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (cos y))))
(if (<= y -0.58)
t_0
(if (<= y 2700.0)
(+ x (+ 1.0 (* y (- (* y (+ -0.5 (* (* y z) 0.16666666666666666))) z))))
t_0))))
double code(double x, double y, double z) {
double t_0 = x + cos(y);
double tmp;
if (y <= -0.58) {
tmp = t_0;
} else if (y <= 2700.0) {
tmp = x + (1.0 + (y * ((y * (-0.5 + ((y * z) * 0.16666666666666666))) - 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 + cos(y)
if (y <= (-0.58d0)) then
tmp = t_0
else if (y <= 2700.0d0) then
tmp = x + (1.0d0 + (y * ((y * ((-0.5d0) + ((y * z) * 0.16666666666666666d0))) - 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 + Math.cos(y);
double tmp;
if (y <= -0.58) {
tmp = t_0;
} else if (y <= 2700.0) {
tmp = x + (1.0 + (y * ((y * (-0.5 + ((y * z) * 0.16666666666666666))) - z)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + math.cos(y) tmp = 0 if y <= -0.58: tmp = t_0 elif y <= 2700.0: tmp = x + (1.0 + (y * ((y * (-0.5 + ((y * z) * 0.16666666666666666))) - z))) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + cos(y)) tmp = 0.0 if (y <= -0.58) tmp = t_0; elseif (y <= 2700.0) tmp = Float64(x + Float64(1.0 + Float64(y * Float64(Float64(y * Float64(-0.5 + Float64(Float64(y * z) * 0.16666666666666666))) - z)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + cos(y); tmp = 0.0; if (y <= -0.58) tmp = t_0; elseif (y <= 2700.0) tmp = x + (1.0 + (y * ((y * (-0.5 + ((y * z) * 0.16666666666666666))) - z))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -0.58], t$95$0, If[LessEqual[y, 2700.0], N[(x + N[(1.0 + N[(y * N[(N[(y * N[(-0.5 + N[(N[(y * z), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \cos y\\
\mathbf{if}\;y \leq -0.58:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 2700:\\
\;\;\;\;x + \left(1 + y \cdot \left(y \cdot \left(-0.5 + \left(y \cdot z\right) \cdot 0.16666666666666666\right) - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -0.57999999999999996 or 2700 < y Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
cos-lowering-cos.f6459.7%
Simplified59.7%
if -0.57999999999999996 < y < 2700Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6499.3%
Simplified99.3%
Final simplification80.0%
(FPCore (x y z)
:precision binary64
(if (<= y -1.08e+71)
(+ x 1.0)
(if (<= y -3.0)
(cos y)
(if (<= y 4.5e+45)
(+ x (+ 1.0 (* y (- (* y (+ -0.5 (* (* y z) 0.16666666666666666))) z))))
(+ x 1.0)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.08e+71) {
tmp = x + 1.0;
} else if (y <= -3.0) {
tmp = cos(y);
} else if (y <= 4.5e+45) {
tmp = x + (1.0 + (y * ((y * (-0.5 + ((y * z) * 0.16666666666666666))) - 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 <= (-1.08d+71)) then
tmp = x + 1.0d0
else if (y <= (-3.0d0)) then
tmp = cos(y)
else if (y <= 4.5d+45) then
tmp = x + (1.0d0 + (y * ((y * ((-0.5d0) + ((y * z) * 0.16666666666666666d0))) - 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 <= -1.08e+71) {
tmp = x + 1.0;
} else if (y <= -3.0) {
tmp = Math.cos(y);
} else if (y <= 4.5e+45) {
tmp = x + (1.0 + (y * ((y * (-0.5 + ((y * z) * 0.16666666666666666))) - z)));
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.08e+71: tmp = x + 1.0 elif y <= -3.0: tmp = math.cos(y) elif y <= 4.5e+45: tmp = x + (1.0 + (y * ((y * (-0.5 + ((y * z) * 0.16666666666666666))) - z))) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.08e+71) tmp = Float64(x + 1.0); elseif (y <= -3.0) tmp = cos(y); elseif (y <= 4.5e+45) tmp = Float64(x + Float64(1.0 + Float64(y * Float64(Float64(y * Float64(-0.5 + Float64(Float64(y * z) * 0.16666666666666666))) - z)))); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.08e+71) tmp = x + 1.0; elseif (y <= -3.0) tmp = cos(y); elseif (y <= 4.5e+45) tmp = x + (1.0 + (y * ((y * (-0.5 + ((y * z) * 0.16666666666666666))) - z))); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.08e+71], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, -3.0], N[Cos[y], $MachinePrecision], If[LessEqual[y, 4.5e+45], N[(x + N[(1.0 + N[(y * N[(N[(y * N[(-0.5 + N[(N[(y * z), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.08 \cdot 10^{+71}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;y \leq -3:\\
\;\;\;\;\cos y\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+45}:\\
\;\;\;\;x + \left(1 + y \cdot \left(y \cdot \left(-0.5 + \left(y \cdot z\right) \cdot 0.16666666666666666\right) - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if y < -1.08e71 or 4.4999999999999998e45 < y Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6442.9%
Simplified42.9%
if -1.08e71 < y < -3Initial program 99.8%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
cos-lowering-cos.f6466.4%
Simplified66.4%
Taylor expanded in x around 0
cos-lowering-cos.f6455.8%
Simplified55.8%
if -3 < y < 4.4999999999999998e45Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6497.2%
Simplified97.2%
(FPCore (x y z)
:precision binary64
(if (<= y -4200000.0)
(+ x 1.0)
(if (<= y 4.5e+45)
(+ x (+ 1.0 (* y (- (* y (+ -0.5 (* (* y z) 0.16666666666666666))) z))))
(+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -4200000.0) {
tmp = x + 1.0;
} else if (y <= 4.5e+45) {
tmp = x + (1.0 + (y * ((y * (-0.5 + ((y * z) * 0.16666666666666666))) - 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 <= (-4200000.0d0)) then
tmp = x + 1.0d0
else if (y <= 4.5d+45) then
tmp = x + (1.0d0 + (y * ((y * ((-0.5d0) + ((y * z) * 0.16666666666666666d0))) - 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 <= -4200000.0) {
tmp = x + 1.0;
} else if (y <= 4.5e+45) {
tmp = x + (1.0 + (y * ((y * (-0.5 + ((y * z) * 0.16666666666666666))) - z)));
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -4200000.0: tmp = x + 1.0 elif y <= 4.5e+45: tmp = x + (1.0 + (y * ((y * (-0.5 + ((y * z) * 0.16666666666666666))) - z))) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -4200000.0) tmp = Float64(x + 1.0); elseif (y <= 4.5e+45) tmp = Float64(x + Float64(1.0 + Float64(y * Float64(Float64(y * Float64(-0.5 + Float64(Float64(y * z) * 0.16666666666666666))) - z)))); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -4200000.0) tmp = x + 1.0; elseif (y <= 4.5e+45) tmp = x + (1.0 + (y * ((y * (-0.5 + ((y * z) * 0.16666666666666666))) - z))); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -4200000.0], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 4.5e+45], N[(x + N[(1.0 + N[(y * N[(N[(y * N[(-0.5 + N[(N[(y * z), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4200000:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+45}:\\
\;\;\;\;x + \left(1 + y \cdot \left(y \cdot \left(-0.5 + \left(y \cdot z\right) \cdot 0.16666666666666666\right) - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if y < -4.2e6 or 4.4999999999999998e45 < y Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6439.5%
Simplified39.5%
if -4.2e6 < y < 4.4999999999999998e45Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6496.0%
Simplified96.0%
(FPCore (x y z) :precision binary64 (if (<= y -2.3e+125) (+ x 1.0) (if (<= y 2.75e+17) (- 1.0 (- (* y z) x)) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.3e+125) {
tmp = x + 1.0;
} else if (y <= 2.75e+17) {
tmp = 1.0 - ((y * z) - x);
} 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.3d+125)) then
tmp = x + 1.0d0
else if (y <= 2.75d+17) then
tmp = 1.0d0 - ((y * z) - x)
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.3e+125) {
tmp = x + 1.0;
} else if (y <= 2.75e+17) {
tmp = 1.0 - ((y * z) - x);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.3e+125: tmp = x + 1.0 elif y <= 2.75e+17: tmp = 1.0 - ((y * z) - x) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.3e+125) tmp = Float64(x + 1.0); elseif (y <= 2.75e+17) tmp = Float64(1.0 - Float64(Float64(y * z) - x)); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.3e+125) tmp = x + 1.0; elseif (y <= 2.75e+17) tmp = 1.0 - ((y * z) - x); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.3e+125], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 2.75e+17], N[(1.0 - N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+125}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;y \leq 2.75 \cdot 10^{+17}:\\
\;\;\;\;1 - \left(y \cdot z - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if y < -2.30000000000000013e125 or 2.75e17 < y Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6446.4%
Simplified46.4%
if -2.30000000000000013e125 < y < 2.75e17Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
associate-+r+N/A
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64N/A
*-lowering-*.f6481.8%
Simplified81.8%
(FPCore (x y z) :precision binary64 (if (<= x -6.2e-51) (+ x 1.0) (if (<= x 820.0) (- 1.0 (* y z)) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -6.2e-51) {
tmp = x + 1.0;
} else if (x <= 820.0) {
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 <= (-6.2d-51)) then
tmp = x + 1.0d0
else if (x <= 820.0d0) 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 <= -6.2e-51) {
tmp = x + 1.0;
} else if (x <= 820.0) {
tmp = 1.0 - (y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -6.2e-51: tmp = x + 1.0 elif x <= 820.0: tmp = 1.0 - (y * z) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -6.2e-51) tmp = Float64(x + 1.0); elseif (x <= 820.0) 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 <= -6.2e-51) tmp = x + 1.0; elseif (x <= 820.0) tmp = 1.0 - (y * z); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -6.2e-51], N[(x + 1.0), $MachinePrecision], If[LessEqual[x, 820.0], N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{-51}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;x \leq 820:\\
\;\;\;\;1 - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if x < -6.1999999999999995e-51 or 820 < x Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6480.7%
Simplified80.7%
if -6.1999999999999995e-51 < x < 820Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
associate-+r+N/A
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64N/A
*-lowering-*.f6453.5%
Simplified53.5%
Taylor expanded in x around 0
--lowering--.f64N/A
*-lowering-*.f6453.5%
Simplified53.5%
(FPCore (x y z) :precision binary64 (if (<= x -1.05e-11) x (if (<= x 2.2) 1.0 x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.05e-11) {
tmp = x;
} else if (x <= 2.2) {
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 <= (-1.05d-11)) then
tmp = x
else if (x <= 2.2d0) 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 <= -1.05e-11) {
tmp = x;
} else if (x <= 2.2) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.05e-11: tmp = x elif x <= 2.2: tmp = 1.0 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.05e-11) tmp = x; elseif (x <= 2.2) tmp = 1.0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.05e-11) tmp = x; elseif (x <= 2.2) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.05e-11], x, If[LessEqual[x, 2.2], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-11}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.2:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.0499999999999999e-11 or 2.2000000000000002 < x Initial program 99.9%
Taylor expanded in x around inf
Simplified79.0%
if -1.0499999999999999e-11 < x < 2.2000000000000002Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6440.9%
Simplified40.9%
Taylor expanded in x around 0
Simplified40.8%
(FPCore (x y z) :precision binary64 (if (<= z 4.8e+251) (+ x 1.0) (- 0.0 (* y z))))
double code(double x, double y, double z) {
double tmp;
if (z <= 4.8e+251) {
tmp = x + 1.0;
} else {
tmp = 0.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 (z <= 4.8d+251) then
tmp = x + 1.0d0
else
tmp = 0.0d0 - (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 4.8e+251) {
tmp = x + 1.0;
} else {
tmp = 0.0 - (y * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 4.8e+251: tmp = x + 1.0 else: tmp = 0.0 - (y * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= 4.8e+251) tmp = Float64(x + 1.0); else tmp = Float64(0.0 - Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 4.8e+251) tmp = x + 1.0; else tmp = 0.0 - (y * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 4.8e+251], N[(x + 1.0), $MachinePrecision], N[(0.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.8 \cdot 10^{+251}:\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;0 - y \cdot z\\
\end{array}
\end{array}
if z < 4.79999999999999962e251Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6462.7%
Simplified62.7%
if 4.79999999999999962e251 < z Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
associate-+r+N/A
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64N/A
*-lowering-*.f6457.9%
Simplified57.9%
Taylor expanded in y around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f6457.9%
Simplified57.9%
(FPCore (x y z) :precision binary64 (+ x 1.0))
double code(double x, double y, double z) {
return x + 1.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + 1.0d0
end function
public static double code(double x, double y, double z) {
return x + 1.0;
}
def code(x, y, z): return x + 1.0
function code(x, y, z) return Float64(x + 1.0) end
function tmp = code(x, y, z) tmp = x + 1.0; end
code[x_, y_, z_] := N[(x + 1.0), $MachinePrecision]
\begin{array}{l}
\\
x + 1
\end{array}
Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6460.1%
Simplified60.1%
(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 y around 0
+-commutativeN/A
+-lowering-+.f6460.1%
Simplified60.1%
Taylor expanded in x around 0
Simplified22.5%
herbie shell --seed 2024161
(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))))