
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - 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 + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - 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 + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
(FPCore (x y z) :precision binary64 (fma (- y x) (fma z -6.0 4.0) x))
double code(double x, double y, double z) {
return fma((y - x), fma(z, -6.0, 4.0), x);
}
function code(x, y, z) return fma(Float64(y - x), fma(z, -6.0, 4.0), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(z * -6.0 + 4.0), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, \mathsf{fma}\left(z, -6, 4\right), x\right)
\end{array}
Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
distribute-rgt-neg-out99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
(FPCore (x y z) :precision binary64 (fma (- y x) (+ 4.0 (* z -6.0)) x))
double code(double x, double y, double z) {
return fma((y - x), (4.0 + (z * -6.0)), x);
}
function code(x, y, z) return fma(Float64(y - x), Float64(4.0 + Float64(z * -6.0)), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, 4 + z \cdot -6, x\right)
\end{array}
Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.56) (not (<= z 0.6))) (* z (+ (* y -6.0) (* x 6.0))) (+ (* y 4.0) (* x -3.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.56) || !(z <= 0.6)) {
tmp = z * ((y * -6.0) + (x * 6.0));
} else {
tmp = (y * 4.0) + (x * -3.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 <= (-0.56d0)) .or. (.not. (z <= 0.6d0))) then
tmp = z * ((y * (-6.0d0)) + (x * 6.0d0))
else
tmp = (y * 4.0d0) + (x * (-3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.56) || !(z <= 0.6)) {
tmp = z * ((y * -6.0) + (x * 6.0));
} else {
tmp = (y * 4.0) + (x * -3.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.56) or not (z <= 0.6): tmp = z * ((y * -6.0) + (x * 6.0)) else: tmp = (y * 4.0) + (x * -3.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.56) || !(z <= 0.6)) tmp = Float64(z * Float64(Float64(y * -6.0) + Float64(x * 6.0))); else tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.56) || ~((z <= 0.6))) tmp = z * ((y * -6.0) + (x * 6.0)); else tmp = (y * 4.0) + (x * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.56], N[Not[LessEqual[z, 0.6]], $MachinePrecision]], N[(z * N[(N[(y * -6.0), $MachinePrecision] + N[(x * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.56 \lor \neg \left(z \leq 0.6\right):\\
\;\;\;\;z \cdot \left(y \cdot -6 + x \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\end{array}
\end{array}
if z < -0.56000000000000005 or 0.599999999999999978 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.8%
fma-define99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 95.2%
Taylor expanded in z around inf 97.5%
if -0.56000000000000005 < z < 0.599999999999999978Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-define99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 99.4%
Taylor expanded in z around 0 96.1%
Final simplification96.8%
(FPCore (x y z) :precision binary64 (if (or (<= x -75000000000000.0) (not (<= x 2.75e+47))) (* x (+ -3.0 (* z 6.0))) (* y (+ 4.0 (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -75000000000000.0) || !(x <= 2.75e+47)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (4.0 + (z * -6.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 <= (-75000000000000.0d0)) .or. (.not. (x <= 2.75d+47))) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else
tmp = y * (4.0d0 + (z * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -75000000000000.0) || !(x <= 2.75e+47)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -75000000000000.0) or not (x <= 2.75e+47): tmp = x * (-3.0 + (z * 6.0)) else: tmp = y * (4.0 + (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -75000000000000.0) || !(x <= 2.75e+47)) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -75000000000000.0) || ~((x <= 2.75e+47))) tmp = x * (-3.0 + (z * 6.0)); else tmp = y * (4.0 + (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -75000000000000.0], N[Not[LessEqual[x, 2.75e+47]], $MachinePrecision]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -75000000000000 \lor \neg \left(x \leq 2.75 \cdot 10^{+47}\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\end{array}
\end{array}
if x < -7.5e13 or 2.7499999999999999e47 < x Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 85.2%
*-lft-identity85.2%
*-commutative85.2%
associate-*r*85.3%
sub-neg85.3%
distribute-rgt-in85.3%
metadata-eval85.3%
neg-mul-185.3%
associate-*r*85.3%
*-commutative85.3%
metadata-eval85.3%
distribute-lft-in85.3%
distribute-rgt-in85.3%
distribute-lft-in85.3%
metadata-eval85.3%
associate-+r+85.3%
metadata-eval85.3%
associate-*r*85.3%
metadata-eval85.3%
Simplified85.3%
if -7.5e13 < x < 2.7499999999999999e47Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 75.1%
Final simplification79.5%
(FPCore (x y z) :precision binary64 (if (or (<= x -2.4e+14) (not (<= x 1.45e+49))) (* x (+ -3.0 (* z 6.0))) (* y (* 6.0 (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -2.4e+14) || !(x <= 1.45e+49)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (6.0 * (0.6666666666666666 - z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-2.4d+14)) .or. (.not. (x <= 1.45d+49))) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else
tmp = y * (6.0d0 * (0.6666666666666666d0 - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -2.4e+14) || !(x <= 1.45e+49)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (6.0 * (0.6666666666666666 - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -2.4e+14) or not (x <= 1.45e+49): tmp = x * (-3.0 + (z * 6.0)) else: tmp = y * (6.0 * (0.6666666666666666 - z)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -2.4e+14) || !(x <= 1.45e+49)) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = Float64(y * Float64(6.0 * Float64(0.6666666666666666 - z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -2.4e+14) || ~((x <= 1.45e+49))) tmp = x * (-3.0 + (z * 6.0)); else tmp = y * (6.0 * (0.6666666666666666 - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -2.4e+14], N[Not[LessEqual[x, 1.45e+49]], $MachinePrecision]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(6.0 * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+14} \lor \neg \left(x \leq 1.45 \cdot 10^{+49}\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)\\
\end{array}
\end{array}
if x < -2.4e14 or 1.45e49 < x Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 85.2%
*-lft-identity85.2%
*-commutative85.2%
associate-*r*85.3%
sub-neg85.3%
distribute-rgt-in85.3%
metadata-eval85.3%
neg-mul-185.3%
associate-*r*85.3%
*-commutative85.3%
metadata-eval85.3%
distribute-lft-in85.3%
distribute-rgt-in85.3%
distribute-lft-in85.3%
metadata-eval85.3%
associate-+r+85.3%
metadata-eval85.3%
associate-*r*85.3%
metadata-eval85.3%
Simplified85.3%
if -2.4e14 < x < 1.45e49Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-define99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 99.4%
Taylor expanded in y around inf 74.8%
*-commutative74.8%
associate-*l*75.1%
Simplified75.1%
Final simplification79.5%
(FPCore (x y z) :precision binary64 (if (or (<= x -29500000000000.0) (not (<= x 10800.0))) (* x (+ -3.0 (* z 6.0))) (* 6.0 (* y (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -29500000000000.0) || !(x <= 10800.0)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-29500000000000.0d0)) .or. (.not. (x <= 10800.0d0))) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -29500000000000.0) || !(x <= 10800.0)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -29500000000000.0) or not (x <= 10800.0): tmp = x * (-3.0 + (z * 6.0)) else: tmp = 6.0 * (y * (0.6666666666666666 - z)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -29500000000000.0) || !(x <= 10800.0)) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -29500000000000.0) || ~((x <= 10800.0))) tmp = x * (-3.0 + (z * 6.0)); else tmp = 6.0 * (y * (0.6666666666666666 - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -29500000000000.0], N[Not[LessEqual[x, 10800.0]], $MachinePrecision]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -29500000000000 \lor \neg \left(x \leq 10800\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\end{array}
\end{array}
if x < -2.95e13 or 10800 < x Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 81.9%
*-lft-identity81.9%
*-commutative81.9%
associate-*r*82.0%
sub-neg82.0%
distribute-rgt-in82.0%
metadata-eval82.0%
neg-mul-182.0%
associate-*r*82.0%
*-commutative82.0%
metadata-eval82.0%
distribute-lft-in82.0%
distribute-rgt-in82.0%
distribute-lft-in82.0%
metadata-eval82.0%
associate-+r+82.0%
metadata-eval82.0%
associate-*r*82.0%
metadata-eval82.0%
Simplified82.0%
if -2.95e13 < x < 10800Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-define99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 99.5%
Taylor expanded in y around inf 76.8%
Final simplification79.3%
(FPCore (x y z) :precision binary64 (if (<= z -2.6e-15) (* x (+ -3.0 (* z 6.0))) (if (<= z 1.08e-8) (+ (* y 4.0) (* x -3.0)) (* y (+ 4.0 (* z -6.0))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.6e-15) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 1.08e-8) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = y * (4.0 + (z * -6.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.6d-15)) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else if (z <= 1.08d-8) then
tmp = (y * 4.0d0) + (x * (-3.0d0))
else
tmp = y * (4.0d0 + (z * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.6e-15) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 1.08e-8) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.6e-15: tmp = x * (-3.0 + (z * 6.0)) elif z <= 1.08e-8: tmp = (y * 4.0) + (x * -3.0) else: tmp = y * (4.0 + (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.6e-15) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); elseif (z <= 1.08e-8) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); else tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.6e-15) tmp = x * (-3.0 + (z * 6.0)); elseif (z <= 1.08e-8) tmp = (y * 4.0) + (x * -3.0); else tmp = y * (4.0 + (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.6e-15], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.08e-8], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{-8}:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\end{array}
\end{array}
if z < -2.60000000000000004e-15Initial program 99.6%
+-commutative99.6%
associate-*l*99.7%
fma-define99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 70.6%
*-lft-identity70.6%
*-commutative70.6%
associate-*r*70.6%
sub-neg70.6%
distribute-rgt-in70.6%
metadata-eval70.6%
neg-mul-170.6%
associate-*r*70.6%
*-commutative70.6%
metadata-eval70.6%
distribute-lft-in70.6%
distribute-rgt-in70.7%
distribute-lft-in70.7%
metadata-eval70.7%
associate-+r+70.7%
metadata-eval70.7%
associate-*r*70.7%
metadata-eval70.7%
Simplified70.7%
if -2.60000000000000004e-15 < z < 1.0800000000000001e-8Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-define99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 99.4%
Taylor expanded in z around 0 98.4%
if 1.0800000000000001e-8 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 55.9%
Final simplification79.5%
(FPCore (x y z) :precision binary64 (if (<= z -2.6e-15) (* x (+ -3.0 (* z 6.0))) (if (<= z 2.9e-8) (+ x (* (- y x) 4.0)) (* y (+ 4.0 (* z -6.0))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.6e-15) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 2.9e-8) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = y * (4.0 + (z * -6.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.6d-15)) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else if (z <= 2.9d-8) then
tmp = x + ((y - x) * 4.0d0)
else
tmp = y * (4.0d0 + (z * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.6e-15) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 2.9e-8) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.6e-15: tmp = x * (-3.0 + (z * 6.0)) elif z <= 2.9e-8: tmp = x + ((y - x) * 4.0) else: tmp = y * (4.0 + (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.6e-15) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); elseif (z <= 2.9e-8) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); else tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.6e-15) tmp = x * (-3.0 + (z * 6.0)); elseif (z <= 2.9e-8) tmp = x + ((y - x) * 4.0); else tmp = y * (4.0 + (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.6e-15], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e-8], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-8}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\end{array}
\end{array}
if z < -2.60000000000000004e-15Initial program 99.6%
+-commutative99.6%
associate-*l*99.7%
fma-define99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 70.6%
*-lft-identity70.6%
*-commutative70.6%
associate-*r*70.6%
sub-neg70.6%
distribute-rgt-in70.6%
metadata-eval70.6%
neg-mul-170.6%
associate-*r*70.6%
*-commutative70.6%
metadata-eval70.6%
distribute-lft-in70.6%
distribute-rgt-in70.7%
distribute-lft-in70.7%
metadata-eval70.7%
associate-+r+70.7%
metadata-eval70.7%
associate-*r*70.7%
metadata-eval70.7%
Simplified70.7%
if -2.60000000000000004e-15 < z < 2.9000000000000002e-8Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 98.3%
if 2.9000000000000002e-8 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 55.9%
Final simplification79.5%
(FPCore (x y z)
:precision binary64
(if (<= x -1850000000000.0)
(* 6.0 (* x z))
(if (<= x 1.06e+150)
(* 6.0 (* y (- 0.6666666666666666 z)))
(* z (* x 6.0)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1850000000000.0) {
tmp = 6.0 * (x * z);
} else if (x <= 1.06e+150) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = z * (x * 6.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 <= (-1850000000000.0d0)) then
tmp = 6.0d0 * (x * z)
else if (x <= 1.06d+150) then
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
else
tmp = z * (x * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1850000000000.0) {
tmp = 6.0 * (x * z);
} else if (x <= 1.06e+150) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = z * (x * 6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1850000000000.0: tmp = 6.0 * (x * z) elif x <= 1.06e+150: tmp = 6.0 * (y * (0.6666666666666666 - z)) else: tmp = z * (x * 6.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1850000000000.0) tmp = Float64(6.0 * Float64(x * z)); elseif (x <= 1.06e+150) tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); else tmp = Float64(z * Float64(x * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1850000000000.0) tmp = 6.0 * (x * z); elseif (x <= 1.06e+150) tmp = 6.0 * (y * (0.6666666666666666 - z)); else tmp = z * (x * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1850000000000.0], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.06e+150], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1850000000000:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;x \leq 1.06 \cdot 10^{+150}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\end{array}
\end{array}
if x < -1.85e12Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-define99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 87.4%
*-lft-identity87.4%
*-commutative87.4%
associate-*r*87.4%
sub-neg87.4%
distribute-rgt-in87.4%
metadata-eval87.4%
neg-mul-187.4%
associate-*r*87.4%
*-commutative87.4%
metadata-eval87.4%
distribute-lft-in87.4%
distribute-rgt-in87.4%
distribute-lft-in87.4%
metadata-eval87.4%
associate-+r+87.4%
metadata-eval87.4%
associate-*r*87.4%
metadata-eval87.4%
Simplified87.4%
Taylor expanded in z around inf 52.9%
if -1.85e12 < x < 1.06000000000000006e150Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-define99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 98.9%
Taylor expanded in y around inf 70.1%
if 1.06000000000000006e150 < x Initial program 99.9%
+-commutative99.9%
associate-*l*99.8%
fma-define99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 92.1%
*-lft-identity92.1%
*-commutative92.1%
associate-*r*92.2%
sub-neg92.2%
distribute-rgt-in92.2%
metadata-eval92.2%
neg-mul-192.2%
associate-*r*92.2%
*-commutative92.2%
metadata-eval92.2%
distribute-lft-in92.2%
distribute-rgt-in92.1%
distribute-lft-in92.1%
metadata-eval92.1%
associate-+r+92.1%
metadata-eval92.1%
associate-*r*92.1%
metadata-eval92.1%
Simplified92.1%
Taylor expanded in z around inf 71.2%
associate-*r*71.2%
*-commutative71.2%
Simplified71.2%
Final simplification66.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.7) (not (<= z 0.55))) (* 6.0 (* x z)) (* y 4.0)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.7) || !(z <= 0.55)) {
tmp = 6.0 * (x * z);
} else {
tmp = y * 4.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 <= (-0.7d0)) .or. (.not. (z <= 0.55d0))) then
tmp = 6.0d0 * (x * z)
else
tmp = y * 4.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.7) || !(z <= 0.55)) {
tmp = 6.0 * (x * z);
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.7) or not (z <= 0.55): tmp = 6.0 * (x * z) else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.7) || !(z <= 0.55)) tmp = Float64(6.0 * Float64(x * z)); else tmp = Float64(y * 4.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.7) || ~((z <= 0.55))) tmp = 6.0 * (x * z); else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.7], N[Not[LessEqual[z, 0.55]], $MachinePrecision]], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.7 \lor \neg \left(z \leq 0.55\right):\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if z < -0.69999999999999996 or 0.55000000000000004 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.8%
fma-define99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 62.8%
*-lft-identity62.8%
*-commutative62.8%
associate-*r*62.8%
sub-neg62.8%
distribute-rgt-in62.8%
metadata-eval62.8%
neg-mul-162.8%
associate-*r*62.8%
*-commutative62.8%
metadata-eval62.8%
distribute-lft-in62.8%
distribute-rgt-in62.8%
distribute-lft-in62.8%
metadata-eval62.8%
associate-+r+62.8%
metadata-eval62.8%
associate-*r*62.8%
metadata-eval62.8%
Simplified62.8%
Taylor expanded in z around inf 60.7%
if -0.69999999999999996 < z < 0.55000000000000004Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 60.3%
Taylor expanded in z around 0 58.4%
*-commutative58.4%
Simplified58.4%
Final simplification59.6%
(FPCore (x y z) :precision binary64 (if (<= z -0.34) (* 6.0 (* x z)) (if (<= z 0.66) (* y 4.0) (* y (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.34) {
tmp = 6.0 * (x * z);
} else if (z <= 0.66) {
tmp = y * 4.0;
} else {
tmp = y * (z * -6.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 <= (-0.34d0)) then
tmp = 6.0d0 * (x * z)
else if (z <= 0.66d0) then
tmp = y * 4.0d0
else
tmp = y * (z * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.34) {
tmp = 6.0 * (x * z);
} else if (z <= 0.66) {
tmp = y * 4.0;
} else {
tmp = y * (z * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.34: tmp = 6.0 * (x * z) elif z <= 0.66: tmp = y * 4.0 else: tmp = y * (z * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.34) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= 0.66) tmp = Float64(y * 4.0); else tmp = Float64(y * Float64(z * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.34) tmp = 6.0 * (x * z); elseif (z <= 0.66) tmp = y * 4.0; else tmp = y * (z * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.34], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.66], N[(y * 4.0), $MachinePrecision], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.34:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.340000000000000024Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 71.1%
*-lft-identity71.1%
*-commutative71.1%
associate-*r*71.1%
sub-neg71.1%
distribute-rgt-in71.1%
metadata-eval71.1%
neg-mul-171.1%
associate-*r*71.1%
*-commutative71.1%
metadata-eval71.1%
distribute-lft-in71.1%
distribute-rgt-in71.1%
distribute-lft-in71.1%
metadata-eval71.1%
associate-+r+71.1%
metadata-eval71.1%
associate-*r*71.1%
metadata-eval71.1%
Simplified71.1%
Taylor expanded in z around inf 67.2%
if -0.340000000000000024 < z < 0.660000000000000031Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 60.3%
Taylor expanded in z around 0 58.4%
*-commutative58.4%
Simplified58.4%
if 0.660000000000000031 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 54.7%
Taylor expanded in z around inf 54.4%
*-commutative54.4%
associate-*l*54.5%
Simplified54.5%
(FPCore (x y z) :precision binary64 (if (<= z -0.0115) (* 6.0 (* x z)) (if (<= z 0.62) (* y 4.0) (* x (* z 6.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.0115) {
tmp = 6.0 * (x * z);
} else if (z <= 0.62) {
tmp = y * 4.0;
} else {
tmp = x * (z * 6.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 <= (-0.0115d0)) then
tmp = 6.0d0 * (x * z)
else if (z <= 0.62d0) then
tmp = y * 4.0d0
else
tmp = x * (z * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.0115) {
tmp = 6.0 * (x * z);
} else if (z <= 0.62) {
tmp = y * 4.0;
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.0115: tmp = 6.0 * (x * z) elif z <= 0.62: tmp = y * 4.0 else: tmp = x * (z * 6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.0115) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= 0.62) tmp = Float64(y * 4.0); else tmp = Float64(x * Float64(z * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.0115) tmp = 6.0 * (x * z); elseif (z <= 0.62) tmp = y * 4.0; else tmp = x * (z * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.0115], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.62], N[(y * 4.0), $MachinePrecision], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0115:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq 0.62:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\end{array}
\end{array}
if z < -0.0115Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 71.1%
*-lft-identity71.1%
*-commutative71.1%
associate-*r*71.1%
sub-neg71.1%
distribute-rgt-in71.1%
metadata-eval71.1%
neg-mul-171.1%
associate-*r*71.1%
*-commutative71.1%
metadata-eval71.1%
distribute-lft-in71.1%
distribute-rgt-in71.1%
distribute-lft-in71.1%
metadata-eval71.1%
associate-+r+71.1%
metadata-eval71.1%
associate-*r*71.1%
metadata-eval71.1%
Simplified71.1%
Taylor expanded in z around inf 67.2%
if -0.0115 < z < 0.619999999999999996Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 60.3%
Taylor expanded in z around 0 58.4%
*-commutative58.4%
Simplified58.4%
if 0.619999999999999996 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.8%
fma-define99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 53.8%
*-lft-identity53.8%
*-commutative53.8%
associate-*r*53.8%
sub-neg53.8%
distribute-rgt-in53.8%
metadata-eval53.8%
neg-mul-153.8%
associate-*r*53.8%
*-commutative53.8%
metadata-eval53.8%
distribute-lft-in53.8%
distribute-rgt-in53.8%
distribute-lft-in53.8%
metadata-eval53.8%
associate-+r+53.8%
metadata-eval53.8%
associate-*r*53.8%
metadata-eval53.8%
Simplified53.8%
Taylor expanded in z around inf 53.7%
associate-*r*53.7%
*-commutative53.7%
associate-*r*53.7%
*-commutative53.7%
Simplified53.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -9e+20) (not (<= x 4.8e+47))) (* x -3.0) (* y 4.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -9e+20) || !(x <= 4.8e+47)) {
tmp = x * -3.0;
} else {
tmp = y * 4.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 <= (-9d+20)) .or. (.not. (x <= 4.8d+47))) then
tmp = x * (-3.0d0)
else
tmp = y * 4.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -9e+20) || !(x <= 4.8e+47)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -9e+20) or not (x <= 4.8e+47): tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -9e+20) || !(x <= 4.8e+47)) tmp = Float64(x * -3.0); else tmp = Float64(y * 4.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -9e+20) || ~((x <= 4.8e+47))) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -9e+20], N[Not[LessEqual[x, 4.8e+47]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9 \cdot 10^{+20} \lor \neg \left(x \leq 4.8 \cdot 10^{+47}\right):\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if x < -9e20 or 4.80000000000000037e47 < x Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 85.0%
*-lft-identity85.0%
*-commutative85.0%
associate-*r*85.2%
sub-neg85.2%
distribute-rgt-in85.2%
metadata-eval85.2%
neg-mul-185.2%
associate-*r*85.2%
*-commutative85.2%
metadata-eval85.2%
distribute-lft-in85.2%
distribute-rgt-in85.2%
distribute-lft-in85.2%
metadata-eval85.2%
associate-+r+85.2%
metadata-eval85.2%
associate-*r*85.2%
metadata-eval85.2%
Simplified85.2%
Taylor expanded in z around 0 33.3%
*-commutative33.3%
Simplified33.3%
if -9e20 < x < 4.80000000000000037e47Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 74.7%
Taylor expanded in z around 0 43.4%
*-commutative43.4%
Simplified43.4%
Final simplification39.1%
(FPCore (x y z) :precision binary64 (+ x (* (- y x) (* 6.0 (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
return x + ((y - x) * (6.0 * (0.6666666666666666 - 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 + ((y - x) * (6.0d0 * (0.6666666666666666d0 - z)))
end function
public static double code(double x, double y, double z) {
return x + ((y - x) * (6.0 * (0.6666666666666666 - z)));
}
def code(x, y, z): return x + ((y - x) * (6.0 * (0.6666666666666666 - z)))
function code(x, y, z) return Float64(x + Float64(Float64(y - x) * Float64(6.0 * Float64(0.6666666666666666 - z)))) end
function tmp = code(x, y, z) tmp = x + ((y - x) * (6.0 * (0.6666666666666666 - z))); end
code[x_, y_, z_] := N[(x + N[(N[(y - x), $MachinePrecision] * N[(6.0 * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)
\end{array}
Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-define99.8%
metadata-eval99.8%
Simplified99.8%
fma-undefine99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (+ x (* (- 0.6666666666666666 z) (* (- y x) 6.0))))
double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * ((y - x) * 6.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 + ((0.6666666666666666d0 - z) * ((y - x) * 6.0d0))
end function
public static double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * ((y - x) * 6.0));
}
def code(x, y, z): return x + ((0.6666666666666666 - z) * ((y - x) * 6.0))
function code(x, y, z) return Float64(x + Float64(Float64(0.6666666666666666 - z) * Float64(Float64(y - x) * 6.0))) end
function tmp = code(x, y, z) tmp = x + ((0.6666666666666666 - z) * ((y - x) * 6.0)); end
code[x_, y_, z_] := N[(x + N[(N[(0.6666666666666666 - z), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(0.6666666666666666 - z\right) \cdot \left(\left(y - x\right) \cdot 6\right)
\end{array}
Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (* x -3.0))
double code(double x, double y, double z) {
return x * -3.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 * (-3.0d0)
end function
public static double code(double x, double y, double z) {
return x * -3.0;
}
def code(x, y, z): return x * -3.0
function code(x, y, z) return Float64(x * -3.0) end
function tmp = code(x, y, z) tmp = x * -3.0; end
code[x_, y_, z_] := N[(x * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot -3
\end{array}
Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-define99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 51.8%
*-lft-identity51.8%
*-commutative51.8%
associate-*r*51.8%
sub-neg51.8%
distribute-rgt-in51.8%
metadata-eval51.8%
neg-mul-151.8%
associate-*r*51.8%
*-commutative51.8%
metadata-eval51.8%
distribute-lft-in51.8%
distribute-rgt-in51.9%
distribute-lft-in51.9%
metadata-eval51.9%
associate-+r+51.9%
metadata-eval51.9%
associate-*r*51.9%
metadata-eval51.9%
Simplified51.9%
Taylor expanded in z around 0 20.5%
*-commutative20.5%
Simplified20.5%
(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.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around inf 52.0%
Taylor expanded in z around 0 2.5%
herbie shell --seed 2024146
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, D"
:precision binary64
(+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))