
(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-define100.0%
Simplified100.0%
(FPCore (x y z t)
:precision binary64
(if (<= z -8e+35)
(* z x)
(if (<= z 7.2e-221)
(* y t)
(if (<= z 1.8e-80)
x
(if (<= z 15500.0) (* y t) (if (<= z 8.6e+114) (* z x) (* z (- t))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8e+35) {
tmp = z * x;
} else if (z <= 7.2e-221) {
tmp = y * t;
} else if (z <= 1.8e-80) {
tmp = x;
} else if (z <= 15500.0) {
tmp = y * t;
} else if (z <= 8.6e+114) {
tmp = z * x;
} else {
tmp = 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 <= (-8d+35)) then
tmp = z * x
else if (z <= 7.2d-221) then
tmp = y * t
else if (z <= 1.8d-80) then
tmp = x
else if (z <= 15500.0d0) then
tmp = y * t
else if (z <= 8.6d+114) then
tmp = z * x
else
tmp = z * -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8e+35) {
tmp = z * x;
} else if (z <= 7.2e-221) {
tmp = y * t;
} else if (z <= 1.8e-80) {
tmp = x;
} else if (z <= 15500.0) {
tmp = y * t;
} else if (z <= 8.6e+114) {
tmp = z * x;
} else {
tmp = z * -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8e+35: tmp = z * x elif z <= 7.2e-221: tmp = y * t elif z <= 1.8e-80: tmp = x elif z <= 15500.0: tmp = y * t elif z <= 8.6e+114: tmp = z * x else: tmp = z * -t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8e+35) tmp = Float64(z * x); elseif (z <= 7.2e-221) tmp = Float64(y * t); elseif (z <= 1.8e-80) tmp = x; elseif (z <= 15500.0) tmp = Float64(y * t); elseif (z <= 8.6e+114) tmp = Float64(z * x); else tmp = Float64(z * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -8e+35) tmp = z * x; elseif (z <= 7.2e-221) tmp = y * t; elseif (z <= 1.8e-80) tmp = x; elseif (z <= 15500.0) tmp = y * t; elseif (z <= 8.6e+114) tmp = z * x; else tmp = z * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8e+35], N[(z * x), $MachinePrecision], If[LessEqual[z, 7.2e-221], N[(y * t), $MachinePrecision], If[LessEqual[z, 1.8e-80], x, If[LessEqual[z, 15500.0], N[(y * t), $MachinePrecision], If[LessEqual[z, 8.6e+114], N[(z * x), $MachinePrecision], N[(z * (-t)), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+35}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-221}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-80}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 15500:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{+114}:\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\end{array}
\end{array}
if z < -7.9999999999999997e35 or 15500 < z < 8.6000000000000001e114Initial program 99.9%
Taylor expanded in x around inf 59.6%
mul-1-neg59.6%
unsub-neg59.6%
Simplified59.6%
Taylor expanded in z around inf 45.7%
*-commutative45.7%
Simplified45.7%
if -7.9999999999999997e35 < z < 7.20000000000000022e-221 or 1.8e-80 < z < 15500Initial program 100.0%
Taylor expanded in t around inf 71.9%
Taylor expanded in t around inf 72.8%
Taylor expanded in y around inf 42.4%
if 7.20000000000000022e-221 < z < 1.8e-80Initial program 99.9%
Taylor expanded in t around inf 77.6%
Taylor expanded in x around inf 46.3%
if 8.6000000000000001e114 < z Initial program 100.0%
Taylor expanded in t around inf 67.0%
Taylor expanded in t around inf 71.7%
Taylor expanded in z around inf 61.9%
mul-1-neg61.9%
distribute-rgt-neg-out61.9%
Simplified61.9%
Final simplification46.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.3e+35)
(* z x)
(if (<= z 6.5e-221)
(* y t)
(if (<= z 2.15e-79) x (if (<= z 14200.0) (* y t) (* z x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.3e+35) {
tmp = z * x;
} else if (z <= 6.5e-221) {
tmp = y * t;
} else if (z <= 2.15e-79) {
tmp = x;
} else if (z <= 14200.0) {
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 <= (-1.3d+35)) then
tmp = z * x
else if (z <= 6.5d-221) then
tmp = y * t
else if (z <= 2.15d-79) then
tmp = x
else if (z <= 14200.0d0) 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 <= -1.3e+35) {
tmp = z * x;
} else if (z <= 6.5e-221) {
tmp = y * t;
} else if (z <= 2.15e-79) {
tmp = x;
} else if (z <= 14200.0) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.3e+35: tmp = z * x elif z <= 6.5e-221: tmp = y * t elif z <= 2.15e-79: tmp = x elif z <= 14200.0: tmp = y * t else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.3e+35) tmp = Float64(z * x); elseif (z <= 6.5e-221) tmp = Float64(y * t); elseif (z <= 2.15e-79) tmp = x; elseif (z <= 14200.0) 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 <= -1.3e+35) tmp = z * x; elseif (z <= 6.5e-221) tmp = y * t; elseif (z <= 2.15e-79) tmp = x; elseif (z <= 14200.0) tmp = y * t; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.3e+35], N[(z * x), $MachinePrecision], If[LessEqual[z, 6.5e-221], N[(y * t), $MachinePrecision], If[LessEqual[z, 2.15e-79], x, If[LessEqual[z, 14200.0], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+35}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-221}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-79}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 14200:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -1.30000000000000003e35 or 14200 < z Initial program 99.9%
Taylor expanded in x around inf 55.9%
mul-1-neg55.9%
unsub-neg55.9%
Simplified55.9%
Taylor expanded in z around inf 45.2%
*-commutative45.2%
Simplified45.2%
if -1.30000000000000003e35 < z < 6.5e-221 or 2.14999999999999991e-79 < z < 14200Initial program 100.0%
Taylor expanded in t around inf 71.9%
Taylor expanded in t around inf 72.8%
Taylor expanded in y around inf 42.4%
if 6.5e-221 < z < 2.14999999999999991e-79Initial program 99.9%
Taylor expanded in t around inf 77.6%
Taylor expanded in x around inf 46.3%
Final simplification44.1%
(FPCore (x y z t) :precision binary64 (if (<= y -6e+116) (* y (- x)) (if (<= y -7.5e-98) (* z (- t)) (if (<= y 5.6e-8) x (* y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6e+116) {
tmp = y * -x;
} else if (y <= -7.5e-98) {
tmp = z * -t;
} else if (y <= 5.6e-8) {
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 <= (-6d+116)) then
tmp = y * -x
else if (y <= (-7.5d-98)) then
tmp = z * -t
else if (y <= 5.6d-8) 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 <= -6e+116) {
tmp = y * -x;
} else if (y <= -7.5e-98) {
tmp = z * -t;
} else if (y <= 5.6e-8) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6e+116: tmp = y * -x elif y <= -7.5e-98: tmp = z * -t elif y <= 5.6e-8: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6e+116) tmp = Float64(y * Float64(-x)); elseif (y <= -7.5e-98) tmp = Float64(z * Float64(-t)); elseif (y <= 5.6e-8) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6e+116) tmp = y * -x; elseif (y <= -7.5e-98) tmp = z * -t; elseif (y <= 5.6e-8) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6e+116], N[(y * (-x)), $MachinePrecision], If[LessEqual[y, -7.5e-98], N[(z * (-t)), $MachinePrecision], If[LessEqual[y, 5.6e-8], x, N[(y * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{+116}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;y \leq -7.5 \cdot 10^{-98}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{-8}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -5.9999999999999997e116Initial program 100.0%
Taylor expanded in x around inf 67.1%
mul-1-neg67.1%
unsub-neg67.1%
Simplified67.1%
Taylor expanded in y around inf 64.7%
associate-*r*64.7%
neg-mul-164.7%
Simplified64.7%
if -5.9999999999999997e116 < y < -7.5000000000000006e-98Initial program 99.9%
Taylor expanded in t around inf 69.8%
Taylor expanded in t around inf 70.0%
Taylor expanded in z around inf 42.7%
mul-1-neg42.7%
distribute-rgt-neg-out42.7%
Simplified42.7%
if -7.5000000000000006e-98 < y < 5.5999999999999999e-8Initial program 100.0%
Taylor expanded in t around inf 71.9%
Taylor expanded in x around inf 36.3%
if 5.5999999999999999e-8 < y Initial program 100.0%
Taylor expanded in t around inf 61.0%
Taylor expanded in t around inf 61.0%
Taylor expanded in y around inf 47.4%
Final simplification44.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.5e-60) (not (<= t 3.5e-69))) (+ x (* (- y z) t)) (* x (- 1.0 (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.5e-60) || !(t <= 3.5e-69)) {
tmp = x + ((y - z) * t);
} else {
tmp = x * (1.0 - (y - z));
}
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.5d-60)) .or. (.not. (t <= 3.5d-69))) then
tmp = x + ((y - z) * t)
else
tmp = x * (1.0d0 - (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.5e-60) || !(t <= 3.5e-69)) {
tmp = x + ((y - z) * t);
} else {
tmp = x * (1.0 - (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.5e-60) or not (t <= 3.5e-69): tmp = x + ((y - z) * t) else: tmp = x * (1.0 - (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.5e-60) || !(t <= 3.5e-69)) tmp = Float64(x + Float64(Float64(y - z) * t)); else tmp = Float64(x * Float64(1.0 - Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.5e-60) || ~((t <= 3.5e-69))) tmp = x + ((y - z) * t); else tmp = x * (1.0 - (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.5e-60], N[Not[LessEqual[t, 3.5e-69]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{-60} \lor \neg \left(t \leq 3.5 \cdot 10^{-69}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \left(y - z\right)\right)\\
\end{array}
\end{array}
if t < -1.50000000000000009e-60 or 3.5000000000000001e-69 < t Initial program 100.0%
Taylor expanded in t around inf 82.1%
if -1.50000000000000009e-60 < t < 3.5000000000000001e-69Initial program 99.9%
Taylor expanded in x around inf 91.2%
mul-1-neg91.2%
unsub-neg91.2%
Simplified91.2%
Final simplification85.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -5.9e-102) (not (<= x 2.3e+38))) (* x (- 1.0 (- y z))) (* (- y z) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.9e-102) || !(x <= 2.3e+38)) {
tmp = x * (1.0 - (y - z));
} else {
tmp = (y - 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 ((x <= (-5.9d-102)) .or. (.not. (x <= 2.3d+38))) then
tmp = x * (1.0d0 - (y - z))
else
tmp = (y - z) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.9e-102) || !(x <= 2.3e+38)) {
tmp = x * (1.0 - (y - z));
} else {
tmp = (y - z) * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -5.9e-102) or not (x <= 2.3e+38): tmp = x * (1.0 - (y - z)) else: tmp = (y - z) * t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -5.9e-102) || !(x <= 2.3e+38)) tmp = Float64(x * Float64(1.0 - Float64(y - z))); else tmp = Float64(Float64(y - z) * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -5.9e-102) || ~((x <= 2.3e+38))) tmp = x * (1.0 - (y - z)); else tmp = (y - z) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5.9e-102], N[Not[LessEqual[x, 2.3e+38]], $MachinePrecision]], N[(x * N[(1.0 - N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.9 \cdot 10^{-102} \lor \neg \left(x \leq 2.3 \cdot 10^{+38}\right):\\
\;\;\;\;x \cdot \left(1 - \left(y - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\end{array}
\end{array}
if x < -5.9000000000000003e-102 or 2.3000000000000001e38 < x Initial program 100.0%
Taylor expanded in x around inf 84.0%
mul-1-neg84.0%
unsub-neg84.0%
Simplified84.0%
if -5.9000000000000003e-102 < x < 2.3000000000000001e38Initial program 99.9%
Taylor expanded in t around inf 81.5%
Taylor expanded in t around inf 81.5%
Taylor expanded in t around inf 79.2%
Final simplification82.0%
(FPCore (x y z t) :precision binary64 (if (<= t -2.35e-60) (* t (- (+ y (/ x t)) z)) (if (<= t 1.3e-72) (* x (- 1.0 (- y z))) (+ x (* (- y z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.35e-60) {
tmp = t * ((y + (x / t)) - z);
} else if (t <= 1.3e-72) {
tmp = x * (1.0 - (y - z));
} else {
tmp = x + ((y - 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 (t <= (-2.35d-60)) then
tmp = t * ((y + (x / t)) - z)
else if (t <= 1.3d-72) then
tmp = x * (1.0d0 - (y - z))
else
tmp = x + ((y - z) * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.35e-60) {
tmp = t * ((y + (x / t)) - z);
} else if (t <= 1.3e-72) {
tmp = x * (1.0 - (y - z));
} else {
tmp = x + ((y - z) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.35e-60: tmp = t * ((y + (x / t)) - z) elif t <= 1.3e-72: tmp = x * (1.0 - (y - z)) else: tmp = x + ((y - z) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.35e-60) tmp = Float64(t * Float64(Float64(y + Float64(x / t)) - z)); elseif (t <= 1.3e-72) tmp = Float64(x * Float64(1.0 - Float64(y - z))); else tmp = Float64(x + Float64(Float64(y - z) * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.35e-60) tmp = t * ((y + (x / t)) - z); elseif (t <= 1.3e-72) tmp = x * (1.0 - (y - z)); else tmp = x + ((y - z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.35e-60], N[(t * N[(N[(y + N[(x / t), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e-72], N[(x * N[(1.0 - N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.35 \cdot 10^{-60}:\\
\;\;\;\;t \cdot \left(\left(y + \frac{x}{t}\right) - z\right)\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-72}:\\
\;\;\;\;x \cdot \left(1 - \left(y - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\end{array}
\end{array}
if t < -2.35e-60Initial program 99.9%
Taylor expanded in t around inf 83.4%
Taylor expanded in t around inf 84.4%
if -2.35e-60 < t < 1.29999999999999998e-72Initial program 99.9%
Taylor expanded in x around inf 91.2%
mul-1-neg91.2%
unsub-neg91.2%
Simplified91.2%
if 1.29999999999999998e-72 < t Initial program 100.0%
Taylor expanded in t around inf 80.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.32e-33) (not (<= x 6.5e+43))) (* x (+ z 1.0)) (* (- y z) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.32e-33) || !(x <= 6.5e+43)) {
tmp = x * (z + 1.0);
} else {
tmp = (y - 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 ((x <= (-1.32d-33)) .or. (.not. (x <= 6.5d+43))) then
tmp = x * (z + 1.0d0)
else
tmp = (y - z) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.32e-33) || !(x <= 6.5e+43)) {
tmp = x * (z + 1.0);
} else {
tmp = (y - z) * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.32e-33) or not (x <= 6.5e+43): tmp = x * (z + 1.0) else: tmp = (y - z) * t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.32e-33) || !(x <= 6.5e+43)) tmp = Float64(x * Float64(z + 1.0)); else tmp = Float64(Float64(y - z) * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.32e-33) || ~((x <= 6.5e+43))) tmp = x * (z + 1.0); else tmp = (y - z) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.32e-33], N[Not[LessEqual[x, 6.5e+43]], $MachinePrecision]], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.32 \cdot 10^{-33} \lor \neg \left(x \leq 6.5 \cdot 10^{+43}\right):\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\end{array}
\end{array}
if x < -1.31999999999999993e-33 or 6.4999999999999998e43 < x Initial program 100.0%
Taylor expanded in x around inf 87.3%
mul-1-neg87.3%
unsub-neg87.3%
Simplified87.3%
Taylor expanded in y around 0 56.9%
+-commutative56.9%
Simplified56.9%
if -1.31999999999999993e-33 < x < 6.4999999999999998e43Initial program 99.9%
Taylor expanded in t around inf 82.2%
Taylor expanded in t around inf 82.2%
Taylor expanded in t around inf 75.5%
Final simplification65.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.45e-22) (not (<= t 3.5e-92))) (* (- y z) t) (* y (- x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.45e-22) || !(t <= 3.5e-92)) {
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 ((t <= (-2.45d-22)) .or. (.not. (t <= 3.5d-92))) 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 ((t <= -2.45e-22) || !(t <= 3.5e-92)) {
tmp = (y - z) * t;
} else {
tmp = y * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.45e-22) or not (t <= 3.5e-92): tmp = (y - z) * t else: tmp = y * -x return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.45e-22) || !(t <= 3.5e-92)) 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 ((t <= -2.45e-22) || ~((t <= 3.5e-92))) tmp = (y - z) * t; else tmp = y * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.45e-22], N[Not[LessEqual[t, 3.5e-92]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(y * (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.45 \cdot 10^{-22} \lor \neg \left(t \leq 3.5 \cdot 10^{-92}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\end{array}
\end{array}
if t < -2.4499999999999999e-22 or 3.5e-92 < t Initial program 100.0%
Taylor expanded in t around inf 81.6%
Taylor expanded in t around inf 81.1%
Taylor expanded in t around inf 68.8%
if -2.4499999999999999e-22 < t < 3.5e-92Initial program 99.9%
Taylor expanded in x around inf 91.2%
mul-1-neg91.2%
unsub-neg91.2%
Simplified91.2%
Taylor expanded in y around inf 37.1%
associate-*r*37.1%
neg-mul-137.1%
Simplified37.1%
Final simplification58.2%
(FPCore (x y z t) :precision binary64 (if (<= x -1.32e-33) (* x (+ z 1.0)) (if (<= x 5.6e+55) (* (- y z) t) (* x (- 1.0 y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.32e-33) {
tmp = x * (z + 1.0);
} else if (x <= 5.6e+55) {
tmp = (y - z) * t;
} else {
tmp = x * (1.0 - 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 (x <= (-1.32d-33)) then
tmp = x * (z + 1.0d0)
else if (x <= 5.6d+55) then
tmp = (y - z) * t
else
tmp = x * (1.0d0 - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.32e-33) {
tmp = x * (z + 1.0);
} else if (x <= 5.6e+55) {
tmp = (y - z) * t;
} else {
tmp = x * (1.0 - y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.32e-33: tmp = x * (z + 1.0) elif x <= 5.6e+55: tmp = (y - z) * t else: tmp = x * (1.0 - y) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.32e-33) tmp = Float64(x * Float64(z + 1.0)); elseif (x <= 5.6e+55) tmp = Float64(Float64(y - z) * t); else tmp = Float64(x * Float64(1.0 - y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.32e-33) tmp = x * (z + 1.0); elseif (x <= 5.6e+55) tmp = (y - z) * t; else tmp = x * (1.0 - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.32e-33], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.6e+55], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.32 \cdot 10^{-33}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{+55}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\end{array}
\end{array}
if x < -1.31999999999999993e-33Initial program 100.0%
Taylor expanded in x around inf 83.5%
mul-1-neg83.5%
unsub-neg83.5%
Simplified83.5%
Taylor expanded in y around 0 60.9%
+-commutative60.9%
Simplified60.9%
if -1.31999999999999993e-33 < x < 5.6000000000000002e55Initial program 99.9%
Taylor expanded in t around inf 81.7%
Taylor expanded in t around inf 81.7%
Taylor expanded in t around inf 75.1%
if 5.6000000000000002e55 < x Initial program 100.0%
Taylor expanded in x around inf 92.2%
mul-1-neg92.2%
unsub-neg92.2%
Simplified92.2%
Taylor expanded in z around 0 66.7%
Final simplification69.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.75e-105) (not (<= y 5.8e-7))) (* y t) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.75e-105) || !(y <= 5.8e-7)) {
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.75d-105)) .or. (.not. (y <= 5.8d-7))) 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.75e-105) || !(y <= 5.8e-7)) {
tmp = y * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.75e-105) or not (y <= 5.8e-7): tmp = y * t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.75e-105) || !(y <= 5.8e-7)) 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.75e-105) || ~((y <= 5.8e-7))) tmp = y * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.75e-105], N[Not[LessEqual[y, 5.8e-7]], $MachinePrecision]], N[(y * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{-105} \lor \neg \left(y \leq 5.8 \cdot 10^{-7}\right):\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.75e-105 or 5.7999999999999995e-7 < y Initial program 99.9%
Taylor expanded in t around inf 60.5%
Taylor expanded in t around inf 63.6%
Taylor expanded in y around inf 40.8%
if -1.75e-105 < y < 5.7999999999999995e-7Initial program 100.0%
Taylor expanded in t around inf 71.6%
Taylor expanded in x around inf 36.6%
Final simplification39.0%
(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 t around inf 65.1%
Taylor expanded in x around inf 17.7%
(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 2024131
(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))))