
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
(FPCore (x y z t) :precision binary64 (fma (- y z) (- t x) x))
double code(double x, double y, double z, double t) {
return fma((y - z), (t - x), x);
}
function code(x, y, z, t) return fma(Float64(y - z), Float64(t - x), x) end
code[x_, y_, z_, t_] := N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - z, t - x, x\right)
\end{array}
Initial program 100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (- z))))
(if (<= y -1e+255)
(* y t)
(if (<= y -1.0)
(* y (- x))
(if (<= y -2.4e-146)
x
(if (<= y -1.12e-237)
t_1
(if (<= y -3.5e-280)
x
(if (<= y 2.5e-264) t_1 (if (<= y 4.8e-27) x (* y t))))))))))
double code(double x, double y, double z, double t) {
double t_1 = t * -z;
double tmp;
if (y <= -1e+255) {
tmp = y * t;
} else if (y <= -1.0) {
tmp = y * -x;
} else if (y <= -2.4e-146) {
tmp = x;
} else if (y <= -1.12e-237) {
tmp = t_1;
} else if (y <= -3.5e-280) {
tmp = x;
} else if (y <= 2.5e-264) {
tmp = t_1;
} else if (y <= 4.8e-27) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = t * -z
if (y <= (-1d+255)) then
tmp = y * t
else if (y <= (-1.0d0)) then
tmp = y * -x
else if (y <= (-2.4d-146)) then
tmp = x
else if (y <= (-1.12d-237)) then
tmp = t_1
else if (y <= (-3.5d-280)) then
tmp = x
else if (y <= 2.5d-264) then
tmp = t_1
else if (y <= 4.8d-27) then
tmp = x
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t * -z;
double tmp;
if (y <= -1e+255) {
tmp = y * t;
} else if (y <= -1.0) {
tmp = y * -x;
} else if (y <= -2.4e-146) {
tmp = x;
} else if (y <= -1.12e-237) {
tmp = t_1;
} else if (y <= -3.5e-280) {
tmp = x;
} else if (y <= 2.5e-264) {
tmp = t_1;
} else if (y <= 4.8e-27) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * -z tmp = 0 if y <= -1e+255: tmp = y * t elif y <= -1.0: tmp = y * -x elif y <= -2.4e-146: tmp = x elif y <= -1.12e-237: tmp = t_1 elif y <= -3.5e-280: tmp = x elif y <= 2.5e-264: tmp = t_1 elif y <= 4.8e-27: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(-z)) tmp = 0.0 if (y <= -1e+255) tmp = Float64(y * t); elseif (y <= -1.0) tmp = Float64(y * Float64(-x)); elseif (y <= -2.4e-146) tmp = x; elseif (y <= -1.12e-237) tmp = t_1; elseif (y <= -3.5e-280) tmp = x; elseif (y <= 2.5e-264) tmp = t_1; elseif (y <= 4.8e-27) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * -z; tmp = 0.0; if (y <= -1e+255) tmp = y * t; elseif (y <= -1.0) tmp = y * -x; elseif (y <= -2.4e-146) tmp = x; elseif (y <= -1.12e-237) tmp = t_1; elseif (y <= -3.5e-280) tmp = x; elseif (y <= 2.5e-264) tmp = t_1; elseif (y <= 4.8e-27) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * (-z)), $MachinePrecision]}, If[LessEqual[y, -1e+255], N[(y * t), $MachinePrecision], If[LessEqual[y, -1.0], N[(y * (-x)), $MachinePrecision], If[LessEqual[y, -2.4e-146], x, If[LessEqual[y, -1.12e-237], t$95$1, If[LessEqual[y, -3.5e-280], x, If[LessEqual[y, 2.5e-264], t$95$1, If[LessEqual[y, 4.8e-27], x, N[(y * t), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(-z\right)\\
\mathbf{if}\;y \leq -1 \cdot 10^{+255}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -1:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;y \leq -2.4 \cdot 10^{-146}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -1.12 \cdot 10^{-237}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{-280}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-264}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-27}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -9.99999999999999988e254 or 4.80000000000000004e-27 < y Initial program 99.9%
Taylor expanded in t around inf 55.8%
Taylor expanded in y around inf 48.4%
if -9.99999999999999988e254 < y < -1Initial program 100.0%
*-commutative100.0%
flip--71.7%
associate-*r/66.1%
Applied egg-rr66.1%
associate-/l*71.5%
difference-of-squares80.9%
associate-/r*99.5%
*-inverses99.5%
Simplified99.5%
Taylor expanded in y around inf 81.6%
Taylor expanded in x around inf 53.0%
+-commutative53.0%
distribute-rgt1-in53.0%
mul-1-neg53.0%
cancel-sign-sub-inv53.0%
Simplified53.0%
Taylor expanded in y around inf 53.0%
mul-1-neg53.0%
distribute-rgt-neg-out53.0%
Simplified53.0%
if -1 < y < -2.4000000000000002e-146 or -1.12000000000000002e-237 < y < -3.5000000000000001e-280 or 2.5e-264 < y < 4.80000000000000004e-27Initial program 100.0%
Taylor expanded in t around inf 76.4%
Taylor expanded in x around inf 44.5%
if -2.4000000000000002e-146 < y < -1.12000000000000002e-237 or -3.5000000000000001e-280 < y < 2.5e-264Initial program 100.0%
Taylor expanded in t around inf 78.4%
Taylor expanded in z around inf 59.4%
mul-1-neg59.4%
*-commutative59.4%
distribute-rgt-neg-in59.4%
Simplified59.4%
Final simplification49.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (- z))) (t_2 (* y (- t x))))
(if (<= y -2.4e-47)
t_2
(if (<= y -7.5e-147)
x
(if (<= y -9e-238)
t_1
(if (<= y -1.28e-279)
x
(if (<= y 7.4e-264) t_1 (if (<= y 6e-27) x t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = t * -z;
double t_2 = y * (t - x);
double tmp;
if (y <= -2.4e-47) {
tmp = t_2;
} else if (y <= -7.5e-147) {
tmp = x;
} else if (y <= -9e-238) {
tmp = t_1;
} else if (y <= -1.28e-279) {
tmp = x;
} else if (y <= 7.4e-264) {
tmp = t_1;
} else if (y <= 6e-27) {
tmp = x;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t * -z
t_2 = y * (t - x)
if (y <= (-2.4d-47)) then
tmp = t_2
else if (y <= (-7.5d-147)) then
tmp = x
else if (y <= (-9d-238)) then
tmp = t_1
else if (y <= (-1.28d-279)) then
tmp = x
else if (y <= 7.4d-264) then
tmp = t_1
else if (y <= 6d-27) then
tmp = x
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t * -z;
double t_2 = y * (t - x);
double tmp;
if (y <= -2.4e-47) {
tmp = t_2;
} else if (y <= -7.5e-147) {
tmp = x;
} else if (y <= -9e-238) {
tmp = t_1;
} else if (y <= -1.28e-279) {
tmp = x;
} else if (y <= 7.4e-264) {
tmp = t_1;
} else if (y <= 6e-27) {
tmp = x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * -z t_2 = y * (t - x) tmp = 0 if y <= -2.4e-47: tmp = t_2 elif y <= -7.5e-147: tmp = x elif y <= -9e-238: tmp = t_1 elif y <= -1.28e-279: tmp = x elif y <= 7.4e-264: tmp = t_1 elif y <= 6e-27: tmp = x else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(-z)) t_2 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -2.4e-47) tmp = t_2; elseif (y <= -7.5e-147) tmp = x; elseif (y <= -9e-238) tmp = t_1; elseif (y <= -1.28e-279) tmp = x; elseif (y <= 7.4e-264) tmp = t_1; elseif (y <= 6e-27) tmp = x; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * -z; t_2 = y * (t - x); tmp = 0.0; if (y <= -2.4e-47) tmp = t_2; elseif (y <= -7.5e-147) tmp = x; elseif (y <= -9e-238) tmp = t_1; elseif (y <= -1.28e-279) tmp = x; elseif (y <= 7.4e-264) tmp = t_1; elseif (y <= 6e-27) tmp = x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * (-z)), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.4e-47], t$95$2, If[LessEqual[y, -7.5e-147], x, If[LessEqual[y, -9e-238], t$95$1, If[LessEqual[y, -1.28e-279], x, If[LessEqual[y, 7.4e-264], t$95$1, If[LessEqual[y, 6e-27], x, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(-z\right)\\
t_2 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{-47}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -7.5 \cdot 10^{-147}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -9 \cdot 10^{-238}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.28 \cdot 10^{-279}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{-264}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-27}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -2.3999999999999999e-47 or 6.0000000000000002e-27 < y Initial program 99.9%
*-commutative99.9%
flip--70.1%
associate-*r/62.7%
Applied egg-rr62.7%
associate-/l*70.0%
difference-of-squares79.7%
associate-/r*99.7%
*-inverses99.7%
Simplified99.7%
Taylor expanded in y around inf 81.6%
+-commutative81.6%
div-sub76.9%
div-inv76.9%
remove-double-div77.0%
*-commutative77.0%
div-inv77.0%
remove-double-div77.1%
*-commutative77.1%
associate-+l-77.1%
*-commutative77.1%
add-sqr-sqrt33.7%
sqrt-unprod45.3%
sqr-neg45.3%
sqrt-unprod23.8%
add-sqr-sqrt42.5%
*-un-lft-identity42.5%
distribute-rgt-out--42.5%
add-sqr-sqrt23.8%
sqrt-unprod45.3%
sqr-neg45.3%
sqrt-unprod33.7%
add-sqr-sqrt77.1%
Applied egg-rr77.1%
Taylor expanded in y around inf 80.0%
if -2.3999999999999999e-47 < y < -7.50000000000000047e-147 or -8.99999999999999992e-238 < y < -1.28e-279 or 7.39999999999999991e-264 < y < 6.0000000000000002e-27Initial program 100.0%
Taylor expanded in t around inf 75.0%
Taylor expanded in x around inf 47.9%
if -7.50000000000000047e-147 < y < -8.99999999999999992e-238 or -1.28e-279 < y < 7.39999999999999991e-264Initial program 100.0%
Taylor expanded in t around inf 78.4%
Taylor expanded in z around inf 59.4%
mul-1-neg59.4%
*-commutative59.4%
distribute-rgt-neg-in59.4%
Simplified59.4%
Final simplification68.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (- z))) (t_2 (* y (- t x))) (t_3 (+ x (* y t))))
(if (<= y -1.4)
t_2
(if (<= y -1.76e-147)
t_3
(if (<= y -9.5e-238)
t_1
(if (<= y -3.35e-279)
x
(if (<= y 1.65e-264) t_1 (if (<= y 4200000000000.0) t_3 t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = t * -z;
double t_2 = y * (t - x);
double t_3 = x + (y * t);
double tmp;
if (y <= -1.4) {
tmp = t_2;
} else if (y <= -1.76e-147) {
tmp = t_3;
} else if (y <= -9.5e-238) {
tmp = t_1;
} else if (y <= -3.35e-279) {
tmp = x;
} else if (y <= 1.65e-264) {
tmp = t_1;
} else if (y <= 4200000000000.0) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = t * -z
t_2 = y * (t - x)
t_3 = x + (y * t)
if (y <= (-1.4d0)) then
tmp = t_2
else if (y <= (-1.76d-147)) then
tmp = t_3
else if (y <= (-9.5d-238)) then
tmp = t_1
else if (y <= (-3.35d-279)) then
tmp = x
else if (y <= 1.65d-264) then
tmp = t_1
else if (y <= 4200000000000.0d0) then
tmp = t_3
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t * -z;
double t_2 = y * (t - x);
double t_3 = x + (y * t);
double tmp;
if (y <= -1.4) {
tmp = t_2;
} else if (y <= -1.76e-147) {
tmp = t_3;
} else if (y <= -9.5e-238) {
tmp = t_1;
} else if (y <= -3.35e-279) {
tmp = x;
} else if (y <= 1.65e-264) {
tmp = t_1;
} else if (y <= 4200000000000.0) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * -z t_2 = y * (t - x) t_3 = x + (y * t) tmp = 0 if y <= -1.4: tmp = t_2 elif y <= -1.76e-147: tmp = t_3 elif y <= -9.5e-238: tmp = t_1 elif y <= -3.35e-279: tmp = x elif y <= 1.65e-264: tmp = t_1 elif y <= 4200000000000.0: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(-z)) t_2 = Float64(y * Float64(t - x)) t_3 = Float64(x + Float64(y * t)) tmp = 0.0 if (y <= -1.4) tmp = t_2; elseif (y <= -1.76e-147) tmp = t_3; elseif (y <= -9.5e-238) tmp = t_1; elseif (y <= -3.35e-279) tmp = x; elseif (y <= 1.65e-264) tmp = t_1; elseif (y <= 4200000000000.0) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * -z; t_2 = y * (t - x); t_3 = x + (y * t); tmp = 0.0; if (y <= -1.4) tmp = t_2; elseif (y <= -1.76e-147) tmp = t_3; elseif (y <= -9.5e-238) tmp = t_1; elseif (y <= -3.35e-279) tmp = x; elseif (y <= 1.65e-264) tmp = t_1; elseif (y <= 4200000000000.0) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * (-z)), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4], t$95$2, If[LessEqual[y, -1.76e-147], t$95$3, If[LessEqual[y, -9.5e-238], t$95$1, If[LessEqual[y, -3.35e-279], x, If[LessEqual[y, 1.65e-264], t$95$1, If[LessEqual[y, 4200000000000.0], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(-z\right)\\
t_2 := y \cdot \left(t - x\right)\\
t_3 := x + y \cdot t\\
\mathbf{if}\;y \leq -1.4:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.76 \cdot 10^{-147}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -9.5 \cdot 10^{-238}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3.35 \cdot 10^{-279}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-264}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4200000000000:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.3999999999999999 or 4.2e12 < y Initial program 99.9%
*-commutative99.9%
flip--67.2%
associate-*r/58.7%
Applied egg-rr58.7%
associate-/l*67.1%
difference-of-squares78.2%
associate-/r*99.7%
*-inverses99.7%
Simplified99.7%
Taylor expanded in y around inf 84.8%
+-commutative84.8%
div-sub79.4%
div-inv79.5%
remove-double-div79.5%
*-commutative79.5%
div-inv79.6%
remove-double-div79.7%
*-commutative79.7%
associate-+l-79.7%
*-commutative79.7%
add-sqr-sqrt35.4%
sqrt-unprod43.6%
sqr-neg43.6%
sqrt-unprod22.1%
add-sqr-sqrt40.3%
*-un-lft-identity40.3%
distribute-rgt-out--40.3%
add-sqr-sqrt22.1%
sqrt-unprod43.6%
sqr-neg43.6%
sqrt-unprod35.4%
add-sqr-sqrt79.7%
Applied egg-rr79.7%
Taylor expanded in y around inf 85.0%
if -1.3999999999999999 < y < -1.76000000000000014e-147 or 1.65000000000000006e-264 < y < 4.2e12Initial program 100.0%
Taylor expanded in t around inf 76.9%
Taylor expanded in z around 0 52.7%
if -1.76000000000000014e-147 < y < -9.50000000000000059e-238 or -3.35000000000000018e-279 < y < 1.65000000000000006e-264Initial program 100.0%
Taylor expanded in t around inf 78.4%
Taylor expanded in z around inf 59.4%
mul-1-neg59.4%
*-commutative59.4%
distribute-rgt-neg-in59.4%
Simplified59.4%
if -9.50000000000000059e-238 < y < -3.35000000000000018e-279Initial program 100.0%
Taylor expanded in t around inf 73.4%
Taylor expanded in x around inf 73.4%
Final simplification70.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (+ x (* (- y z) t))))
(if (<= y -225000000.0)
t_1
(if (<= y 5.4e-144)
t_2
(if (<= y 3.3e-96) (+ x (* z x)) (if (<= y 9e+34) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = x + ((y - z) * t);
double tmp;
if (y <= -225000000.0) {
tmp = t_1;
} else if (y <= 5.4e-144) {
tmp = t_2;
} else if (y <= 3.3e-96) {
tmp = x + (z * x);
} else if (y <= 9e+34) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y * (t - x)
t_2 = x + ((y - z) * t)
if (y <= (-225000000.0d0)) then
tmp = t_1
else if (y <= 5.4d-144) then
tmp = t_2
else if (y <= 3.3d-96) then
tmp = x + (z * x)
else if (y <= 9d+34) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = x + ((y - z) * t);
double tmp;
if (y <= -225000000.0) {
tmp = t_1;
} else if (y <= 5.4e-144) {
tmp = t_2;
} else if (y <= 3.3e-96) {
tmp = x + (z * x);
} else if (y <= 9e+34) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = x + ((y - z) * t) tmp = 0 if y <= -225000000.0: tmp = t_1 elif y <= 5.4e-144: tmp = t_2 elif y <= 3.3e-96: tmp = x + (z * x) elif y <= 9e+34: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) t_2 = Float64(x + Float64(Float64(y - z) * t)) tmp = 0.0 if (y <= -225000000.0) tmp = t_1; elseif (y <= 5.4e-144) tmp = t_2; elseif (y <= 3.3e-96) tmp = Float64(x + Float64(z * x)); elseif (y <= 9e+34) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); t_2 = x + ((y - z) * t); tmp = 0.0; if (y <= -225000000.0) tmp = t_1; elseif (y <= 5.4e-144) tmp = t_2; elseif (y <= 3.3e-96) tmp = x + (z * x); elseif (y <= 9e+34) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -225000000.0], t$95$1, If[LessEqual[y, 5.4e-144], t$95$2, If[LessEqual[y, 3.3e-96], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e+34], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := x + \left(y - z\right) \cdot t\\
\mathbf{if}\;y \leq -225000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-144}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{-96}:\\
\;\;\;\;x + z \cdot x\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+34}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -2.25e8 or 9.0000000000000001e34 < y Initial program 100.0%
*-commutative100.0%
flip--67.0%
associate-*r/58.9%
Applied egg-rr58.9%
associate-/l*66.8%
difference-of-squares78.3%
associate-/r*99.7%
*-inverses99.7%
Simplified99.7%
Taylor expanded in y around inf 86.6%
+-commutative86.6%
div-sub81.1%
div-inv81.1%
remove-double-div81.2%
*-commutative81.2%
div-inv81.3%
remove-double-div81.3%
*-commutative81.3%
associate-+l-81.3%
*-commutative81.3%
add-sqr-sqrt35.7%
sqrt-unprod44.1%
sqr-neg44.1%
sqrt-unprod22.8%
add-sqr-sqrt41.4%
*-un-lft-identity41.4%
distribute-rgt-out--41.4%
add-sqr-sqrt22.8%
sqrt-unprod44.1%
sqr-neg44.1%
sqrt-unprod35.7%
add-sqr-sqrt81.3%
Applied egg-rr81.3%
Taylor expanded in y around inf 86.8%
if -2.25e8 < y < 5.3999999999999995e-144 or 3.2999999999999999e-96 < y < 9.0000000000000001e34Initial program 100.0%
Taylor expanded in t around inf 78.2%
if 5.3999999999999995e-144 < y < 3.2999999999999999e-96Initial program 99.9%
Taylor expanded in y around 0 99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 89.0%
mul-1-neg89.0%
distribute-lft-neg-out89.0%
*-commutative89.0%
Simplified89.0%
Final simplification82.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* (- y z) t))) (t_2 (+ x (* y (- t x)))))
(if (<= y -9.2e-10)
t_2
(if (<= y 4.6e-144)
t_1
(if (<= y 1.55e-96) (+ x (* z x)) (if (<= y 9.5e+34) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x + ((y - z) * t);
double t_2 = x + (y * (t - x));
double tmp;
if (y <= -9.2e-10) {
tmp = t_2;
} else if (y <= 4.6e-144) {
tmp = t_1;
} else if (y <= 1.55e-96) {
tmp = x + (z * x);
} else if (y <= 9.5e+34) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + ((y - z) * t)
t_2 = x + (y * (t - x))
if (y <= (-9.2d-10)) then
tmp = t_2
else if (y <= 4.6d-144) then
tmp = t_1
else if (y <= 1.55d-96) then
tmp = x + (z * x)
else if (y <= 9.5d+34) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x + ((y - z) * t);
double t_2 = x + (y * (t - x));
double tmp;
if (y <= -9.2e-10) {
tmp = t_2;
} else if (y <= 4.6e-144) {
tmp = t_1;
} else if (y <= 1.55e-96) {
tmp = x + (z * x);
} else if (y <= 9.5e+34) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + ((y - z) * t) t_2 = x + (y * (t - x)) tmp = 0 if y <= -9.2e-10: tmp = t_2 elif y <= 4.6e-144: tmp = t_1 elif y <= 1.55e-96: tmp = x + (z * x) elif y <= 9.5e+34: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(y - z) * t)) t_2 = Float64(x + Float64(y * Float64(t - x))) tmp = 0.0 if (y <= -9.2e-10) tmp = t_2; elseif (y <= 4.6e-144) tmp = t_1; elseif (y <= 1.55e-96) tmp = Float64(x + Float64(z * x)); elseif (y <= 9.5e+34) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + ((y - z) * t); t_2 = x + (y * (t - x)); tmp = 0.0; if (y <= -9.2e-10) tmp = t_2; elseif (y <= 4.6e-144) tmp = t_1; elseif (y <= 1.55e-96) tmp = x + (z * x); elseif (y <= 9.5e+34) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9.2e-10], t$95$2, If[LessEqual[y, 4.6e-144], t$95$1, If[LessEqual[y, 1.55e-96], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e+34], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot t\\
t_2 := x + y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -9.2 \cdot 10^{-10}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{-144}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{-96}:\\
\;\;\;\;x + z \cdot x\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+34}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -9.20000000000000028e-10 or 9.4999999999999999e34 < y Initial program 100.0%
Taylor expanded in z around 0 86.5%
if -9.20000000000000028e-10 < y < 4.6e-144 or 1.55e-96 < y < 9.4999999999999999e34Initial program 100.0%
Taylor expanded in t around inf 78.6%
if 4.6e-144 < y < 1.55e-96Initial program 99.9%
Taylor expanded in y around 0 99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 89.0%
mul-1-neg89.0%
distribute-lft-neg-out89.0%
*-commutative89.0%
Simplified89.0%
Final simplification83.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))))
(if (<= y -2.9e-10)
t_1
(if (<= y 5.4e-144)
(- x (* z t))
(if (<= y 3.2e-27) (+ x (* z x)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -2.9e-10) {
tmp = t_1;
} else if (y <= 5.4e-144) {
tmp = x - (z * t);
} else if (y <= 3.2e-27) {
tmp = x + (z * x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = y * (t - x)
if (y <= (-2.9d-10)) then
tmp = t_1
else if (y <= 5.4d-144) then
tmp = x - (z * t)
else if (y <= 3.2d-27) then
tmp = x + (z * x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -2.9e-10) {
tmp = t_1;
} else if (y <= 5.4e-144) {
tmp = x - (z * t);
} else if (y <= 3.2e-27) {
tmp = x + (z * x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -2.9e-10: tmp = t_1 elif y <= 5.4e-144: tmp = x - (z * t) elif y <= 3.2e-27: tmp = x + (z * x) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -2.9e-10) tmp = t_1; elseif (y <= 5.4e-144) tmp = Float64(x - Float64(z * t)); elseif (y <= 3.2e-27) tmp = Float64(x + Float64(z * x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); tmp = 0.0; if (y <= -2.9e-10) tmp = t_1; elseif (y <= 5.4e-144) tmp = x - (z * t); elseif (y <= 3.2e-27) tmp = x + (z * x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.9e-10], t$95$1, If[LessEqual[y, 5.4e-144], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e-27], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -2.9 \cdot 10^{-10}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-144}:\\
\;\;\;\;x - z \cdot t\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-27}:\\
\;\;\;\;x + z \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -2.89999999999999981e-10 or 3.19999999999999991e-27 < y Initial program 99.9%
*-commutative99.9%
flip--69.5%
associate-*r/61.8%
Applied egg-rr61.8%
associate-/l*69.4%
difference-of-squares79.5%
associate-/r*99.7%
*-inverses99.7%
Simplified99.7%
Taylor expanded in y around inf 82.8%
+-commutative82.8%
div-sub77.9%
div-inv77.9%
remove-double-div78.0%
*-commutative78.0%
div-inv78.1%
remove-double-div78.1%
*-commutative78.1%
associate-+l-78.1%
*-commutative78.1%
add-sqr-sqrt35.1%
sqrt-unprod45.1%
sqr-neg45.1%
sqrt-unprod22.7%
add-sqr-sqrt42.1%
*-un-lft-identity42.1%
distribute-rgt-out--42.1%
add-sqr-sqrt22.7%
sqrt-unprod45.1%
sqr-neg45.1%
sqrt-unprod35.1%
add-sqr-sqrt78.1%
Applied egg-rr78.1%
Taylor expanded in y around inf 81.8%
if -2.89999999999999981e-10 < y < 5.3999999999999995e-144Initial program 100.0%
Taylor expanded in y around 0 95.2%
+-commutative95.2%
mul-1-neg95.2%
unsub-neg95.2%
*-commutative95.2%
Simplified95.2%
Taylor expanded in t around inf 76.3%
*-commutative76.3%
Simplified76.3%
if 5.3999999999999995e-144 < y < 3.19999999999999991e-27Initial program 99.9%
Taylor expanded in y around 0 90.3%
+-commutative90.3%
mul-1-neg90.3%
unsub-neg90.3%
*-commutative90.3%
Simplified90.3%
Taylor expanded in t around 0 74.8%
mul-1-neg74.8%
distribute-lft-neg-out74.8%
*-commutative74.8%
Simplified74.8%
Final simplification79.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.6e-43) (not (<= y 1.45e+34))) (+ x (* y (- t x))) (- x (* z (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.6e-43) || !(y <= 1.45e+34)) {
tmp = x + (y * (t - x));
} else {
tmp = x - (z * (t - x));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1.6d-43)) .or. (.not. (y <= 1.45d+34))) then
tmp = x + (y * (t - x))
else
tmp = x - (z * (t - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.6e-43) || !(y <= 1.45e+34)) {
tmp = x + (y * (t - x));
} else {
tmp = x - (z * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.6e-43) or not (y <= 1.45e+34): tmp = x + (y * (t - x)) else: tmp = x - (z * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.6e-43) || !(y <= 1.45e+34)) tmp = Float64(x + Float64(y * Float64(t - x))); else tmp = Float64(x - Float64(z * Float64(t - x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.6e-43) || ~((y <= 1.45e+34))) tmp = x + (y * (t - x)); else tmp = x - (z * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.6e-43], N[Not[LessEqual[y, 1.45e+34]], $MachinePrecision]], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{-43} \lor \neg \left(y \leq 1.45 \cdot 10^{+34}\right):\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \left(t - x\right)\\
\end{array}
\end{array}
if y < -1.59999999999999992e-43 or 1.4500000000000001e34 < y Initial program 100.0%
Taylor expanded in z around 0 85.7%
if -1.59999999999999992e-43 < y < 1.4500000000000001e34Initial program 100.0%
Taylor expanded in y around 0 92.0%
+-commutative92.0%
mul-1-neg92.0%
unsub-neg92.0%
*-commutative92.0%
Simplified92.0%
Final simplification88.6%
(FPCore (x y z t) :precision binary64 (if (<= y -8.7e+254) (* y t) (if (<= y -1.0) (* y (- x)) (if (<= y 4.4e-27) x (* y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.7e+254) {
tmp = y * t;
} else if (y <= -1.0) {
tmp = y * -x;
} else if (y <= 4.4e-27) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-8.7d+254)) then
tmp = y * t
else if (y <= (-1.0d0)) then
tmp = y * -x
else if (y <= 4.4d-27) then
tmp = x
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.7e+254) {
tmp = y * t;
} else if (y <= -1.0) {
tmp = y * -x;
} else if (y <= 4.4e-27) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8.7e+254: tmp = y * t elif y <= -1.0: tmp = y * -x elif y <= 4.4e-27: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8.7e+254) tmp = Float64(y * t); elseif (y <= -1.0) tmp = Float64(y * Float64(-x)); elseif (y <= 4.4e-27) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -8.7e+254) tmp = y * t; elseif (y <= -1.0) tmp = y * -x; elseif (y <= 4.4e-27) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8.7e+254], N[(y * t), $MachinePrecision], If[LessEqual[y, -1.0], N[(y * (-x)), $MachinePrecision], If[LessEqual[y, 4.4e-27], x, N[(y * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.7 \cdot 10^{+254}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -1:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-27}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -8.69999999999999984e254 or 4.39999999999999974e-27 < y Initial program 99.9%
Taylor expanded in t around inf 55.8%
Taylor expanded in y around inf 48.4%
if -8.69999999999999984e254 < y < -1Initial program 100.0%
*-commutative100.0%
flip--71.7%
associate-*r/66.1%
Applied egg-rr66.1%
associate-/l*71.5%
difference-of-squares80.9%
associate-/r*99.5%
*-inverses99.5%
Simplified99.5%
Taylor expanded in y around inf 81.6%
Taylor expanded in x around inf 53.0%
+-commutative53.0%
distribute-rgt1-in53.0%
mul-1-neg53.0%
cancel-sign-sub-inv53.0%
Simplified53.0%
Taylor expanded in y around inf 53.0%
mul-1-neg53.0%
distribute-rgt-neg-out53.0%
Simplified53.0%
if -1 < y < 4.39999999999999974e-27Initial program 100.0%
Taylor expanded in t around inf 76.9%
Taylor expanded in x around inf 38.3%
Final simplification45.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3e-10) (not (<= y 1.6e-27))) (* y (- t x)) (- x (* z t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3e-10) || !(y <= 1.6e-27)) {
tmp = y * (t - x);
} else {
tmp = x - (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-3d-10)) .or. (.not. (y <= 1.6d-27))) then
tmp = y * (t - x)
else
tmp = x - (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3e-10) || !(y <= 1.6e-27)) {
tmp = y * (t - x);
} else {
tmp = x - (z * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3e-10) or not (y <= 1.6e-27): tmp = y * (t - x) else: tmp = x - (z * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3e-10) || !(y <= 1.6e-27)) tmp = Float64(y * Float64(t - x)); else tmp = Float64(x - Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3e-10) || ~((y <= 1.6e-27))) tmp = y * (t - x); else tmp = x - (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3e-10], N[Not[LessEqual[y, 1.6e-27]], $MachinePrecision]], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{-10} \lor \neg \left(y \leq 1.6 \cdot 10^{-27}\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot t\\
\end{array}
\end{array}
if y < -3e-10 or 1.59999999999999995e-27 < y Initial program 99.9%
*-commutative99.9%
flip--69.5%
associate-*r/61.8%
Applied egg-rr61.8%
associate-/l*69.4%
difference-of-squares79.5%
associate-/r*99.7%
*-inverses99.7%
Simplified99.7%
Taylor expanded in y around inf 82.8%
+-commutative82.8%
div-sub77.9%
div-inv77.9%
remove-double-div78.0%
*-commutative78.0%
div-inv78.1%
remove-double-div78.1%
*-commutative78.1%
associate-+l-78.1%
*-commutative78.1%
add-sqr-sqrt35.1%
sqrt-unprod45.1%
sqr-neg45.1%
sqrt-unprod22.7%
add-sqr-sqrt42.1%
*-un-lft-identity42.1%
distribute-rgt-out--42.1%
add-sqr-sqrt22.7%
sqrt-unprod45.1%
sqr-neg45.1%
sqrt-unprod35.1%
add-sqr-sqrt78.1%
Applied egg-rr78.1%
Taylor expanded in y around inf 81.8%
if -3e-10 < y < 1.59999999999999995e-27Initial program 100.0%
Taylor expanded in y around 0 94.0%
+-commutative94.0%
mul-1-neg94.0%
unsub-neg94.0%
*-commutative94.0%
Simplified94.0%
Taylor expanded in t around inf 71.3%
*-commutative71.3%
Simplified71.3%
Final simplification77.2%
(FPCore (x y z t) :precision binary64 (- x (* (- y z) (- x t))))
double code(double x, double y, double z, double t) {
return x - ((y - z) * (x - t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x - ((y - z) * (x - t))
end function
public static double code(double x, double y, double z, double t) {
return x - ((y - z) * (x - t));
}
def code(x, y, z, t): return x - ((y - z) * (x - t))
function code(x, y, z, t) return Float64(x - Float64(Float64(y - z) * Float64(x - t))) end
function tmp = code(x, y, z, t) tmp = x - ((y - z) * (x - t)); end
code[x_, y_, z_, t_] := N[(x - N[(N[(y - z), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \left(y - z\right) \cdot \left(x - t\right)
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (if (<= y -4e-47) (* y t) (if (<= y 1.1e-27) x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4e-47) {
tmp = y * t;
} else if (y <= 1.1e-27) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-4d-47)) then
tmp = y * t
else if (y <= 1.1d-27) then
tmp = x
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4e-47) {
tmp = y * t;
} else if (y <= 1.1e-27) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4e-47: tmp = y * t elif y <= 1.1e-27: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4e-47) tmp = Float64(y * t); elseif (y <= 1.1e-27) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4e-47) tmp = y * t; elseif (y <= 1.1e-27) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4e-47], N[(y * t), $MachinePrecision], If[LessEqual[y, 1.1e-27], x, N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{-47}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-27}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -3.9999999999999999e-47 or 1.09999999999999993e-27 < y Initial program 99.9%
Taylor expanded in t around inf 49.9%
Taylor expanded in y around inf 41.3%
if -3.9999999999999999e-47 < y < 1.09999999999999993e-27Initial program 100.0%
Taylor expanded in t around inf 76.0%
Taylor expanded in x around inf 40.2%
Final simplification40.8%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 100.0%
Taylor expanded in t around inf 60.8%
Taylor expanded in x around inf 19.1%
Final simplification19.1%
(FPCore (x y z t) :precision binary64 (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((t * (y - z)) + (-x * (y - z)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
def code(x, y, z, t): return x + ((t * (y - z)) + (-x * (y - z)))
function code(x, y, z, t) return Float64(x + Float64(Float64(t * Float64(y - z)) + Float64(Float64(-x) * Float64(y - z)))) end
function tmp = code(x, y, z, t) tmp = x + ((t * (y - z)) + (-x * (y - z))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] + N[((-x) * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right)
\end{array}
herbie shell --seed 2023224
(FPCore (x y z t)
:name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
:precision binary64
:herbie-target
(+ x (+ (* t (- y z)) (* (- x) (- y z))))
(+ x (* (- y z) (- t x))))