
(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 15 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-define100.0%
Simplified100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))))
(if (<= z -1460.0)
t_1
(if (<= z -8.5e-301)
(+ x (* y t))
(if (<= z 1.4e-22)
(* x (- 1.0 y))
(if (<= z 2.3e+57) (* y (- t x)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -1460.0) {
tmp = t_1;
} else if (z <= -8.5e-301) {
tmp = x + (y * t);
} else if (z <= 1.4e-22) {
tmp = x * (1.0 - y);
} else if (z <= 2.3e+57) {
tmp = y * (t - 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 = z * (x - t)
if (z <= (-1460.0d0)) then
tmp = t_1
else if (z <= (-8.5d-301)) then
tmp = x + (y * t)
else if (z <= 1.4d-22) then
tmp = x * (1.0d0 - y)
else if (z <= 2.3d+57) then
tmp = y * (t - 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 = z * (x - t);
double tmp;
if (z <= -1460.0) {
tmp = t_1;
} else if (z <= -8.5e-301) {
tmp = x + (y * t);
} else if (z <= 1.4e-22) {
tmp = x * (1.0 - y);
} else if (z <= 2.3e+57) {
tmp = y * (t - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -1460.0: tmp = t_1 elif z <= -8.5e-301: tmp = x + (y * t) elif z <= 1.4e-22: tmp = x * (1.0 - y) elif z <= 2.3e+57: tmp = y * (t - x) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) tmp = 0.0 if (z <= -1460.0) tmp = t_1; elseif (z <= -8.5e-301) tmp = Float64(x + Float64(y * t)); elseif (z <= 1.4e-22) tmp = Float64(x * Float64(1.0 - y)); elseif (z <= 2.3e+57) tmp = Float64(y * Float64(t - x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); tmp = 0.0; if (z <= -1460.0) tmp = t_1; elseif (z <= -8.5e-301) tmp = x + (y * t); elseif (z <= 1.4e-22) tmp = x * (1.0 - y); elseif (z <= 2.3e+57) tmp = y * (t - x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1460.0], t$95$1, If[LessEqual[z, -8.5e-301], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-22], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e+57], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -1460:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-301}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-22}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+57}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1460 or 2.2999999999999999e57 < z Initial program 100.0%
Taylor expanded in z around -inf 98.2%
associate-*r*98.2%
neg-mul-198.2%
associate--l+98.2%
mul-1-neg98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in z around inf 82.6%
sub-neg82.6%
distribute-rgt-out77.3%
distribute-lft-neg-out77.3%
mul-1-neg77.3%
+-commutative77.3%
distribute-lft-in77.3%
neg-mul-177.3%
mul-1-neg77.3%
remove-double-neg77.3%
associate-*r*77.3%
distribute-rgt-in82.6%
mul-1-neg82.6%
sub-neg82.6%
Simplified82.6%
if -1460 < z < -8.50000000000000046e-301Initial program 100.0%
Taylor expanded in y around inf 91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in t around inf 74.0%
*-commutative74.0%
Simplified74.0%
if -8.50000000000000046e-301 < z < 1.39999999999999997e-22Initial program 100.0%
Taylor expanded in x around inf 69.4%
mul-1-neg69.4%
unsub-neg69.4%
Simplified69.4%
Taylor expanded in z around 0 69.4%
if 1.39999999999999997e-22 < z < 2.2999999999999999e57Initial program 100.0%
Taylor expanded in z around -inf 99.9%
associate-*r*99.9%
neg-mul-199.9%
associate--l+99.9%
mul-1-neg99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around -inf 88.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))))
(if (<= z -2.3e+126)
t_1
(if (<= z 6.6e+62)
(* x (- 1.0 y))
(if (or (<= z 7.1e+196) (not (<= z 3.7e+287))) t_1 (* z x))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (z <= -2.3e+126) {
tmp = t_1;
} else if (z <= 6.6e+62) {
tmp = x * (1.0 - y);
} else if ((z <= 7.1e+196) || !(z <= 3.7e+287)) {
tmp = t_1;
} else {
tmp = z * 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) :: t_1
real(8) :: tmp
t_1 = z * -t
if (z <= (-2.3d+126)) then
tmp = t_1
else if (z <= 6.6d+62) then
tmp = x * (1.0d0 - y)
else if ((z <= 7.1d+196) .or. (.not. (z <= 3.7d+287))) then
tmp = t_1
else
tmp = z * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (z <= -2.3e+126) {
tmp = t_1;
} else if (z <= 6.6e+62) {
tmp = x * (1.0 - y);
} else if ((z <= 7.1e+196) || !(z <= 3.7e+287)) {
tmp = t_1;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t tmp = 0 if z <= -2.3e+126: tmp = t_1 elif z <= 6.6e+62: tmp = x * (1.0 - y) elif (z <= 7.1e+196) or not (z <= 3.7e+287): tmp = t_1 else: tmp = z * x return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) tmp = 0.0 if (z <= -2.3e+126) tmp = t_1; elseif (z <= 6.6e+62) tmp = Float64(x * Float64(1.0 - y)); elseif ((z <= 7.1e+196) || !(z <= 3.7e+287)) tmp = t_1; else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; tmp = 0.0; if (z <= -2.3e+126) tmp = t_1; elseif (z <= 6.6e+62) tmp = x * (1.0 - y); elseif ((z <= 7.1e+196) || ~((z <= 3.7e+287))) tmp = t_1; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[z, -2.3e+126], t$95$1, If[LessEqual[z, 6.6e+62], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 7.1e+196], N[Not[LessEqual[z, 3.7e+287]], $MachinePrecision]], t$95$1, N[(z * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{+126}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{+62}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{elif}\;z \leq 7.1 \cdot 10^{+196} \lor \neg \left(z \leq 3.7 \cdot 10^{+287}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -2.3000000000000001e126 or 6.6e62 < z < 7.10000000000000032e196 or 3.69999999999999997e287 < z Initial program 100.0%
Taylor expanded in y around 0 89.8%
mul-1-neg89.8%
unsub-neg89.8%
Simplified89.8%
Taylor expanded in z around inf 89.8%
Taylor expanded in x around 0 60.6%
neg-mul-160.6%
Simplified60.6%
if -2.3000000000000001e126 < z < 6.6e62Initial program 100.0%
Taylor expanded in x around inf 61.6%
mul-1-neg61.6%
unsub-neg61.6%
Simplified61.6%
Taylor expanded in z around 0 57.2%
if 7.10000000000000032e196 < z < 3.69999999999999997e287Initial program 100.0%
Taylor expanded in x around inf 70.5%
mul-1-neg70.5%
unsub-neg70.5%
Simplified70.5%
Taylor expanded in z around inf 65.3%
Final simplification58.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -34000.0)
(* x (- y))
(if (<= y -3.4e-56)
(* z x)
(if (<= y -2.5e-256) x (if (<= y 7.6e+55) (* z (- t)) (* y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -34000.0) {
tmp = x * -y;
} else if (y <= -3.4e-56) {
tmp = z * x;
} else if (y <= -2.5e-256) {
tmp = x;
} else if (y <= 7.6e+55) {
tmp = z * -t;
} 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 <= (-34000.0d0)) then
tmp = x * -y
else if (y <= (-3.4d-56)) then
tmp = z * x
else if (y <= (-2.5d-256)) then
tmp = x
else if (y <= 7.6d+55) then
tmp = z * -t
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 <= -34000.0) {
tmp = x * -y;
} else if (y <= -3.4e-56) {
tmp = z * x;
} else if (y <= -2.5e-256) {
tmp = x;
} else if (y <= 7.6e+55) {
tmp = z * -t;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -34000.0: tmp = x * -y elif y <= -3.4e-56: tmp = z * x elif y <= -2.5e-256: tmp = x elif y <= 7.6e+55: tmp = z * -t else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -34000.0) tmp = Float64(x * Float64(-y)); elseif (y <= -3.4e-56) tmp = Float64(z * x); elseif (y <= -2.5e-256) tmp = x; elseif (y <= 7.6e+55) tmp = Float64(z * Float64(-t)); else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -34000.0) tmp = x * -y; elseif (y <= -3.4e-56) tmp = z * x; elseif (y <= -2.5e-256) tmp = x; elseif (y <= 7.6e+55) tmp = z * -t; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -34000.0], N[(x * (-y)), $MachinePrecision], If[LessEqual[y, -3.4e-56], N[(z * x), $MachinePrecision], If[LessEqual[y, -2.5e-256], x, If[LessEqual[y, 7.6e+55], N[(z * (-t)), $MachinePrecision], N[(y * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -34000:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;y \leq -3.4 \cdot 10^{-56}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-256}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{+55}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -34000Initial program 100.0%
Taylor expanded in x around inf 64.3%
mul-1-neg64.3%
unsub-neg64.3%
Simplified64.3%
Taylor expanded in y around inf 49.1%
neg-mul-149.1%
Simplified49.1%
if -34000 < y < -3.39999999999999982e-56Initial program 100.0%
Taylor expanded in x around inf 51.4%
mul-1-neg51.4%
unsub-neg51.4%
Simplified51.4%
Taylor expanded in z around inf 51.2%
if -3.39999999999999982e-56 < y < -2.5e-256Initial program 100.0%
Taylor expanded in y around inf 58.6%
*-commutative58.6%
Simplified58.6%
Taylor expanded in y around 0 49.4%
if -2.5e-256 < y < 7.5999999999999999e55Initial program 100.0%
Taylor expanded in y around 0 94.5%
mul-1-neg94.5%
unsub-neg94.5%
Simplified94.5%
Taylor expanded in z around inf 83.6%
Taylor expanded in x around 0 43.8%
neg-mul-143.8%
Simplified43.8%
if 7.5999999999999999e55 < y Initial program 100.0%
Taylor expanded in z around -inf 83.2%
associate-*r*83.2%
neg-mul-183.2%
associate--l+83.2%
mul-1-neg83.2%
*-commutative83.2%
Simplified83.2%
Taylor expanded in y around -inf 90.1%
Taylor expanded in t around inf 54.9%
*-commutative54.9%
Simplified54.9%
Final simplification48.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))))
(if (<= y -62.0)
t_1
(if (<= y -3.5e-52)
(* z (- x t))
(if (<= y 8.5e+49) (- x (* z t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -62.0) {
tmp = t_1;
} else if (y <= -3.5e-52) {
tmp = z * (x - t);
} else if (y <= 8.5e+49) {
tmp = x - (z * t);
} 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 <= (-62.0d0)) then
tmp = t_1
else if (y <= (-3.5d-52)) then
tmp = z * (x - t)
else if (y <= 8.5d+49) then
tmp = x - (z * t)
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 <= -62.0) {
tmp = t_1;
} else if (y <= -3.5e-52) {
tmp = z * (x - t);
} else if (y <= 8.5e+49) {
tmp = x - (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -62.0: tmp = t_1 elif y <= -3.5e-52: tmp = z * (x - t) elif y <= 8.5e+49: tmp = x - (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -62.0) tmp = t_1; elseif (y <= -3.5e-52) tmp = Float64(z * Float64(x - t)); elseif (y <= 8.5e+49) tmp = Float64(x - Float64(z * t)); 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 <= -62.0) tmp = t_1; elseif (y <= -3.5e-52) tmp = z * (x - t); elseif (y <= 8.5e+49) tmp = x - (z * t); 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, -62.0], t$95$1, If[LessEqual[y, -3.5e-52], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e+49], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -62:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{-52}:\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+49}:\\
\;\;\;\;x - z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -62 or 8.4999999999999996e49 < y Initial program 100.0%
Taylor expanded in z around -inf 84.6%
associate-*r*84.6%
neg-mul-184.6%
associate--l+84.6%
mul-1-neg84.6%
*-commutative84.6%
Simplified84.6%
Taylor expanded in y around -inf 85.9%
if -62 < y < -3.5e-52Initial program 100.0%
Taylor expanded in z around -inf 100.0%
associate-*r*100.0%
neg-mul-1100.0%
associate--l+100.0%
mul-1-neg100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 87.9%
sub-neg87.9%
distribute-rgt-out87.9%
distribute-lft-neg-out87.9%
mul-1-neg87.9%
+-commutative87.9%
distribute-lft-in87.9%
neg-mul-187.9%
mul-1-neg87.9%
remove-double-neg87.9%
associate-*r*87.9%
distribute-rgt-in87.9%
mul-1-neg87.9%
sub-neg87.9%
Simplified87.9%
if -3.5e-52 < y < 8.4999999999999996e49Initial program 100.0%
Taylor expanded in y around 0 92.8%
mul-1-neg92.8%
unsub-neg92.8%
Simplified92.8%
Taylor expanded in t around inf 73.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))))
(if (<= y -0.72)
t_1
(if (<= y -5.9e-264)
(* x (+ z 1.0))
(if (<= y 9e+49) (* z (- x t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -0.72) {
tmp = t_1;
} else if (y <= -5.9e-264) {
tmp = x * (z + 1.0);
} else if (y <= 9e+49) {
tmp = z * (x - t);
} 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 <= (-0.72d0)) then
tmp = t_1
else if (y <= (-5.9d-264)) then
tmp = x * (z + 1.0d0)
else if (y <= 9d+49) then
tmp = z * (x - t)
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 <= -0.72) {
tmp = t_1;
} else if (y <= -5.9e-264) {
tmp = x * (z + 1.0);
} else if (y <= 9e+49) {
tmp = z * (x - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -0.72: tmp = t_1 elif y <= -5.9e-264: tmp = x * (z + 1.0) elif y <= 9e+49: tmp = z * (x - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -0.72) tmp = t_1; elseif (y <= -5.9e-264) tmp = Float64(x * Float64(z + 1.0)); elseif (y <= 9e+49) tmp = Float64(z * Float64(x - t)); 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 <= -0.72) tmp = t_1; elseif (y <= -5.9e-264) tmp = x * (z + 1.0); elseif (y <= 9e+49) tmp = z * (x - t); 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, -0.72], t$95$1, If[LessEqual[y, -5.9e-264], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e+49], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -0.72:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -5.9 \cdot 10^{-264}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+49}:\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -0.71999999999999997 or 8.99999999999999965e49 < y Initial program 100.0%
Taylor expanded in z around -inf 84.6%
associate-*r*84.6%
neg-mul-184.6%
associate--l+84.6%
mul-1-neg84.6%
*-commutative84.6%
Simplified84.6%
Taylor expanded in y around -inf 85.9%
if -0.71999999999999997 < y < -5.8999999999999999e-264Initial program 100.0%
Taylor expanded in x around inf 64.5%
mul-1-neg64.5%
unsub-neg64.5%
Simplified64.5%
Taylor expanded in y around 0 64.5%
+-commutative64.5%
Simplified64.5%
if -5.8999999999999999e-264 < y < 8.99999999999999965e49Initial program 100.0%
Taylor expanded in z around -inf 89.1%
associate-*r*89.1%
neg-mul-189.1%
associate--l+89.1%
mul-1-neg89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in z around inf 64.4%
sub-neg64.4%
distribute-rgt-out58.6%
distribute-lft-neg-out58.6%
mul-1-neg58.6%
+-commutative58.6%
distribute-lft-in58.6%
neg-mul-158.6%
mul-1-neg58.6%
remove-double-neg58.6%
associate-*r*58.6%
distribute-rgt-in64.4%
mul-1-neg64.4%
sub-neg64.4%
Simplified64.4%
(FPCore (x y z t) :precision binary64 (if (<= y -86000.0) (* y (- x)) (if (<= y -1.35e-52) (* z x) (if (<= y 3.6e+15) x (* y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -86000.0) {
tmp = y * -x;
} else if (y <= -1.35e-52) {
tmp = z * x;
} else if (y <= 3.6e+15) {
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 <= (-86000.0d0)) then
tmp = y * -x
else if (y <= (-1.35d-52)) then
tmp = z * x
else if (y <= 3.6d+15) 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 <= -86000.0) {
tmp = y * -x;
} else if (y <= -1.35e-52) {
tmp = z * x;
} else if (y <= 3.6e+15) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -86000.0: tmp = y * -x elif y <= -1.35e-52: tmp = z * x elif y <= 3.6e+15: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -86000.0) tmp = Float64(y * Float64(-x)); elseif (y <= -1.35e-52) tmp = Float64(z * x); elseif (y <= 3.6e+15) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -86000.0) tmp = y * -x; elseif (y <= -1.35e-52) tmp = z * x; elseif (y <= 3.6e+15) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -86000.0], N[(y * (-x)), $MachinePrecision], If[LessEqual[y, -1.35e-52], N[(z * x), $MachinePrecision], If[LessEqual[y, 3.6e+15], x, N[(y * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -86000:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{-52}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+15}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -86000Initial program 100.0%
Taylor expanded in x around inf 64.3%
mul-1-neg64.3%
unsub-neg64.3%
Simplified64.3%
Taylor expanded in y around inf 49.1%
neg-mul-149.1%
Simplified49.1%
if -86000 < y < -1.35000000000000005e-52Initial program 100.0%
Taylor expanded in x around inf 51.4%
mul-1-neg51.4%
unsub-neg51.4%
Simplified51.4%
Taylor expanded in z around inf 51.2%
if -1.35000000000000005e-52 < y < 3.6e15Initial program 100.0%
Taylor expanded in y around inf 45.9%
*-commutative45.9%
Simplified45.9%
Taylor expanded in y around 0 40.3%
if 3.6e15 < y Initial program 100.0%
Taylor expanded in z around -inf 85.1%
associate-*r*85.1%
neg-mul-185.1%
associate--l+85.1%
mul-1-neg85.1%
*-commutative85.1%
Simplified85.1%
Taylor expanded in y around -inf 82.3%
Taylor expanded in t around inf 50.9%
*-commutative50.9%
Simplified50.9%
Final simplification45.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.1e+36) (not (<= z 2.2e+57))) (* z (- x t)) (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.1e+36) || !(z <= 2.2e+57)) {
tmp = z * (x - t);
} else {
tmp = x + (y * (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 ((z <= (-5.1d+36)) .or. (.not. (z <= 2.2d+57))) then
tmp = z * (x - t)
else
tmp = x + (y * (t - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.1e+36) || !(z <= 2.2e+57)) {
tmp = z * (x - t);
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.1e+36) or not (z <= 2.2e+57): tmp = z * (x - t) else: tmp = x + (y * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.1e+36) || !(z <= 2.2e+57)) tmp = Float64(z * Float64(x - t)); else tmp = Float64(x + Float64(y * Float64(t - x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5.1e+36) || ~((z <= 2.2e+57))) tmp = z * (x - t); else tmp = x + (y * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.1e+36], N[Not[LessEqual[z, 2.2e+57]], $MachinePrecision]], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.1 \cdot 10^{+36} \lor \neg \left(z \leq 2.2 \cdot 10^{+57}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -5.09999999999999973e36 or 2.2000000000000001e57 < z Initial program 100.0%
Taylor expanded in z around -inf 98.1%
associate-*r*98.1%
neg-mul-198.1%
associate--l+98.1%
mul-1-neg98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in z around inf 84.4%
sub-neg84.4%
distribute-rgt-out78.8%
distribute-lft-neg-out78.8%
mul-1-neg78.8%
+-commutative78.8%
distribute-lft-in78.8%
neg-mul-178.8%
mul-1-neg78.8%
remove-double-neg78.8%
associate-*r*78.8%
distribute-rgt-in84.4%
mul-1-neg84.4%
sub-neg84.4%
Simplified84.4%
if -5.09999999999999973e36 < z < 2.2000000000000001e57Initial program 100.0%
Taylor expanded in y around inf 89.4%
*-commutative89.4%
Simplified89.4%
Final simplification87.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* y (- t x)))) (if (<= y -1.8) (+ x t_1) (if (<= y 6e+52) (+ x (* z (- x t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -1.8) {
tmp = x + t_1;
} else if (y <= 6e+52) {
tmp = x + (z * (x - t));
} 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 <= (-1.8d0)) then
tmp = x + t_1
else if (y <= 6d+52) then
tmp = x + (z * (x - t))
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 <= -1.8) {
tmp = x + t_1;
} else if (y <= 6e+52) {
tmp = x + (z * (x - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -1.8: tmp = x + t_1 elif y <= 6e+52: tmp = x + (z * (x - t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -1.8) tmp = Float64(x + t_1); elseif (y <= 6e+52) tmp = Float64(x + Float64(z * Float64(x - t))); 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 <= -1.8) tmp = x + t_1; elseif (y <= 6e+52) tmp = x + (z * (x - t)); 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, -1.8], N[(x + t$95$1), $MachinePrecision], If[LessEqual[y, 6e+52], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -1.8:\\
\;\;\;\;x + t\_1\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+52}:\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.80000000000000004Initial program 100.0%
Taylor expanded in y around inf 83.1%
*-commutative83.1%
Simplified83.1%
if -1.80000000000000004 < y < 6e52Initial program 100.0%
Taylor expanded in y around 0 92.5%
mul-1-neg92.5%
unsub-neg92.5%
Simplified92.5%
if 6e52 < y Initial program 100.0%
Taylor expanded in z around -inf 83.2%
associate-*r*83.2%
neg-mul-183.2%
associate--l+83.2%
mul-1-neg83.2%
*-commutative83.2%
Simplified83.2%
Taylor expanded in y around -inf 90.1%
Final simplification89.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -7.8) (not (<= y 6e+16))) (* y (- t x)) (* x (+ z 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.8) || !(y <= 6e+16)) {
tmp = y * (t - x);
} else {
tmp = x * (z + 1.0);
}
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 <= (-7.8d0)) .or. (.not. (y <= 6d+16))) then
tmp = y * (t - x)
else
tmp = x * (z + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.8) || !(y <= 6e+16)) {
tmp = y * (t - x);
} else {
tmp = x * (z + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -7.8) or not (y <= 6e+16): tmp = y * (t - x) else: tmp = x * (z + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -7.8) || !(y <= 6e+16)) tmp = Float64(y * Float64(t - x)); else tmp = Float64(x * Float64(z + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -7.8) || ~((y <= 6e+16))) tmp = y * (t - x); else tmp = x * (z + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -7.8], N[Not[LessEqual[y, 6e+16]], $MachinePrecision]], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \lor \neg \left(y \leq 6 \cdot 10^{+16}\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\end{array}
\end{array}
if y < -7.79999999999999982 or 6e16 < y Initial program 100.0%
Taylor expanded in z around -inf 85.3%
associate-*r*85.3%
neg-mul-185.3%
associate--l+85.3%
mul-1-neg85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in y around -inf 82.9%
if -7.79999999999999982 < y < 6e16Initial program 100.0%
Taylor expanded in x around inf 59.0%
mul-1-neg59.0%
unsub-neg59.0%
Simplified59.0%
Taylor expanded in y around 0 59.0%
+-commutative59.0%
Simplified59.0%
Final simplification70.9%
(FPCore (x y z t) :precision binary64 (if (<= y -90000.0) (* y (- x)) (if (<= y 1.1e+68) (* x (+ z 1.0)) (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -90000.0) {
tmp = y * -x;
} else if (y <= 1.1e+68) {
tmp = x * (z + 1.0);
} 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 <= (-90000.0d0)) then
tmp = y * -x
else if (y <= 1.1d+68) then
tmp = x * (z + 1.0d0)
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 <= -90000.0) {
tmp = y * -x;
} else if (y <= 1.1e+68) {
tmp = x * (z + 1.0);
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -90000.0: tmp = y * -x elif y <= 1.1e+68: tmp = x * (z + 1.0) else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -90000.0) tmp = Float64(y * Float64(-x)); elseif (y <= 1.1e+68) tmp = Float64(x * Float64(z + 1.0)); else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -90000.0) tmp = y * -x; elseif (y <= 1.1e+68) tmp = x * (z + 1.0); else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -90000.0], N[(y * (-x)), $MachinePrecision], If[LessEqual[y, 1.1e+68], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -90000:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{+68}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -9e4Initial program 100.0%
Taylor expanded in x around inf 64.3%
mul-1-neg64.3%
unsub-neg64.3%
Simplified64.3%
Taylor expanded in y around inf 49.1%
neg-mul-149.1%
Simplified49.1%
if -9e4 < y < 1.09999999999999994e68Initial program 100.0%
Taylor expanded in x around inf 57.3%
mul-1-neg57.3%
unsub-neg57.3%
Simplified57.3%
Taylor expanded in y around 0 56.6%
+-commutative56.6%
Simplified56.6%
if 1.09999999999999994e68 < y Initial program 100.0%
Taylor expanded in z around -inf 81.9%
associate-*r*81.9%
neg-mul-181.9%
associate--l+81.9%
mul-1-neg81.9%
*-commutative81.9%
Simplified81.9%
Taylor expanded in y around -inf 92.7%
Taylor expanded in t around inf 56.9%
*-commutative56.9%
Simplified56.9%
Final simplification54.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.05e-52) (not (<= y 3.6e+15))) (* y t) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.05e-52) || !(y <= 3.6e+15)) {
tmp = y * t;
} else {
tmp = 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.05d-52)) .or. (.not. (y <= 3.6d+15))) then
tmp = y * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.05e-52) || !(y <= 3.6e+15)) {
tmp = y * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.05e-52) or not (y <= 3.6e+15): tmp = y * t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.05e-52) || !(y <= 3.6e+15)) tmp = Float64(y * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.05e-52) || ~((y <= 3.6e+15))) tmp = y * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.05e-52], N[Not[LessEqual[y, 3.6e+15]], $MachinePrecision]], N[(y * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{-52} \lor \neg \left(y \leq 3.6 \cdot 10^{+15}\right):\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.0499999999999999e-52 or 3.6e15 < y Initial program 100.0%
Taylor expanded in z around -inf 86.4%
associate-*r*86.4%
neg-mul-186.4%
associate--l+86.4%
mul-1-neg86.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in y around -inf 77.9%
Taylor expanded in t around inf 43.2%
*-commutative43.2%
Simplified43.2%
if -1.0499999999999999e-52 < y < 3.6e15Initial program 100.0%
Taylor expanded in y around inf 45.9%
*-commutative45.9%
Simplified45.9%
Taylor expanded in y around 0 40.3%
Final simplification41.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.2e+45) (not (<= z 13000000.0))) (* z x) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.2e+45) || !(z <= 13000000.0)) {
tmp = z * x;
} else {
tmp = 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 ((z <= (-3.2d+45)) .or. (.not. (z <= 13000000.0d0))) then
tmp = z * x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.2e+45) || !(z <= 13000000.0)) {
tmp = z * x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.2e+45) or not (z <= 13000000.0): tmp = z * x else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.2e+45) || !(z <= 13000000.0)) tmp = Float64(z * x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.2e+45) || ~((z <= 13000000.0))) tmp = z * x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.2e+45], N[Not[LessEqual[z, 13000000.0]], $MachinePrecision]], N[(z * x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+45} \lor \neg \left(z \leq 13000000\right):\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.2000000000000003e45 or 1.3e7 < z Initial program 100.0%
Taylor expanded in x around inf 51.3%
mul-1-neg51.3%
unsub-neg51.3%
Simplified51.3%
Taylor expanded in z around inf 40.3%
if -3.2000000000000003e45 < z < 1.3e7Initial program 100.0%
Taylor expanded in y around inf 88.4%
*-commutative88.4%
Simplified88.4%
Taylor expanded in y around 0 33.6%
Final simplification36.5%
(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}
Initial program 100.0%
(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 y around inf 63.4%
*-commutative63.4%
Simplified63.4%
Taylor expanded in y around 0 20.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 2024181
(FPCore (x y z t)
:name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
:precision binary64
:alt
(! :herbie-platform default (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
(+ x (* (- y z) (- t x))))