
(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 16 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
(if (<= z -2.9e+68)
(* z x)
(if (<= z -3.6e-154)
(* y (- x))
(if (<= z -3.5e-274)
x
(if (<= z 3e+89) (* y t) (if (<= z 1.85e+161) (* z (- t)) (* z x)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.9e+68) {
tmp = z * x;
} else if (z <= -3.6e-154) {
tmp = y * -x;
} else if (z <= -3.5e-274) {
tmp = x;
} else if (z <= 3e+89) {
tmp = y * t;
} else if (z <= 1.85e+161) {
tmp = z * -t;
} 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) :: tmp
if (z <= (-2.9d+68)) then
tmp = z * x
else if (z <= (-3.6d-154)) then
tmp = y * -x
else if (z <= (-3.5d-274)) then
tmp = x
else if (z <= 3d+89) then
tmp = y * t
else if (z <= 1.85d+161) then
tmp = z * -t
else
tmp = z * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.9e+68) {
tmp = z * x;
} else if (z <= -3.6e-154) {
tmp = y * -x;
} else if (z <= -3.5e-274) {
tmp = x;
} else if (z <= 3e+89) {
tmp = y * t;
} else if (z <= 1.85e+161) {
tmp = z * -t;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.9e+68: tmp = z * x elif z <= -3.6e-154: tmp = y * -x elif z <= -3.5e-274: tmp = x elif z <= 3e+89: tmp = y * t elif z <= 1.85e+161: tmp = z * -t else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.9e+68) tmp = Float64(z * x); elseif (z <= -3.6e-154) tmp = Float64(y * Float64(-x)); elseif (z <= -3.5e-274) tmp = x; elseif (z <= 3e+89) tmp = Float64(y * t); elseif (z <= 1.85e+161) tmp = Float64(z * Float64(-t)); else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.9e+68) tmp = z * x; elseif (z <= -3.6e-154) tmp = y * -x; elseif (z <= -3.5e-274) tmp = x; elseif (z <= 3e+89) tmp = y * t; elseif (z <= 1.85e+161) tmp = z * -t; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.9e+68], N[(z * x), $MachinePrecision], If[LessEqual[z, -3.6e-154], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -3.5e-274], x, If[LessEqual[z, 3e+89], N[(y * t), $MachinePrecision], If[LessEqual[z, 1.85e+161], N[(z * (-t)), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+68}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-154}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-274}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+89}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+161}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -2.90000000000000011e68 or 1.8499999999999999e161 < z Initial program 100.0%
Taylor expanded in x around inf 60.6%
mul-1-neg60.6%
unsub-neg60.6%
Simplified60.6%
Taylor expanded in z around inf 56.1%
if -2.90000000000000011e68 < z < -3.6000000000000003e-154Initial program 99.9%
Taylor expanded in x around inf 57.9%
mul-1-neg57.9%
unsub-neg57.9%
Simplified57.9%
Taylor expanded in y around inf 34.6%
neg-mul-134.6%
Simplified34.6%
if -3.6000000000000003e-154 < z < -3.49999999999999982e-274Initial program 100.0%
Taylor expanded in y around inf 94.8%
*-commutative94.8%
Simplified94.8%
Taylor expanded in y around 0 53.0%
if -3.49999999999999982e-274 < z < 3.00000000000000013e89Initial program 99.9%
Taylor expanded in t around inf 92.1%
associate--l+92.1%
+-commutative92.1%
mul-1-neg92.1%
unsub-neg92.1%
div-sub93.3%
unsub-neg93.3%
mul-1-neg93.3%
mul-1-neg93.3%
*-rgt-identity93.3%
distribute-rgt-neg-in93.3%
mul-1-neg93.3%
distribute-lft-in93.3%
mul-1-neg93.3%
unsub-neg93.3%
Simplified93.3%
Taylor expanded in x around 0 51.4%
Taylor expanded in y around inf 41.9%
if 3.00000000000000013e89 < z < 1.8499999999999999e161Initial program 100.0%
Taylor expanded in t around inf 94.0%
associate--l+93.9%
+-commutative93.9%
mul-1-neg93.9%
unsub-neg93.9%
div-sub93.9%
unsub-neg93.9%
mul-1-neg93.9%
mul-1-neg93.9%
*-rgt-identity93.9%
distribute-rgt-neg-in93.9%
mul-1-neg93.9%
distribute-lft-in93.9%
mul-1-neg93.9%
unsub-neg93.9%
Simplified93.9%
Taylor expanded in x around 0 74.6%
Taylor expanded in y around 0 74.7%
neg-mul-174.7%
Simplified74.7%
Final simplification47.7%
(FPCore (x y z t)
:precision binary64
(if (<= z -4.5e+49)
(* z x)
(if (<= z -9e-59)
(* y t)
(if (<= z -6.2e-270)
x
(if (<= z 5.1e+89)
(* y t)
(if (<= z 1.95e+163) (* z (- t)) (* z x)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.5e+49) {
tmp = z * x;
} else if (z <= -9e-59) {
tmp = y * t;
} else if (z <= -6.2e-270) {
tmp = x;
} else if (z <= 5.1e+89) {
tmp = y * t;
} else if (z <= 1.95e+163) {
tmp = z * -t;
} 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) :: tmp
if (z <= (-4.5d+49)) then
tmp = z * x
else if (z <= (-9d-59)) then
tmp = y * t
else if (z <= (-6.2d-270)) then
tmp = x
else if (z <= 5.1d+89) then
tmp = y * t
else if (z <= 1.95d+163) then
tmp = z * -t
else
tmp = z * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.5e+49) {
tmp = z * x;
} else if (z <= -9e-59) {
tmp = y * t;
} else if (z <= -6.2e-270) {
tmp = x;
} else if (z <= 5.1e+89) {
tmp = y * t;
} else if (z <= 1.95e+163) {
tmp = z * -t;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.5e+49: tmp = z * x elif z <= -9e-59: tmp = y * t elif z <= -6.2e-270: tmp = x elif z <= 5.1e+89: tmp = y * t elif z <= 1.95e+163: tmp = z * -t else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.5e+49) tmp = Float64(z * x); elseif (z <= -9e-59) tmp = Float64(y * t); elseif (z <= -6.2e-270) tmp = x; elseif (z <= 5.1e+89) tmp = Float64(y * t); elseif (z <= 1.95e+163) tmp = Float64(z * Float64(-t)); else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.5e+49) tmp = z * x; elseif (z <= -9e-59) tmp = y * t; elseif (z <= -6.2e-270) tmp = x; elseif (z <= 5.1e+89) tmp = y * t; elseif (z <= 1.95e+163) tmp = z * -t; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.5e+49], N[(z * x), $MachinePrecision], If[LessEqual[z, -9e-59], N[(y * t), $MachinePrecision], If[LessEqual[z, -6.2e-270], x, If[LessEqual[z, 5.1e+89], N[(y * t), $MachinePrecision], If[LessEqual[z, 1.95e+163], N[(z * (-t)), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+49}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-59}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{-270}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{+89}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+163}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -4.49999999999999982e49 or 1.95000000000000012e163 < z Initial program 100.0%
Taylor expanded in x around inf 62.2%
mul-1-neg62.2%
unsub-neg62.2%
Simplified62.2%
Taylor expanded in z around inf 53.1%
if -4.49999999999999982e49 < z < -9.00000000000000023e-59 or -6.2e-270 < z < 5.10000000000000027e89Initial program 99.9%
Taylor expanded in t around inf 91.9%
associate--l+91.9%
+-commutative91.9%
mul-1-neg91.9%
unsub-neg91.9%
div-sub92.9%
unsub-neg92.9%
mul-1-neg92.9%
mul-1-neg92.9%
*-rgt-identity92.9%
distribute-rgt-neg-in92.9%
mul-1-neg92.9%
distribute-lft-in93.0%
mul-1-neg93.0%
unsub-neg93.0%
Simplified93.0%
Taylor expanded in x around 0 54.4%
Taylor expanded in y around inf 40.1%
if -9.00000000000000023e-59 < z < -6.2e-270Initial program 100.0%
Taylor expanded in y around inf 95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in y around 0 46.0%
if 5.10000000000000027e89 < z < 1.95000000000000012e163Initial program 100.0%
Taylor expanded in t around inf 94.0%
associate--l+93.9%
+-commutative93.9%
mul-1-neg93.9%
unsub-neg93.9%
div-sub93.9%
unsub-neg93.9%
mul-1-neg93.9%
mul-1-neg93.9%
*-rgt-identity93.9%
distribute-rgt-neg-in93.9%
mul-1-neg93.9%
distribute-lft-in93.9%
mul-1-neg93.9%
unsub-neg93.9%
Simplified93.9%
Taylor expanded in x around 0 74.6%
Taylor expanded in y around 0 74.7%
neg-mul-174.7%
Simplified74.7%
Final simplification47.4%
(FPCore (x y z t)
:precision binary64
(if (<= z -4.2e+49)
(* z x)
(if (<= z -8.5e-63)
(* y t)
(if (<= z -1e-272) x (if (<= z 5.6e+28) (* y t) (* z x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.2e+49) {
tmp = z * x;
} else if (z <= -8.5e-63) {
tmp = y * t;
} else if (z <= -1e-272) {
tmp = x;
} else if (z <= 5.6e+28) {
tmp = y * t;
} 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) :: tmp
if (z <= (-4.2d+49)) then
tmp = z * x
else if (z <= (-8.5d-63)) then
tmp = y * t
else if (z <= (-1d-272)) then
tmp = x
else if (z <= 5.6d+28) then
tmp = y * t
else
tmp = z * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.2e+49) {
tmp = z * x;
} else if (z <= -8.5e-63) {
tmp = y * t;
} else if (z <= -1e-272) {
tmp = x;
} else if (z <= 5.6e+28) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.2e+49: tmp = z * x elif z <= -8.5e-63: tmp = y * t elif z <= -1e-272: tmp = x elif z <= 5.6e+28: tmp = y * t else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.2e+49) tmp = Float64(z * x); elseif (z <= -8.5e-63) tmp = Float64(y * t); elseif (z <= -1e-272) tmp = x; elseif (z <= 5.6e+28) tmp = Float64(y * t); else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.2e+49) tmp = z * x; elseif (z <= -8.5e-63) tmp = y * t; elseif (z <= -1e-272) tmp = x; elseif (z <= 5.6e+28) tmp = y * t; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.2e+49], N[(z * x), $MachinePrecision], If[LessEqual[z, -8.5e-63], N[(y * t), $MachinePrecision], If[LessEqual[z, -1e-272], x, If[LessEqual[z, 5.6e+28], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+49}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-63}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-272}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+28}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -4.20000000000000022e49 or 5.6000000000000003e28 < z Initial program 100.0%
Taylor expanded in x around inf 56.3%
mul-1-neg56.3%
unsub-neg56.3%
Simplified56.3%
Taylor expanded in z around inf 46.9%
if -4.20000000000000022e49 < z < -8.49999999999999969e-63 or -9.9999999999999993e-273 < z < 5.6000000000000003e28Initial program 99.9%
Taylor expanded in t around inf 91.9%
associate--l+91.9%
+-commutative91.9%
mul-1-neg91.9%
unsub-neg91.9%
div-sub93.1%
unsub-neg93.1%
mul-1-neg93.1%
mul-1-neg93.1%
*-rgt-identity93.1%
distribute-rgt-neg-in93.1%
mul-1-neg93.1%
distribute-lft-in93.1%
mul-1-neg93.1%
unsub-neg93.1%
Simplified93.1%
Taylor expanded in x around 0 56.4%
Taylor expanded in y around inf 41.4%
if -8.49999999999999969e-63 < z < -9.9999999999999993e-273Initial program 100.0%
Taylor expanded in y around inf 95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in y around 0 46.0%
Final simplification44.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) t)))
(if (<= t -1.82e-7)
t_1
(if (<= t -1.3e-262)
(* x (+ z 1.0))
(if (<= t 8.5e+41) (- x (* y x)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if (t <= -1.82e-7) {
tmp = t_1;
} else if (t <= -1.3e-262) {
tmp = x * (z + 1.0);
} else if (t <= 8.5e+41) {
tmp = x - (y * 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 - z) * t
if (t <= (-1.82d-7)) then
tmp = t_1
else if (t <= (-1.3d-262)) then
tmp = x * (z + 1.0d0)
else if (t <= 8.5d+41) then
tmp = x - (y * 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 - z) * t;
double tmp;
if (t <= -1.82e-7) {
tmp = t_1;
} else if (t <= -1.3e-262) {
tmp = x * (z + 1.0);
} else if (t <= 8.5e+41) {
tmp = x - (y * x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t tmp = 0 if t <= -1.82e-7: tmp = t_1 elif t <= -1.3e-262: tmp = x * (z + 1.0) elif t <= 8.5e+41: tmp = x - (y * x) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * t) tmp = 0.0 if (t <= -1.82e-7) tmp = t_1; elseif (t <= -1.3e-262) tmp = Float64(x * Float64(z + 1.0)); elseif (t <= 8.5e+41) tmp = Float64(x - Float64(y * x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * t; tmp = 0.0; if (t <= -1.82e-7) tmp = t_1; elseif (t <= -1.3e-262) tmp = x * (z + 1.0); elseif (t <= 8.5e+41) tmp = x - (y * x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -1.82e-7], t$95$1, If[LessEqual[t, -1.3e-262], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e+41], N[(x - N[(y * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -1.82 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.3 \cdot 10^{-262}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{+41}:\\
\;\;\;\;x - y \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.81999999999999989e-7 or 8.49999999999999938e41 < t Initial program 100.0%
Taylor expanded in t around inf 97.6%
associate--l+97.6%
+-commutative97.6%
mul-1-neg97.6%
unsub-neg97.6%
div-sub97.6%
unsub-neg97.6%
mul-1-neg97.6%
mul-1-neg97.6%
*-rgt-identity97.6%
distribute-rgt-neg-in97.6%
mul-1-neg97.6%
distribute-lft-in97.6%
mul-1-neg97.6%
unsub-neg97.6%
Simplified97.6%
Taylor expanded in x around 0 79.4%
if -1.81999999999999989e-7 < t < -1.2999999999999999e-262Initial program 100.0%
Taylor expanded in x around inf 86.9%
mul-1-neg86.9%
unsub-neg86.9%
Simplified86.9%
Taylor expanded in y around 0 64.9%
+-commutative64.9%
Simplified64.9%
if -1.2999999999999999e-262 < t < 8.49999999999999938e41Initial program 100.0%
Taylor expanded in t around 0 80.4%
mul-1-neg80.4%
distribute-rgt-neg-in80.4%
sub-neg80.4%
+-commutative80.4%
distribute-neg-in80.4%
remove-double-neg80.4%
sub-neg80.4%
Simplified80.4%
Taylor expanded in z around 0 64.0%
mul-1-neg64.0%
*-commutative64.0%
unsub-neg64.0%
Simplified64.0%
Final simplification71.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) t)))
(if (<= t -4.8e-7)
t_1
(if (<= t -9e-257)
(* x (+ z 1.0))
(if (<= t 2.8e+41) (* x (- 1.0 y)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if (t <= -4.8e-7) {
tmp = t_1;
} else if (t <= -9e-257) {
tmp = x * (z + 1.0);
} else if (t <= 2.8e+41) {
tmp = x * (1.0 - y);
} 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 - z) * t
if (t <= (-4.8d-7)) then
tmp = t_1
else if (t <= (-9d-257)) then
tmp = x * (z + 1.0d0)
else if (t <= 2.8d+41) then
tmp = x * (1.0d0 - y)
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 - z) * t;
double tmp;
if (t <= -4.8e-7) {
tmp = t_1;
} else if (t <= -9e-257) {
tmp = x * (z + 1.0);
} else if (t <= 2.8e+41) {
tmp = x * (1.0 - y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t tmp = 0 if t <= -4.8e-7: tmp = t_1 elif t <= -9e-257: tmp = x * (z + 1.0) elif t <= 2.8e+41: tmp = x * (1.0 - y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * t) tmp = 0.0 if (t <= -4.8e-7) tmp = t_1; elseif (t <= -9e-257) tmp = Float64(x * Float64(z + 1.0)); elseif (t <= 2.8e+41) tmp = Float64(x * Float64(1.0 - y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * t; tmp = 0.0; if (t <= -4.8e-7) tmp = t_1; elseif (t <= -9e-257) tmp = x * (z + 1.0); elseif (t <= 2.8e+41) tmp = x * (1.0 - y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -4.8e-7], t$95$1, If[LessEqual[t, -9e-257], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.8e+41], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -9 \cdot 10^{-257}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{+41}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.79999999999999957e-7 or 2.7999999999999999e41 < t Initial program 100.0%
Taylor expanded in t around inf 97.6%
associate--l+97.6%
+-commutative97.6%
mul-1-neg97.6%
unsub-neg97.6%
div-sub97.6%
unsub-neg97.6%
mul-1-neg97.6%
mul-1-neg97.6%
*-rgt-identity97.6%
distribute-rgt-neg-in97.6%
mul-1-neg97.6%
distribute-lft-in97.6%
mul-1-neg97.6%
unsub-neg97.6%
Simplified97.6%
Taylor expanded in x around 0 79.4%
if -4.79999999999999957e-7 < t < -9.0000000000000005e-257Initial program 100.0%
Taylor expanded in x around inf 86.9%
mul-1-neg86.9%
unsub-neg86.9%
Simplified86.9%
Taylor expanded in y around 0 64.9%
+-commutative64.9%
Simplified64.9%
if -9.0000000000000005e-257 < t < 2.7999999999999999e41Initial program 100.0%
Taylor expanded in x around inf 80.3%
mul-1-neg80.3%
unsub-neg80.3%
Simplified80.3%
Taylor expanded in z around 0 64.0%
Final simplification71.9%
(FPCore (x y z t) :precision binary64 (if (<= z -4.4e-39) (+ x (* z (- x t))) (if (<= z 6.5e+23) (+ x (* y (- t x))) (* z (- (+ x (/ x z)) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.4e-39) {
tmp = x + (z * (x - t));
} else if (z <= 6.5e+23) {
tmp = x + (y * (t - x));
} else {
tmp = z * ((x + (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 (z <= (-4.4d-39)) then
tmp = x + (z * (x - t))
else if (z <= 6.5d+23) then
tmp = x + (y * (t - x))
else
tmp = z * ((x + (x / z)) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.4e-39) {
tmp = x + (z * (x - t));
} else if (z <= 6.5e+23) {
tmp = x + (y * (t - x));
} else {
tmp = z * ((x + (x / z)) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.4e-39: tmp = x + (z * (x - t)) elif z <= 6.5e+23: tmp = x + (y * (t - x)) else: tmp = z * ((x + (x / z)) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.4e-39) tmp = Float64(x + Float64(z * Float64(x - t))); elseif (z <= 6.5e+23) tmp = Float64(x + Float64(y * Float64(t - x))); else tmp = Float64(z * Float64(Float64(x + Float64(x / z)) - t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.4e-39) tmp = x + (z * (x - t)); elseif (z <= 6.5e+23) tmp = x + (y * (t - x)); else tmp = z * ((x + (x / z)) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.4e-39], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e+23], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(x + N[(x / z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{-39}:\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+23}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(x + \frac{x}{z}\right) - t\right)\\
\end{array}
\end{array}
if z < -4.40000000000000002e-39Initial program 100.0%
Taylor expanded in y around 0 78.4%
mul-1-neg78.4%
unsub-neg78.4%
Simplified78.4%
if -4.40000000000000002e-39 < z < 6.4999999999999996e23Initial program 100.0%
Taylor expanded in y around inf 92.8%
*-commutative92.8%
Simplified92.8%
if 6.4999999999999996e23 < z Initial program 100.0%
Taylor expanded in y around 0 87.0%
mul-1-neg87.0%
unsub-neg87.0%
Simplified87.0%
Taylor expanded in z around inf 87.0%
Final simplification87.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.95e-38) (not (<= z 8.5e+23))) (+ x (* z (- x t))) (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.95e-38) || !(z <= 8.5e+23)) {
tmp = x + (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 <= (-1.95d-38)) .or. (.not. (z <= 8.5d+23))) then
tmp = x + (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 <= -1.95e-38) || !(z <= 8.5e+23)) {
tmp = x + (z * (x - t));
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.95e-38) or not (z <= 8.5e+23): tmp = x + (z * (x - t)) else: tmp = x + (y * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.95e-38) || !(z <= 8.5e+23)) tmp = Float64(x + 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 <= -1.95e-38) || ~((z <= 8.5e+23))) tmp = x + (z * (x - t)); else tmp = x + (y * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.95e-38], N[Not[LessEqual[z, 8.5e+23]], $MachinePrecision]], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{-38} \lor \neg \left(z \leq 8.5 \cdot 10^{+23}\right):\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -1.95e-38 or 8.5000000000000001e23 < z Initial program 100.0%
Taylor expanded in y around 0 82.2%
mul-1-neg82.2%
unsub-neg82.2%
Simplified82.2%
if -1.95e-38 < z < 8.5000000000000001e23Initial program 100.0%
Taylor expanded in y around inf 92.8%
*-commutative92.8%
Simplified92.8%
Final simplification87.8%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.35e-7) (not (<= t 8.5e+41))) (* (- y z) t) (+ x (* x (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.35e-7) || !(t <= 8.5e+41)) {
tmp = (y - z) * t;
} else {
tmp = x + (x * (z - y));
}
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 ((t <= (-1.35d-7)) .or. (.not. (t <= 8.5d+41))) then
tmp = (y - z) * t
else
tmp = x + (x * (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.35e-7) || !(t <= 8.5e+41)) {
tmp = (y - z) * t;
} else {
tmp = x + (x * (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.35e-7) or not (t <= 8.5e+41): tmp = (y - z) * t else: tmp = x + (x * (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.35e-7) || !(t <= 8.5e+41)) tmp = Float64(Float64(y - z) * t); else tmp = Float64(x + Float64(x * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.35e-7) || ~((t <= 8.5e+41))) tmp = (y - z) * t; else tmp = x + (x * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.35e-7], N[Not[LessEqual[t, 8.5e+41]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{-7} \lor \neg \left(t \leq 8.5 \cdot 10^{+41}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\end{array}
\end{array}
if t < -1.35000000000000004e-7 or 8.49999999999999938e41 < t Initial program 100.0%
Taylor expanded in t around inf 97.6%
associate--l+97.6%
+-commutative97.6%
mul-1-neg97.6%
unsub-neg97.6%
div-sub97.6%
unsub-neg97.6%
mul-1-neg97.6%
mul-1-neg97.6%
*-rgt-identity97.6%
distribute-rgt-neg-in97.6%
mul-1-neg97.6%
distribute-lft-in97.6%
mul-1-neg97.6%
unsub-neg97.6%
Simplified97.6%
Taylor expanded in x around 0 79.4%
if -1.35000000000000004e-7 < t < 8.49999999999999938e41Initial program 100.0%
Taylor expanded in t around 0 82.6%
mul-1-neg82.6%
distribute-rgt-neg-in82.6%
sub-neg82.6%
+-commutative82.6%
distribute-neg-in82.6%
remove-double-neg82.6%
sub-neg82.6%
Simplified82.6%
Final simplification81.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.3e-6) (not (<= t 2.05e+42))) (* (- y z) t) (* x (+ (- z y) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.3e-6) || !(t <= 2.05e+42)) {
tmp = (y - z) * t;
} else {
tmp = x * ((z - y) + 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 ((t <= (-3.3d-6)) .or. (.not. (t <= 2.05d+42))) then
tmp = (y - z) * t
else
tmp = x * ((z - y) + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.3e-6) || !(t <= 2.05e+42)) {
tmp = (y - z) * t;
} else {
tmp = x * ((z - y) + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.3e-6) or not (t <= 2.05e+42): tmp = (y - z) * t else: tmp = x * ((z - y) + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.3e-6) || !(t <= 2.05e+42)) tmp = Float64(Float64(y - z) * t); else tmp = Float64(x * Float64(Float64(z - y) + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -3.3e-6) || ~((t <= 2.05e+42))) tmp = (y - z) * t; else tmp = x * ((z - y) + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.3e-6], N[Not[LessEqual[t, 2.05e+42]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{-6} \lor \neg \left(t \leq 2.05 \cdot 10^{+42}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\
\end{array}
\end{array}
if t < -3.30000000000000017e-6 or 2.05e42 < t Initial program 100.0%
Taylor expanded in t around inf 97.6%
associate--l+97.6%
+-commutative97.6%
mul-1-neg97.6%
unsub-neg97.6%
div-sub97.6%
unsub-neg97.6%
mul-1-neg97.6%
mul-1-neg97.6%
*-rgt-identity97.6%
distribute-rgt-neg-in97.6%
mul-1-neg97.6%
distribute-lft-in97.6%
mul-1-neg97.6%
unsub-neg97.6%
Simplified97.6%
Taylor expanded in x around 0 79.4%
if -3.30000000000000017e-6 < t < 2.05e42Initial program 100.0%
Taylor expanded in x around inf 82.5%
mul-1-neg82.5%
unsub-neg82.5%
Simplified82.5%
Final simplification81.0%
(FPCore (x y z t) :precision binary64 (if (<= x -2.35e+33) (+ x (* x (- z y))) (if (<= x 6.8e+154) (- x (* t (- z y))) (* x (+ (- z y) 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.35e+33) {
tmp = x + (x * (z - y));
} else if (x <= 6.8e+154) {
tmp = x - (t * (z - y));
} else {
tmp = x * ((z - y) + 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 (x <= (-2.35d+33)) then
tmp = x + (x * (z - y))
else if (x <= 6.8d+154) then
tmp = x - (t * (z - y))
else
tmp = x * ((z - y) + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.35e+33) {
tmp = x + (x * (z - y));
} else if (x <= 6.8e+154) {
tmp = x - (t * (z - y));
} else {
tmp = x * ((z - y) + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.35e+33: tmp = x + (x * (z - y)) elif x <= 6.8e+154: tmp = x - (t * (z - y)) else: tmp = x * ((z - y) + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.35e+33) tmp = Float64(x + Float64(x * Float64(z - y))); elseif (x <= 6.8e+154) tmp = Float64(x - Float64(t * Float64(z - y))); else tmp = Float64(x * Float64(Float64(z - y) + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.35e+33) tmp = x + (x * (z - y)); elseif (x <= 6.8e+154) tmp = x - (t * (z - y)); else tmp = x * ((z - y) + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.35e+33], N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.8e+154], N[(x - N[(t * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.35 \cdot 10^{+33}:\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{+154}:\\
\;\;\;\;x - t \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\
\end{array}
\end{array}
if x < -2.3499999999999999e33Initial program 100.0%
Taylor expanded in t around 0 87.9%
mul-1-neg87.9%
distribute-rgt-neg-in87.9%
sub-neg87.9%
+-commutative87.9%
distribute-neg-in87.9%
remove-double-neg87.9%
sub-neg87.9%
Simplified87.9%
if -2.3499999999999999e33 < x < 6.79999999999999948e154Initial program 100.0%
Taylor expanded in t around inf 82.5%
if 6.79999999999999948e154 < x Initial program 100.0%
Taylor expanded in x around inf 88.5%
mul-1-neg88.5%
unsub-neg88.5%
Simplified88.5%
Final simplification84.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.5e-6) (not (<= t 8.2e+41))) (* (- y z) t) (* x (+ z 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.5e-6) || !(t <= 8.2e+41)) {
tmp = (y - z) * t;
} 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 ((t <= (-3.5d-6)) .or. (.not. (t <= 8.2d+41))) then
tmp = (y - z) * t
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 ((t <= -3.5e-6) || !(t <= 8.2e+41)) {
tmp = (y - z) * t;
} else {
tmp = x * (z + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.5e-6) or not (t <= 8.2e+41): tmp = (y - z) * t else: tmp = x * (z + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.5e-6) || !(t <= 8.2e+41)) tmp = Float64(Float64(y - z) * t); else tmp = Float64(x * Float64(z + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -3.5e-6) || ~((t <= 8.2e+41))) tmp = (y - z) * t; else tmp = x * (z + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.5e-6], N[Not[LessEqual[t, 8.2e+41]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{-6} \lor \neg \left(t \leq 8.2 \cdot 10^{+41}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\end{array}
\end{array}
if t < -3.49999999999999995e-6 or 8.2000000000000007e41 < t Initial program 100.0%
Taylor expanded in t around inf 97.6%
associate--l+97.6%
+-commutative97.6%
mul-1-neg97.6%
unsub-neg97.6%
div-sub97.6%
unsub-neg97.6%
mul-1-neg97.6%
mul-1-neg97.6%
*-rgt-identity97.6%
distribute-rgt-neg-in97.6%
mul-1-neg97.6%
distribute-lft-in97.6%
mul-1-neg97.6%
unsub-neg97.6%
Simplified97.6%
Taylor expanded in x around 0 79.4%
if -3.49999999999999995e-6 < t < 8.2000000000000007e41Initial program 100.0%
Taylor expanded in x around inf 82.5%
mul-1-neg82.5%
unsub-neg82.5%
Simplified82.5%
Taylor expanded in y around 0 56.7%
+-commutative56.7%
Simplified56.7%
Final simplification68.2%
(FPCore (x y z t) :precision binary64 (if (<= x -2e+62) (* z x) (if (<= x 1.16e+195) (* (- y z) t) (* y (- x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2e+62) {
tmp = z * x;
} else if (x <= 1.16e+195) {
tmp = (y - z) * t;
} else {
tmp = y * -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 (x <= (-2d+62)) then
tmp = z * x
else if (x <= 1.16d+195) then
tmp = (y - z) * t
else
tmp = y * -x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2e+62) {
tmp = z * x;
} else if (x <= 1.16e+195) {
tmp = (y - z) * t;
} else {
tmp = y * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2e+62: tmp = z * x elif x <= 1.16e+195: tmp = (y - z) * t else: tmp = y * -x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2e+62) tmp = Float64(z * x); elseif (x <= 1.16e+195) tmp = Float64(Float64(y - z) * t); else tmp = Float64(y * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2e+62) tmp = z * x; elseif (x <= 1.16e+195) tmp = (y - z) * t; else tmp = y * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2e+62], N[(z * x), $MachinePrecision], If[LessEqual[x, 1.16e+195], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(y * (-x)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{+62}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;x \leq 1.16 \cdot 10^{+195}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\end{array}
\end{array}
if x < -2.00000000000000007e62Initial program 100.0%
Taylor expanded in x around inf 90.5%
mul-1-neg90.5%
unsub-neg90.5%
Simplified90.5%
Taylor expanded in z around inf 46.9%
if -2.00000000000000007e62 < x < 1.16e195Initial program 100.0%
Taylor expanded in t around inf 90.3%
associate--l+90.3%
+-commutative90.3%
mul-1-neg90.3%
unsub-neg90.3%
div-sub90.9%
unsub-neg90.9%
mul-1-neg90.9%
mul-1-neg90.9%
*-rgt-identity90.9%
distribute-rgt-neg-in90.9%
mul-1-neg90.9%
distribute-lft-in90.9%
mul-1-neg90.9%
unsub-neg90.9%
Simplified90.9%
Taylor expanded in x around 0 62.6%
if 1.16e195 < x Initial program 100.0%
Taylor expanded in x around inf 97.8%
mul-1-neg97.8%
unsub-neg97.8%
Simplified97.8%
Taylor expanded in y around inf 58.9%
neg-mul-158.9%
Simplified58.9%
Final simplification58.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.5e-58) (not (<= y 2.15e-30))) (* y t) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.5e-58) || !(y <= 2.15e-30)) {
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 <= (-3.5d-58)) .or. (.not. (y <= 2.15d-30))) 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 <= -3.5e-58) || !(y <= 2.15e-30)) {
tmp = y * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.5e-58) or not (y <= 2.15e-30): tmp = y * t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.5e-58) || !(y <= 2.15e-30)) tmp = Float64(y * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3.5e-58) || ~((y <= 2.15e-30))) tmp = y * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.5e-58], N[Not[LessEqual[y, 2.15e-30]], $MachinePrecision]], N[(y * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{-58} \lor \neg \left(y \leq 2.15 \cdot 10^{-30}\right):\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -3.4999999999999999e-58 or 2.14999999999999983e-30 < y Initial program 100.0%
Taylor expanded in t around inf 82.7%
associate--l+82.6%
+-commutative82.6%
mul-1-neg82.6%
unsub-neg82.6%
div-sub84.8%
unsub-neg84.8%
mul-1-neg84.8%
mul-1-neg84.8%
*-rgt-identity84.8%
distribute-rgt-neg-in84.8%
mul-1-neg84.8%
distribute-lft-in84.8%
mul-1-neg84.8%
unsub-neg84.8%
Simplified84.8%
Taylor expanded in x around 0 52.7%
Taylor expanded in y around inf 40.6%
if -3.4999999999999999e-58 < y < 2.14999999999999983e-30Initial program 99.9%
Taylor expanded in y around inf 45.7%
*-commutative45.7%
Simplified45.7%
Taylor expanded in y around 0 37.3%
Final simplification39.1%
(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 62.4%
*-commutative62.4%
Simplified62.4%
Taylor expanded in y around 0 19.9%
(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 2024191
(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))))