
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) z)))
double code(double x, double y, double z) {
return x + (((y - x) * 6.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) * z)
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * z);
}
def code(x, y, z): return x + (((y - x) * 6.0) * z)
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * z)) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * z); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) z)))
double code(double x, double y, double z) {
return x + (((y - x) * 6.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) * z)
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * z);
}
def code(x, y, z): return x + (((y - x) * 6.0) * z)
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * z)) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * z); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
\end{array}
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) z)))
double code(double x, double y, double z) {
return x + (((y - x) * 6.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) * z)
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * z);
}
def code(x, y, z): return x + (((y - x) * 6.0) * z)
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * z)) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * z); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
\end{array}
Initial program 99.9%
(FPCore (x y z)
:precision binary64
(if (<= z -3700000000.0)
(* x (/ z -0.16666666666666666))
(if (<= z -1.7e-34)
(* 6.0 (* y z))
(if (<= z 1.55e-67) x (* z (* y 6.0))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3700000000.0) {
tmp = x * (z / -0.16666666666666666);
} else if (z <= -1.7e-34) {
tmp = 6.0 * (y * z);
} else if (z <= 1.55e-67) {
tmp = x;
} else {
tmp = z * (y * 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 <= (-3700000000.0d0)) then
tmp = x * (z / (-0.16666666666666666d0))
else if (z <= (-1.7d-34)) then
tmp = 6.0d0 * (y * z)
else if (z <= 1.55d-67) then
tmp = x
else
tmp = z * (y * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3700000000.0) {
tmp = x * (z / -0.16666666666666666);
} else if (z <= -1.7e-34) {
tmp = 6.0 * (y * z);
} else if (z <= 1.55e-67) {
tmp = x;
} else {
tmp = z * (y * 6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3700000000.0: tmp = x * (z / -0.16666666666666666) elif z <= -1.7e-34: tmp = 6.0 * (y * z) elif z <= 1.55e-67: tmp = x else: tmp = z * (y * 6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3700000000.0) tmp = Float64(x * Float64(z / -0.16666666666666666)); elseif (z <= -1.7e-34) tmp = Float64(6.0 * Float64(y * z)); elseif (z <= 1.55e-67) tmp = x; else tmp = Float64(z * Float64(y * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3700000000.0) tmp = x * (z / -0.16666666666666666); elseif (z <= -1.7e-34) tmp = 6.0 * (y * z); elseif (z <= 1.55e-67) tmp = x; else tmp = z * (y * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3700000000.0], N[(x * N[(z / -0.16666666666666666), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.7e-34], N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e-67], x, N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3700000000:\\
\;\;\;\;x \cdot \frac{z}{-0.16666666666666666}\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-34}:\\
\;\;\;\;6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-67}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot 6\right)\\
\end{array}
\end{array}
if z < -3.7e9Initial program 99.8%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.4%
Simplified99.4%
Taylor expanded in y around 0
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6458.6%
Simplified58.6%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6458.5%
Applied egg-rr58.5%
metadata-evalN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
metadata-eval58.6%
Applied egg-rr58.6%
if -3.7e9 < z < -1.7e-34Initial program 99.5%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6471.9%
Simplified71.9%
Taylor expanded in y around inf
Simplified63.9%
if -1.7e-34 < z < 1.5500000000000001e-67Initial program 99.9%
Taylor expanded in z around 0
Simplified79.0%
if 1.5500000000000001e-67 < z Initial program 99.8%
Taylor expanded in x around 0
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6453.1%
Simplified53.1%
Final simplification66.9%
(FPCore (x y z) :precision binary64 (if (<= z -29000000000.0) (* z (* x -6.0)) (if (<= z -8.6e-35) (* 6.0 (* y z)) (if (<= z 1.9e-67) x (* z (* y 6.0))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -29000000000.0) {
tmp = z * (x * -6.0);
} else if (z <= -8.6e-35) {
tmp = 6.0 * (y * z);
} else if (z <= 1.9e-67) {
tmp = x;
} else {
tmp = z * (y * 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 <= (-29000000000.0d0)) then
tmp = z * (x * (-6.0d0))
else if (z <= (-8.6d-35)) then
tmp = 6.0d0 * (y * z)
else if (z <= 1.9d-67) then
tmp = x
else
tmp = z * (y * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -29000000000.0) {
tmp = z * (x * -6.0);
} else if (z <= -8.6e-35) {
tmp = 6.0 * (y * z);
} else if (z <= 1.9e-67) {
tmp = x;
} else {
tmp = z * (y * 6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -29000000000.0: tmp = z * (x * -6.0) elif z <= -8.6e-35: tmp = 6.0 * (y * z) elif z <= 1.9e-67: tmp = x else: tmp = z * (y * 6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -29000000000.0) tmp = Float64(z * Float64(x * -6.0)); elseif (z <= -8.6e-35) tmp = Float64(6.0 * Float64(y * z)); elseif (z <= 1.9e-67) tmp = x; else tmp = Float64(z * Float64(y * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -29000000000.0) tmp = z * (x * -6.0); elseif (z <= -8.6e-35) tmp = 6.0 * (y * z); elseif (z <= 1.9e-67) tmp = x; else tmp = z * (y * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -29000000000.0], N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.6e-35], N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e-67], x, N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -29000000000:\\
\;\;\;\;z \cdot \left(x \cdot -6\right)\\
\mathbf{elif}\;z \leq -8.6 \cdot 10^{-35}:\\
\;\;\;\;6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-67}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot 6\right)\\
\end{array}
\end{array}
if z < -2.9e10Initial program 99.8%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.4%
Simplified99.4%
Taylor expanded in y around 0
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6458.6%
Simplified58.6%
if -2.9e10 < z < -8.6000000000000004e-35Initial program 99.5%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6471.9%
Simplified71.9%
Taylor expanded in y around inf
Simplified63.9%
if -8.6000000000000004e-35 < z < 1.89999999999999994e-67Initial program 99.9%
Taylor expanded in z around 0
Simplified79.0%
if 1.89999999999999994e-67 < z Initial program 99.8%
Taylor expanded in x around 0
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6453.1%
Simplified53.1%
Final simplification66.9%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* (- y x) (/ z 0.16666666666666666)))) (if (<= z -0.195) t_0 (if (<= z 0.165) (+ x (* y (* 6.0 z))) t_0))))
double code(double x, double y, double z) {
double t_0 = (y - x) * (z / 0.16666666666666666);
double tmp;
if (z <= -0.195) {
tmp = t_0;
} else if (z <= 0.165) {
tmp = x + (y * (6.0 * 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 = (y - x) * (z / 0.16666666666666666d0)
if (z <= (-0.195d0)) then
tmp = t_0
else if (z <= 0.165d0) then
tmp = x + (y * (6.0d0 * z))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (y - x) * (z / 0.16666666666666666);
double tmp;
if (z <= -0.195) {
tmp = t_0;
} else if (z <= 0.165) {
tmp = x + (y * (6.0 * z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (y - x) * (z / 0.16666666666666666) tmp = 0 if z <= -0.195: tmp = t_0 elif z <= 0.165: tmp = x + (y * (6.0 * z)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(y - x) * Float64(z / 0.16666666666666666)) tmp = 0.0 if (z <= -0.195) tmp = t_0; elseif (z <= 0.165) tmp = Float64(x + Float64(y * Float64(6.0 * z))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y - x) * (z / 0.16666666666666666); tmp = 0.0; if (z <= -0.195) tmp = t_0; elseif (z <= 0.165) tmp = x + (y * (6.0 * z)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y - x), $MachinePrecision] * N[(z / 0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.195], t$95$0, If[LessEqual[z, 0.165], N[(x + N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y - x\right) \cdot \frac{z}{0.16666666666666666}\\
\mathbf{if}\;z \leq -0.195:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 0.165:\\
\;\;\;\;x + y \cdot \left(6 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.19500000000000001 or 0.165000000000000008 < z Initial program 99.8%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.4%
Simplified99.4%
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
associate-/r/N/A
clear-numN/A
associate-*l/N/A
div-invN/A
times-fracN/A
remove-double-divN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
metadata-eval99.5%
Applied egg-rr99.5%
if -0.19500000000000001 < z < 0.165000000000000008Initial program 99.9%
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
Taylor expanded in y around inf
Simplified98.0%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* (- y x) (/ z 0.16666666666666666)))) (if (<= z -5.2e-35) t_0 (if (<= z 1.9e-67) x t_0))))
double code(double x, double y, double z) {
double t_0 = (y - x) * (z / 0.16666666666666666);
double tmp;
if (z <= -5.2e-35) {
tmp = t_0;
} else if (z <= 1.9e-67) {
tmp = x;
} 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 = (y - x) * (z / 0.16666666666666666d0)
if (z <= (-5.2d-35)) then
tmp = t_0
else if (z <= 1.9d-67) then
tmp = x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (y - x) * (z / 0.16666666666666666);
double tmp;
if (z <= -5.2e-35) {
tmp = t_0;
} else if (z <= 1.9e-67) {
tmp = x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (y - x) * (z / 0.16666666666666666) tmp = 0 if z <= -5.2e-35: tmp = t_0 elif z <= 1.9e-67: tmp = x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(y - x) * Float64(z / 0.16666666666666666)) tmp = 0.0 if (z <= -5.2e-35) tmp = t_0; elseif (z <= 1.9e-67) tmp = x; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y - x) * (z / 0.16666666666666666); tmp = 0.0; if (z <= -5.2e-35) tmp = t_0; elseif (z <= 1.9e-67) tmp = x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y - x), $MachinePrecision] * N[(z / 0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e-35], t$95$0, If[LessEqual[z, 1.9e-67], x, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y - x\right) \cdot \frac{z}{0.16666666666666666}\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{-35}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-67}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -5.20000000000000009e-35 or 1.89999999999999994e-67 < z Initial program 99.8%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6494.0%
Simplified94.0%
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
associate-/r/N/A
clear-numN/A
associate-*l/N/A
div-invN/A
times-fracN/A
remove-double-divN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
metadata-eval94.1%
Applied egg-rr94.1%
if -5.20000000000000009e-35 < z < 1.89999999999999994e-67Initial program 99.9%
Taylor expanded in z around 0
Simplified79.0%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* 6.0 (* (- y x) z)))) (if (<= z -4.4e-35) t_0 (if (<= z 1.9e-67) x t_0))))
double code(double x, double y, double z) {
double t_0 = 6.0 * ((y - x) * z);
double tmp;
if (z <= -4.4e-35) {
tmp = t_0;
} else if (z <= 1.9e-67) {
tmp = x;
} 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 = 6.0d0 * ((y - x) * z)
if (z <= (-4.4d-35)) then
tmp = t_0
else if (z <= 1.9d-67) then
tmp = x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * ((y - x) * z);
double tmp;
if (z <= -4.4e-35) {
tmp = t_0;
} else if (z <= 1.9e-67) {
tmp = x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * ((y - x) * z) tmp = 0 if z <= -4.4e-35: tmp = t_0 elif z <= 1.9e-67: tmp = x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -4.4e-35) tmp = t_0; elseif (z <= 1.9e-67) tmp = x; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * ((y - x) * z); tmp = 0.0; if (z <= -4.4e-35) tmp = t_0; elseif (z <= 1.9e-67) tmp = x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.4e-35], t$95$0, If[LessEqual[z, 1.9e-67], x, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{-35}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-67}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -4.39999999999999987e-35 or 1.89999999999999994e-67 < z Initial program 99.8%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6494.0%
Simplified94.0%
if -4.39999999999999987e-35 < z < 1.89999999999999994e-67Initial program 99.9%
Taylor expanded in z around 0
Simplified79.0%
Final simplification87.1%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* z (* y 6.0)))) (if (<= z -1.75e-34) t_0 (if (<= z 1.9e-67) x t_0))))
double code(double x, double y, double z) {
double t_0 = z * (y * 6.0);
double tmp;
if (z <= -1.75e-34) {
tmp = t_0;
} else if (z <= 1.9e-67) {
tmp = x;
} 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 * (y * 6.0d0)
if (z <= (-1.75d-34)) then
tmp = t_0
else if (z <= 1.9d-67) then
tmp = x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (y * 6.0);
double tmp;
if (z <= -1.75e-34) {
tmp = t_0;
} else if (z <= 1.9e-67) {
tmp = x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * (y * 6.0) tmp = 0 if z <= -1.75e-34: tmp = t_0 elif z <= 1.9e-67: tmp = x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(y * 6.0)) tmp = 0.0 if (z <= -1.75e-34) tmp = t_0; elseif (z <= 1.9e-67) tmp = x; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (y * 6.0); tmp = 0.0; if (z <= -1.75e-34) tmp = t_0; elseif (z <= 1.9e-67) tmp = x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e-34], t$95$0, If[LessEqual[z, 1.9e-67], x, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(y \cdot 6\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{-34}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-67}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.75e-34 or 1.89999999999999994e-67 < z Initial program 99.8%
Taylor expanded in x around 0
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6451.4%
Simplified51.4%
if -1.75e-34 < z < 1.89999999999999994e-67Initial program 99.9%
Taylor expanded in z around 0
Simplified79.0%
Final simplification64.0%
(FPCore (x y z) :precision binary64 (if (<= z -3.4e-35) (* 6.0 (* y z)) (if (<= z 1.35e-67) x (* y (/ z 0.16666666666666666)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.4e-35) {
tmp = 6.0 * (y * z);
} else if (z <= 1.35e-67) {
tmp = x;
} else {
tmp = y * (z / 0.16666666666666666);
}
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 <= (-3.4d-35)) then
tmp = 6.0d0 * (y * z)
else if (z <= 1.35d-67) then
tmp = x
else
tmp = y * (z / 0.16666666666666666d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.4e-35) {
tmp = 6.0 * (y * z);
} else if (z <= 1.35e-67) {
tmp = x;
} else {
tmp = y * (z / 0.16666666666666666);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.4e-35: tmp = 6.0 * (y * z) elif z <= 1.35e-67: tmp = x else: tmp = y * (z / 0.16666666666666666) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.4e-35) tmp = Float64(6.0 * Float64(y * z)); elseif (z <= 1.35e-67) tmp = x; else tmp = Float64(y * Float64(z / 0.16666666666666666)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.4e-35) tmp = 6.0 * (y * z); elseif (z <= 1.35e-67) tmp = x; else tmp = y * (z / 0.16666666666666666); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.4e-35], N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e-67], x, N[(y * N[(z / 0.16666666666666666), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{-35}:\\
\;\;\;\;6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-67}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{0.16666666666666666}\\
\end{array}
\end{array}
if z < -3.4000000000000003e-35Initial program 99.8%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6496.0%
Simplified96.0%
Taylor expanded in y around inf
Simplified50.2%
if -3.4000000000000003e-35 < z < 1.35000000000000008e-67Initial program 99.9%
Taylor expanded in z around 0
Simplified79.0%
if 1.35000000000000008e-67 < z Initial program 99.8%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6491.2%
Simplified91.2%
Taylor expanded in y around inf
Simplified53.1%
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
associate-/r/N/A
clear-numN/A
associate-*l/N/A
div-invN/A
times-fracN/A
remove-double-divN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
metadata-eval53.1%
Applied egg-rr53.1%
Final simplification64.0%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* 6.0 (* y z)))) (if (<= z -1.75e-34) t_0 (if (<= z 1.9e-67) x t_0))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (y * z);
double tmp;
if (z <= -1.75e-34) {
tmp = t_0;
} else if (z <= 1.9e-67) {
tmp = x;
} 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 = 6.0d0 * (y * z)
if (z <= (-1.75d-34)) then
tmp = t_0
else if (z <= 1.9d-67) then
tmp = x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (y * z);
double tmp;
if (z <= -1.75e-34) {
tmp = t_0;
} else if (z <= 1.9e-67) {
tmp = x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (y * z) tmp = 0 if z <= -1.75e-34: tmp = t_0 elif z <= 1.9e-67: tmp = x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(y * z)) tmp = 0.0 if (z <= -1.75e-34) tmp = t_0; elseif (z <= 1.9e-67) tmp = x; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (y * z); tmp = 0.0; if (z <= -1.75e-34) tmp = t_0; elseif (z <= 1.9e-67) tmp = x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e-34], t$95$0, If[LessEqual[z, 1.9e-67], x, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{-34}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-67}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.75e-34 or 1.89999999999999994e-67 < z Initial program 99.8%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6494.0%
Simplified94.0%
Taylor expanded in y around inf
Simplified51.4%
if -1.75e-34 < z < 1.89999999999999994e-67Initial program 99.9%
Taylor expanded in z around 0
Simplified79.0%
Final simplification64.0%
(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 z around 0
Simplified40.1%
(FPCore (x y z) :precision binary64 (- x (* (* 6.0 z) (- x y))))
double code(double x, double y, double z) {
return x - ((6.0 * z) * (x - 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 - ((6.0d0 * z) * (x - y))
end function
public static double code(double x, double y, double z) {
return x - ((6.0 * z) * (x - y));
}
def code(x, y, z): return x - ((6.0 * z) * (x - y))
function code(x, y, z) return Float64(x - Float64(Float64(6.0 * z) * Float64(x - y))) end
function tmp = code(x, y, z) tmp = x - ((6.0 * z) * (x - y)); end
code[x_, y_, z_] := N[(x - N[(N[(6.0 * z), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \left(6 \cdot z\right) \cdot \left(x - y\right)
\end{array}
herbie shell --seed 2024140
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, E"
:precision binary64
:alt
(! :herbie-platform default (- x (* (* 6 z) (- x y))))
(+ x (* (* (- y x) 6.0) z)))