
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- z t) (* (- y x) (/ 1.0 (- a t))))))
(t_2 (- x (/ (* (- z t) (- x y)) (- a t)))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -5e-248)
t_2
(if (<= t_2 0.0)
(+ y (* (/ (- z a) t) (- x y)))
(if (<= t_2 2e+226) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((z - t) * ((y - x) * (1.0 / (a - t))));
double t_2 = x - (((z - t) * (x - y)) / (a - t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -5e-248) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = y + (((z - a) / t) * (x - y));
} else if (t_2 <= 2e+226) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((z - t) * ((y - x) * (1.0 / (a - t))));
double t_2 = x - (((z - t) * (x - y)) / (a - t));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= -5e-248) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = y + (((z - a) / t) * (x - y));
} else if (t_2 <= 2e+226) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((z - t) * ((y - x) * (1.0 / (a - t)))) t_2 = x - (((z - t) * (x - y)) / (a - t)) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= -5e-248: tmp = t_2 elif t_2 <= 0.0: tmp = y + (((z - a) / t) * (x - y)) elif t_2 <= 2e+226: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(z - t) * Float64(Float64(y - x) * Float64(1.0 / Float64(a - t))))) t_2 = Float64(x - Float64(Float64(Float64(z - t) * Float64(x - y)) / Float64(a - t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -5e-248) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(y + Float64(Float64(Float64(z - a) / t) * Float64(x - y))); elseif (t_2 <= 2e+226) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((z - t) * ((y - x) * (1.0 / (a - t)))); t_2 = x - (((z - t) * (x - y)) / (a - t)); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= -5e-248) tmp = t_2; elseif (t_2 <= 0.0) tmp = y + (((z - a) / t) * (x - y)); elseif (t_2 <= 2e+226) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(z - t), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(N[(N[(z - t), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -5e-248], t$95$2, If[LessEqual[t$95$2, 0.0], N[(y + N[(N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+226], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)\\
t_2 := x - \frac{\left(z - t\right) \cdot \left(x - y\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-248}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;y + \frac{z - a}{t} \cdot \left(x - y\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+226}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -inf.0 or 1.99999999999999992e226 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 36.8%
div-inv36.8%
*-commutative36.8%
associate-*l*89.3%
Applied egg-rr89.3%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -5.0000000000000001e-248 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 1.99999999999999992e226Initial program 97.3%
if -5.0000000000000001e-248 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 9.1%
+-commutative9.1%
associate-/l*9.1%
fma-define9.1%
Simplified9.1%
Taylor expanded in y around 0 9.1%
+-commutative9.1%
div-sub9.1%
mul-1-neg9.1%
associate-/l*9.1%
distribute-lft-neg-in9.1%
distribute-rgt-in9.1%
sub-neg9.1%
associate-*l/9.1%
associate-*r/4.7%
+-commutative4.7%
fma-define4.9%
Simplified4.9%
Taylor expanded in t around inf 94.9%
associate--l+94.9%
associate-*r/94.9%
associate-*r/94.9%
mul-1-neg94.9%
div-sub95.0%
mul-1-neg95.0%
distribute-lft-out--95.0%
associate-*r/95.0%
mul-1-neg95.0%
distribute-rgt-out--95.0%
associate-/l*99.6%
Simplified99.6%
Final simplification94.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (/ (* (- z t) (- x y)) (- a t)))))
(if (or (<= t_1 -5e-248) (not (<= t_1 0.0)))
(fma (- y x) (/ (- z t) (- a t)) x)
(+ y (* (/ (- z a) t) (- x y))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (((z - t) * (x - y)) / (a - t));
double tmp;
if ((t_1 <= -5e-248) || !(t_1 <= 0.0)) {
tmp = fma((y - x), ((z - t) / (a - t)), x);
} else {
tmp = y + (((z - a) / t) * (x - y));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(Float64(z - t) * Float64(x - y)) / Float64(a - t))) tmp = 0.0 if ((t_1 <= -5e-248) || !(t_1 <= 0.0)) tmp = fma(Float64(y - x), Float64(Float64(z - t) / Float64(a - t)), x); else tmp = Float64(y + Float64(Float64(Float64(z - a) / t) * Float64(x - y))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(N[(z - t), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e-248], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(y + N[(N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{\left(z - t\right) \cdot \left(x - y\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-248} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + \frac{z - a}{t} \cdot \left(x - y\right)\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -5.0000000000000001e-248 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 72.2%
+-commutative72.2%
associate-/l*93.6%
fma-define93.6%
Simplified93.6%
if -5.0000000000000001e-248 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 9.1%
+-commutative9.1%
associate-/l*9.1%
fma-define9.1%
Simplified9.1%
Taylor expanded in y around 0 9.1%
+-commutative9.1%
div-sub9.1%
mul-1-neg9.1%
associate-/l*9.1%
distribute-lft-neg-in9.1%
distribute-rgt-in9.1%
sub-neg9.1%
associate-*l/9.1%
associate-*r/4.7%
+-commutative4.7%
fma-define4.9%
Simplified4.9%
Taylor expanded in t around inf 94.9%
associate--l+94.9%
associate-*r/94.9%
associate-*r/94.9%
mul-1-neg94.9%
div-sub95.0%
mul-1-neg95.0%
distribute-lft-out--95.0%
associate-*r/95.0%
mul-1-neg95.0%
distribute-rgt-out--95.0%
associate-/l*99.6%
Simplified99.6%
Final simplification94.0%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.45e+123)
(+ x (* (- y x) (/ (- z t) a)))
(if (or (<= a -1.4e-34) (not (<= a 4.6e-49)))
(+ x (/ y (/ (- a t) (- z t))))
(+ y (* (/ (- z a) t) (- x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.45e+123) {
tmp = x + ((y - x) * ((z - t) / a));
} else if ((a <= -1.4e-34) || !(a <= 4.6e-49)) {
tmp = x + (y / ((a - t) / (z - t)));
} else {
tmp = y + (((z - a) / t) * (x - y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.45d+123)) then
tmp = x + ((y - x) * ((z - t) / a))
else if ((a <= (-1.4d-34)) .or. (.not. (a <= 4.6d-49))) then
tmp = x + (y / ((a - t) / (z - t)))
else
tmp = y + (((z - a) / t) * (x - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.45e+123) {
tmp = x + ((y - x) * ((z - t) / a));
} else if ((a <= -1.4e-34) || !(a <= 4.6e-49)) {
tmp = x + (y / ((a - t) / (z - t)));
} else {
tmp = y + (((z - a) / t) * (x - y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.45e+123: tmp = x + ((y - x) * ((z - t) / a)) elif (a <= -1.4e-34) or not (a <= 4.6e-49): tmp = x + (y / ((a - t) / (z - t))) else: tmp = y + (((z - a) / t) * (x - y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.45e+123) tmp = Float64(x + Float64(Float64(y - x) * Float64(Float64(z - t) / a))); elseif ((a <= -1.4e-34) || !(a <= 4.6e-49)) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))); else tmp = Float64(y + Float64(Float64(Float64(z - a) / t) * Float64(x - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.45e+123) tmp = x + ((y - x) * ((z - t) / a)); elseif ((a <= -1.4e-34) || ~((a <= 4.6e-49))) tmp = x + (y / ((a - t) / (z - t))); else tmp = y + (((z - a) / t) * (x - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.45e+123], N[(x + N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -1.4e-34], N[Not[LessEqual[a, 4.6e-49]], $MachinePrecision]], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.45 \cdot 10^{+123}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z - t}{a}\\
\mathbf{elif}\;a \leq -1.4 \cdot 10^{-34} \lor \neg \left(a \leq 4.6 \cdot 10^{-49}\right):\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;y + \frac{z - a}{t} \cdot \left(x - y\right)\\
\end{array}
\end{array}
if a < -1.45000000000000005e123Initial program 65.3%
Taylor expanded in a around inf 63.6%
associate-/l*95.8%
Simplified95.8%
if -1.45000000000000005e123 < a < -1.39999999999999998e-34 or 4.5999999999999998e-49 < a Initial program 72.2%
clear-num72.2%
inv-pow72.2%
Applied egg-rr72.2%
unpow-172.2%
*-commutative72.2%
Simplified72.2%
Taylor expanded in y around inf 66.6%
*-rgt-identity66.6%
times-frac82.7%
/-rgt-identity82.7%
associate-/r/85.5%
Simplified85.5%
if -1.39999999999999998e-34 < a < 4.5999999999999998e-49Initial program 63.5%
+-commutative63.5%
associate-/l*76.3%
fma-define76.3%
Simplified76.3%
Taylor expanded in y around 0 62.1%
+-commutative62.1%
div-sub62.1%
mul-1-neg62.1%
associate-/l*70.8%
distribute-lft-neg-in70.8%
distribute-rgt-in76.3%
sub-neg76.3%
associate-*l/63.5%
associate-*r/69.6%
+-commutative69.6%
fma-define69.7%
Simplified69.7%
Taylor expanded in t around inf 69.9%
associate--l+69.9%
associate-*r/69.9%
associate-*r/69.9%
mul-1-neg69.9%
div-sub72.7%
mul-1-neg72.7%
distribute-lft-out--72.7%
associate-*r/72.7%
mul-1-neg72.7%
distribute-rgt-out--72.7%
associate-/l*83.5%
Simplified83.5%
Final simplification86.4%
(FPCore (x y z t a)
:precision binary64
(if (<= a -3.05e+123)
(+ x (* (- y x) (/ (- z t) a)))
(if (or (<= a -4.5e-37) (not (<= a 4.2e-165)))
(+ x (/ y (/ (- a t) (- z t))))
(+ y (* z (/ (- x y) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.05e+123) {
tmp = x + ((y - x) * ((z - t) / a));
} else if ((a <= -4.5e-37) || !(a <= 4.2e-165)) {
tmp = x + (y / ((a - t) / (z - t)));
} else {
tmp = y + (z * ((x - y) / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-3.05d+123)) then
tmp = x + ((y - x) * ((z - t) / a))
else if ((a <= (-4.5d-37)) .or. (.not. (a <= 4.2d-165))) then
tmp = x + (y / ((a - t) / (z - t)))
else
tmp = y + (z * ((x - y) / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.05e+123) {
tmp = x + ((y - x) * ((z - t) / a));
} else if ((a <= -4.5e-37) || !(a <= 4.2e-165)) {
tmp = x + (y / ((a - t) / (z - t)));
} else {
tmp = y + (z * ((x - y) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.05e+123: tmp = x + ((y - x) * ((z - t) / a)) elif (a <= -4.5e-37) or not (a <= 4.2e-165): tmp = x + (y / ((a - t) / (z - t))) else: tmp = y + (z * ((x - y) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.05e+123) tmp = Float64(x + Float64(Float64(y - x) * Float64(Float64(z - t) / a))); elseif ((a <= -4.5e-37) || !(a <= 4.2e-165)) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))); else tmp = Float64(y + Float64(z * Float64(Float64(x - y) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.05e+123) tmp = x + ((y - x) * ((z - t) / a)); elseif ((a <= -4.5e-37) || ~((a <= 4.2e-165))) tmp = x + (y / ((a - t) / (z - t))); else tmp = y + (z * ((x - y) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.05e+123], N[(x + N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -4.5e-37], N[Not[LessEqual[a, 4.2e-165]], $MachinePrecision]], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(z * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.05 \cdot 10^{+123}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z - t}{a}\\
\mathbf{elif}\;a \leq -4.5 \cdot 10^{-37} \lor \neg \left(a \leq 4.2 \cdot 10^{-165}\right):\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;y + z \cdot \frac{x - y}{t}\\
\end{array}
\end{array}
if a < -3.0500000000000001e123Initial program 65.3%
Taylor expanded in a around inf 63.6%
associate-/l*95.8%
Simplified95.8%
if -3.0500000000000001e123 < a < -4.5000000000000004e-37 or 4.1999999999999999e-165 < a Initial program 71.3%
clear-num71.2%
inv-pow71.2%
Applied egg-rr71.2%
unpow-171.2%
*-commutative71.2%
Simplified71.2%
Taylor expanded in y around inf 65.8%
*-rgt-identity65.8%
times-frac77.7%
/-rgt-identity77.7%
associate-/r/81.4%
Simplified81.4%
if -4.5000000000000004e-37 < a < 4.1999999999999999e-165Initial program 62.1%
+-commutative62.1%
associate-/l*75.7%
fma-define75.6%
Simplified75.6%
Taylor expanded in t around inf 73.0%
associate--l+73.0%
associate-*r/73.0%
associate-*r/73.0%
mul-1-neg73.0%
div-sub75.4%
mul-1-neg75.4%
distribute-lft-out--75.4%
associate-*r/75.4%
mul-1-neg75.4%
unsub-neg75.4%
distribute-rgt-out--75.4%
Simplified75.4%
Taylor expanded in z around inf 70.1%
associate-/l*78.6%
Simplified78.6%
Final simplification83.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y x) (/ (- z t) a)))))
(if (<= a -3.2e-44)
t_1
(if (<= a 8.2e-172)
(+ y (* z (/ (- x y) t)))
(if (<= a 1.22e+37) (* y (/ (- z t) (- a t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - x) * ((z - t) / a));
double tmp;
if (a <= -3.2e-44) {
tmp = t_1;
} else if (a <= 8.2e-172) {
tmp = y + (z * ((x - y) / t));
} else if (a <= 1.22e+37) {
tmp = y * ((z - t) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + ((y - x) * ((z - t) / a))
if (a <= (-3.2d-44)) then
tmp = t_1
else if (a <= 8.2d-172) then
tmp = y + (z * ((x - y) / t))
else if (a <= 1.22d+37) then
tmp = y * ((z - t) / (a - t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - x) * ((z - t) / a));
double tmp;
if (a <= -3.2e-44) {
tmp = t_1;
} else if (a <= 8.2e-172) {
tmp = y + (z * ((x - y) / t));
} else if (a <= 1.22e+37) {
tmp = y * ((z - t) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - x) * ((z - t) / a)) tmp = 0 if a <= -3.2e-44: tmp = t_1 elif a <= 8.2e-172: tmp = y + (z * ((x - y) / t)) elif a <= 1.22e+37: tmp = y * ((z - t) / (a - t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - x) * Float64(Float64(z - t) / a))) tmp = 0.0 if (a <= -3.2e-44) tmp = t_1; elseif (a <= 8.2e-172) tmp = Float64(y + Float64(z * Float64(Float64(x - y) / t))); elseif (a <= 1.22e+37) tmp = Float64(y * Float64(Float64(z - t) / Float64(a - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - x) * ((z - t) / a)); tmp = 0.0; if (a <= -3.2e-44) tmp = t_1; elseif (a <= 8.2e-172) tmp = y + (z * ((x - y) / t)); elseif (a <= 1.22e+37) tmp = y * ((z - t) / (a - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.2e-44], t$95$1, If[LessEqual[a, 8.2e-172], N[(y + N[(z * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.22e+37], N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - x\right) \cdot \frac{z - t}{a}\\
\mathbf{if}\;a \leq -3.2 \cdot 10^{-44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{-172}:\\
\;\;\;\;y + z \cdot \frac{x - y}{t}\\
\mathbf{elif}\;a \leq 1.22 \cdot 10^{+37}:\\
\;\;\;\;y \cdot \frac{z - t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.19999999999999995e-44 or 1.22e37 < a Initial program 69.7%
Taylor expanded in a around inf 65.0%
associate-/l*83.6%
Simplified83.6%
if -3.19999999999999995e-44 < a < 8.2e-172Initial program 62.4%
+-commutative62.4%
associate-/l*76.3%
fma-define76.3%
Simplified76.3%
Taylor expanded in t around inf 73.5%
associate--l+73.5%
associate-*r/73.5%
associate-*r/73.5%
mul-1-neg73.5%
div-sub76.0%
mul-1-neg76.0%
distribute-lft-out--76.0%
associate-*r/76.0%
mul-1-neg76.0%
unsub-neg76.0%
distribute-rgt-out--76.0%
Simplified76.0%
Taylor expanded in z around inf 70.5%
associate-/l*80.4%
Simplified80.4%
if 8.2e-172 < a < 1.22e37Initial program 69.3%
+-commutative69.3%
associate-/l*83.9%
fma-define83.9%
Simplified83.9%
Taylor expanded in y around 0 70.5%
+-commutative70.5%
div-sub70.5%
mul-1-neg70.5%
associate-/l*81.9%
distribute-lft-neg-in81.9%
distribute-rgt-in83.9%
sub-neg83.9%
associate-*l/69.3%
associate-*r/76.3%
+-commutative76.3%
fma-define76.7%
Simplified76.7%
Taylor expanded in y around inf 75.1%
div-sub75.1%
Simplified75.1%
Final simplification80.9%
(FPCore (x y z t a)
:precision binary64
(if (<= a -5.5e-42)
(- x (* z (/ (- x y) a)))
(if (<= a 6.5e-172)
(+ y (* z (/ (- x y) t)))
(if (<= a 1.65e+38)
(* y (/ (- z t) (- a t)))
(- x (* y (/ (- t z) a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.5e-42) {
tmp = x - (z * ((x - y) / a));
} else if (a <= 6.5e-172) {
tmp = y + (z * ((x - y) / t));
} else if (a <= 1.65e+38) {
tmp = y * ((z - t) / (a - t));
} else {
tmp = x - (y * ((t - z) / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-5.5d-42)) then
tmp = x - (z * ((x - y) / a))
else if (a <= 6.5d-172) then
tmp = y + (z * ((x - y) / t))
else if (a <= 1.65d+38) then
tmp = y * ((z - t) / (a - t))
else
tmp = x - (y * ((t - z) / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.5e-42) {
tmp = x - (z * ((x - y) / a));
} else if (a <= 6.5e-172) {
tmp = y + (z * ((x - y) / t));
} else if (a <= 1.65e+38) {
tmp = y * ((z - t) / (a - t));
} else {
tmp = x - (y * ((t - z) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.5e-42: tmp = x - (z * ((x - y) / a)) elif a <= 6.5e-172: tmp = y + (z * ((x - y) / t)) elif a <= 1.65e+38: tmp = y * ((z - t) / (a - t)) else: tmp = x - (y * ((t - z) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.5e-42) tmp = Float64(x - Float64(z * Float64(Float64(x - y) / a))); elseif (a <= 6.5e-172) tmp = Float64(y + Float64(z * Float64(Float64(x - y) / t))); elseif (a <= 1.65e+38) tmp = Float64(y * Float64(Float64(z - t) / Float64(a - t))); else tmp = Float64(x - Float64(y * Float64(Float64(t - z) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -5.5e-42) tmp = x - (z * ((x - y) / a)); elseif (a <= 6.5e-172) tmp = y + (z * ((x - y) / t)); elseif (a <= 1.65e+38) tmp = y * ((z - t) / (a - t)); else tmp = x - (y * ((t - z) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.5e-42], N[(x - N[(z * N[(N[(x - y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.5e-172], N[(y + N[(z * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.65e+38], N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{-42}:\\
\;\;\;\;x - z \cdot \frac{x - y}{a}\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-172}:\\
\;\;\;\;y + z \cdot \frac{x - y}{t}\\
\mathbf{elif}\;a \leq 1.65 \cdot 10^{+38}:\\
\;\;\;\;y \cdot \frac{z - t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t - z}{a}\\
\end{array}
\end{array}
if a < -5.5e-42Initial program 67.9%
Taylor expanded in t around 0 59.3%
associate-/l*77.2%
Simplified77.2%
if -5.5e-42 < a < 6.50000000000000012e-172Initial program 62.4%
+-commutative62.4%
associate-/l*76.3%
fma-define76.3%
Simplified76.3%
Taylor expanded in t around inf 73.5%
associate--l+73.5%
associate-*r/73.5%
associate-*r/73.5%
mul-1-neg73.5%
div-sub76.0%
mul-1-neg76.0%
distribute-lft-out--76.0%
associate-*r/76.0%
mul-1-neg76.0%
unsub-neg76.0%
distribute-rgt-out--76.0%
Simplified76.0%
Taylor expanded in z around inf 70.5%
associate-/l*80.4%
Simplified80.4%
if 6.50000000000000012e-172 < a < 1.65e38Initial program 69.3%
+-commutative69.3%
associate-/l*83.9%
fma-define83.9%
Simplified83.9%
Taylor expanded in y around 0 70.5%
+-commutative70.5%
div-sub70.5%
mul-1-neg70.5%
associate-/l*81.9%
distribute-lft-neg-in81.9%
distribute-rgt-in83.9%
sub-neg83.9%
associate-*l/69.3%
associate-*r/76.3%
+-commutative76.3%
fma-define76.7%
Simplified76.7%
Taylor expanded in y around inf 75.1%
div-sub75.1%
Simplified75.1%
if 1.65e38 < a Initial program 72.0%
Taylor expanded in a around inf 69.4%
associate-/l*84.6%
Simplified84.6%
Taylor expanded in y around inf 68.7%
associate-/l*78.3%
Simplified78.3%
Final simplification78.1%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2e+29)
x
(if (<= a -1.75e-255)
(* x (/ (- z a) t))
(if (<= a 4.5e+122) (* y (/ t (- t a))) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2e+29) {
tmp = x;
} else if (a <= -1.75e-255) {
tmp = x * ((z - a) / t);
} else if (a <= 4.5e+122) {
tmp = y * (t / (t - a));
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-2d+29)) then
tmp = x
else if (a <= (-1.75d-255)) then
tmp = x * ((z - a) / t)
else if (a <= 4.5d+122) then
tmp = y * (t / (t - a))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2e+29) {
tmp = x;
} else if (a <= -1.75e-255) {
tmp = x * ((z - a) / t);
} else if (a <= 4.5e+122) {
tmp = y * (t / (t - a));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2e+29: tmp = x elif a <= -1.75e-255: tmp = x * ((z - a) / t) elif a <= 4.5e+122: tmp = y * (t / (t - a)) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2e+29) tmp = x; elseif (a <= -1.75e-255) tmp = Float64(x * Float64(Float64(z - a) / t)); elseif (a <= 4.5e+122) tmp = Float64(y * Float64(t / Float64(t - a))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2e+29) tmp = x; elseif (a <= -1.75e-255) tmp = x * ((z - a) / t); elseif (a <= 4.5e+122) tmp = y * (t / (t - a)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2e+29], x, If[LessEqual[a, -1.75e-255], N[(x * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.5e+122], N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{+29}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -1.75 \cdot 10^{-255}:\\
\;\;\;\;x \cdot \frac{z - a}{t}\\
\mathbf{elif}\;a \leq 4.5 \cdot 10^{+122}:\\
\;\;\;\;y \cdot \frac{t}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.99999999999999983e29 or 4.49999999999999997e122 < a Initial program 69.0%
+-commutative69.0%
associate-/l*97.8%
fma-define97.8%
Simplified97.8%
Taylor expanded in a around inf 57.1%
if -1.99999999999999983e29 < a < -1.74999999999999989e-255Initial program 64.2%
+-commutative64.2%
associate-/l*75.0%
fma-define75.0%
Simplified75.0%
Taylor expanded in x around -inf 43.6%
associate-*r*43.6%
neg-mul-143.6%
+-commutative43.6%
Simplified43.6%
Taylor expanded in t around -inf 30.1%
associate-/l*40.8%
Simplified40.8%
if -1.74999999999999989e-255 < a < 4.49999999999999997e122Initial program 67.4%
+-commutative67.4%
associate-/l*83.9%
fma-define83.9%
Simplified83.9%
Taylor expanded in y around 0 73.2%
+-commutative73.2%
div-sub73.2%
mul-1-neg73.2%
associate-/l*80.9%
distribute-lft-neg-in80.9%
distribute-rgt-in83.9%
sub-neg83.9%
associate-*l/67.4%
associate-*r/79.3%
+-commutative79.3%
fma-define79.4%
Simplified79.4%
Taylor expanded in y around inf 69.3%
div-sub69.3%
Simplified69.3%
Taylor expanded in z around 0 45.7%
neg-mul-145.7%
distribute-neg-frac45.7%
Simplified45.7%
frac-2neg45.7%
div-inv45.6%
remove-double-neg45.6%
sub-neg45.6%
distribute-neg-in45.6%
remove-double-neg45.6%
Applied egg-rr45.6%
associate-*r/45.7%
*-rgt-identity45.7%
+-commutative45.7%
unsub-neg45.7%
Simplified45.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -9.5e+89) (not (<= a 1.22e+38))) (- x (* y (/ (- t z) a))) (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -9.5e+89) || !(a <= 1.22e+38)) {
tmp = x - (y * ((t - z) / a));
} else {
tmp = y * ((z - t) / (a - t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-9.5d+89)) .or. (.not. (a <= 1.22d+38))) then
tmp = x - (y * ((t - z) / a))
else
tmp = y * ((z - t) / (a - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -9.5e+89) || !(a <= 1.22e+38)) {
tmp = x - (y * ((t - z) / a));
} else {
tmp = y * ((z - t) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -9.5e+89) or not (a <= 1.22e+38): tmp = x - (y * ((t - z) / a)) else: tmp = y * ((z - t) / (a - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -9.5e+89) || !(a <= 1.22e+38)) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / a))); else tmp = Float64(y * Float64(Float64(z - t) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -9.5e+89) || ~((a <= 1.22e+38))) tmp = x - (y * ((t - z) / a)); else tmp = y * ((z - t) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -9.5e+89], N[Not[LessEqual[a, 1.22e+38]], $MachinePrecision]], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.5 \cdot 10^{+89} \lor \neg \left(a \leq 1.22 \cdot 10^{+38}\right):\\
\;\;\;\;x - y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z - t}{a - t}\\
\end{array}
\end{array}
if a < -9.5000000000000003e89 or 1.22e38 < a Initial program 69.3%
Taylor expanded in a around inf 66.6%
associate-/l*88.8%
Simplified88.8%
Taylor expanded in y around inf 69.1%
associate-/l*80.4%
Simplified80.4%
if -9.5000000000000003e89 < a < 1.22e38Initial program 65.8%
+-commutative65.8%
associate-/l*80.6%
fma-define80.6%
Simplified80.6%
Taylor expanded in y around 0 67.0%
+-commutative67.0%
div-sub67.0%
mul-1-neg67.0%
associate-/l*76.6%
distribute-lft-neg-in76.6%
distribute-rgt-in80.6%
sub-neg80.6%
associate-*l/65.8%
associate-*r/74.4%
+-commutative74.4%
fma-define74.4%
Simplified74.4%
Taylor expanded in y around inf 61.7%
div-sub61.7%
Simplified61.7%
Final simplification69.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.4e+130) (not (<= a 2.35e+123))) (+ x (/ y (/ a z))) (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.4e+130) || !(a <= 2.35e+123)) {
tmp = x + (y / (a / z));
} else {
tmp = y * ((z - t) / (a - t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.4d+130)) .or. (.not. (a <= 2.35d+123))) then
tmp = x + (y / (a / z))
else
tmp = y * ((z - t) / (a - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.4e+130) || !(a <= 2.35e+123)) {
tmp = x + (y / (a / z));
} else {
tmp = y * ((z - t) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.4e+130) or not (a <= 2.35e+123): tmp = x + (y / (a / z)) else: tmp = y * ((z - t) / (a - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.4e+130) || !(a <= 2.35e+123)) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(y * Float64(Float64(z - t) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.4e+130) || ~((a <= 2.35e+123))) tmp = x + (y / (a / z)); else tmp = y * ((z - t) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.4e+130], N[Not[LessEqual[a, 2.35e+123]], $MachinePrecision]], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.4 \cdot 10^{+130} \lor \neg \left(a \leq 2.35 \cdot 10^{+123}\right):\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z - t}{a - t}\\
\end{array}
\end{array}
if a < -1.3999999999999999e130 or 2.3499999999999999e123 < a Initial program 69.4%
clear-num69.4%
inv-pow69.4%
Applied egg-rr69.4%
unpow-169.4%
*-commutative69.4%
Simplified69.4%
Taylor expanded in y around inf 73.9%
*-rgt-identity73.9%
times-frac87.0%
/-rgt-identity87.0%
associate-/r/88.2%
Simplified88.2%
Taylor expanded in t around 0 77.5%
if -1.3999999999999999e130 < a < 2.3499999999999999e123Initial program 66.3%
+-commutative66.3%
associate-/l*82.4%
fma-define82.4%
Simplified82.4%
Taylor expanded in y around 0 70.4%
+-commutative70.4%
div-sub70.4%
mul-1-neg70.4%
associate-/l*79.0%
distribute-lft-neg-in79.0%
distribute-rgt-in82.4%
sub-neg82.4%
associate-*l/66.3%
associate-*r/76.6%
+-commutative76.6%
fma-define76.7%
Simplified76.7%
Taylor expanded in y around inf 60.8%
div-sub60.8%
Simplified60.8%
Final simplification65.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -5.5e+89) (- x (* z (/ (- x y) a))) (if (<= a 1.2e+37) (* y (/ (- z t) (- a t))) (- x (* y (/ (- t z) a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.5e+89) {
tmp = x - (z * ((x - y) / a));
} else if (a <= 1.2e+37) {
tmp = y * ((z - t) / (a - t));
} else {
tmp = x - (y * ((t - z) / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-5.5d+89)) then
tmp = x - (z * ((x - y) / a))
else if (a <= 1.2d+37) then
tmp = y * ((z - t) / (a - t))
else
tmp = x - (y * ((t - z) / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.5e+89) {
tmp = x - (z * ((x - y) / a));
} else if (a <= 1.2e+37) {
tmp = y * ((z - t) / (a - t));
} else {
tmp = x - (y * ((t - z) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.5e+89: tmp = x - (z * ((x - y) / a)) elif a <= 1.2e+37: tmp = y * ((z - t) / (a - t)) else: tmp = x - (y * ((t - z) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.5e+89) tmp = Float64(x - Float64(z * Float64(Float64(x - y) / a))); elseif (a <= 1.2e+37) tmp = Float64(y * Float64(Float64(z - t) / Float64(a - t))); else tmp = Float64(x - Float64(y * Float64(Float64(t - z) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -5.5e+89) tmp = x - (z * ((x - y) / a)); elseif (a <= 1.2e+37) tmp = y * ((z - t) / (a - t)); else tmp = x - (y * ((t - z) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.5e+89], N[(x - N[(z * N[(N[(x - y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.2e+37], N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{+89}:\\
\;\;\;\;x - z \cdot \frac{x - y}{a}\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{+37}:\\
\;\;\;\;y \cdot \frac{z - t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t - z}{a}\\
\end{array}
\end{array}
if a < -5.49999999999999976e89Initial program 66.4%
Taylor expanded in t around 0 60.7%
associate-/l*85.5%
Simplified85.5%
if -5.49999999999999976e89 < a < 1.2e37Initial program 65.8%
+-commutative65.8%
associate-/l*80.6%
fma-define80.6%
Simplified80.6%
Taylor expanded in y around 0 67.0%
+-commutative67.0%
div-sub67.0%
mul-1-neg67.0%
associate-/l*76.6%
distribute-lft-neg-in76.6%
distribute-rgt-in80.6%
sub-neg80.6%
associate-*l/65.8%
associate-*r/74.4%
+-commutative74.4%
fma-define74.4%
Simplified74.4%
Taylor expanded in y around inf 61.7%
div-sub61.7%
Simplified61.7%
if 1.2e37 < a Initial program 72.0%
Taylor expanded in a around inf 69.4%
associate-/l*84.6%
Simplified84.6%
Taylor expanded in y around inf 68.7%
associate-/l*78.3%
Simplified78.3%
Final simplification69.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -225000.0) (not (<= t 4.2e+19))) (* y (/ t (- t a))) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -225000.0) || !(t <= 4.2e+19)) {
tmp = y * (t / (t - a));
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-225000.0d0)) .or. (.not. (t <= 4.2d+19))) then
tmp = y * (t / (t - a))
else
tmp = x + (y / (a / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -225000.0) || !(t <= 4.2e+19)) {
tmp = y * (t / (t - a));
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -225000.0) or not (t <= 4.2e+19): tmp = y * (t / (t - a)) else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -225000.0) || !(t <= 4.2e+19)) tmp = Float64(y * Float64(t / Float64(t - a))); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -225000.0) || ~((t <= 4.2e+19))) tmp = y * (t / (t - a)); else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -225000.0], N[Not[LessEqual[t, 4.2e+19]], $MachinePrecision]], N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -225000 \lor \neg \left(t \leq 4.2 \cdot 10^{+19}\right):\\
\;\;\;\;y \cdot \frac{t}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -225000 or 4.2e19 < t Initial program 46.9%
+-commutative46.9%
associate-/l*79.9%
fma-define79.9%
Simplified79.9%
Taylor expanded in y around 0 60.0%
+-commutative60.0%
div-sub60.0%
mul-1-neg60.0%
associate-/l*79.1%
distribute-lft-neg-in79.1%
distribute-rgt-in79.9%
sub-neg79.9%
associate-*l/46.9%
associate-*r/75.7%
+-commutative75.7%
fma-define75.6%
Simplified75.6%
Taylor expanded in y around inf 59.6%
div-sub59.6%
Simplified59.6%
Taylor expanded in z around 0 51.6%
neg-mul-151.6%
distribute-neg-frac51.6%
Simplified51.6%
frac-2neg51.6%
div-inv51.5%
remove-double-neg51.5%
sub-neg51.5%
distribute-neg-in51.5%
remove-double-neg51.5%
Applied egg-rr51.5%
associate-*r/51.6%
*-rgt-identity51.6%
+-commutative51.6%
unsub-neg51.6%
Simplified51.6%
if -225000 < t < 4.2e19Initial program 85.7%
clear-num85.6%
inv-pow85.6%
Applied egg-rr85.6%
unpow-185.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in y around inf 71.2%
*-rgt-identity71.2%
times-frac72.1%
/-rgt-identity72.1%
associate-/r/75.5%
Simplified75.5%
Taylor expanded in t around 0 61.7%
Final simplification56.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -6.8e+34) x (if (<= a -2.6e-256) (* x (/ (- z a) t)) (if (<= a 1.95e+38) y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.8e+34) {
tmp = x;
} else if (a <= -2.6e-256) {
tmp = x * ((z - a) / t);
} else if (a <= 1.95e+38) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-6.8d+34)) then
tmp = x
else if (a <= (-2.6d-256)) then
tmp = x * ((z - a) / t)
else if (a <= 1.95d+38) then
tmp = y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.8e+34) {
tmp = x;
} else if (a <= -2.6e-256) {
tmp = x * ((z - a) / t);
} else if (a <= 1.95e+38) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6.8e+34: tmp = x elif a <= -2.6e-256: tmp = x * ((z - a) / t) elif a <= 1.95e+38: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.8e+34) tmp = x; elseif (a <= -2.6e-256) tmp = Float64(x * Float64(Float64(z - a) / t)); elseif (a <= 1.95e+38) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -6.8e+34) tmp = x; elseif (a <= -2.6e-256) tmp = x * ((z - a) / t); elseif (a <= 1.95e+38) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.8e+34], x, If[LessEqual[a, -2.6e-256], N[(x * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.95e+38], y, x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.8 \cdot 10^{+34}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -2.6 \cdot 10^{-256}:\\
\;\;\;\;x \cdot \frac{z - a}{t}\\
\mathbf{elif}\;a \leq 1.95 \cdot 10^{+38}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -6.7999999999999999e34 or 1.95000000000000012e38 < a Initial program 68.5%
+-commutative68.5%
associate-/l*96.3%
fma-define96.3%
Simplified96.3%
Taylor expanded in a around inf 52.4%
if -6.7999999999999999e34 < a < -2.6000000000000001e-256Initial program 64.2%
+-commutative64.2%
associate-/l*75.0%
fma-define75.0%
Simplified75.0%
Taylor expanded in x around -inf 43.6%
associate-*r*43.6%
neg-mul-143.6%
+-commutative43.6%
Simplified43.6%
Taylor expanded in t around -inf 30.1%
associate-/l*40.8%
Simplified40.8%
if -2.6000000000000001e-256 < a < 1.95000000000000012e38Initial program 67.8%
+-commutative67.8%
associate-/l*83.2%
fma-define83.2%
Simplified83.2%
Taylor expanded in y around 0 70.4%
+-commutative70.4%
div-sub70.4%
mul-1-neg70.4%
associate-/l*79.7%
distribute-lft-neg-in79.7%
distribute-rgt-in83.2%
sub-neg83.2%
associate-*l/67.8%
associate-*r/77.7%
+-commutative77.7%
fma-define77.8%
Simplified77.8%
Taylor expanded in t around inf 42.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.65e+86) x (if (<= a 1.75e+38) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.65e+86) {
tmp = x;
} else if (a <= 1.75e+38) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.65d+86)) then
tmp = x
else if (a <= 1.75d+38) then
tmp = y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.65e+86) {
tmp = x;
} else if (a <= 1.75e+38) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.65e+86: tmp = x elif a <= 1.75e+38: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.65e+86) tmp = x; elseif (a <= 1.75e+38) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.65e+86) tmp = x; elseif (a <= 1.75e+38) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.65e+86], x, If[LessEqual[a, 1.75e+38], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.65 \cdot 10^{+86}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.75 \cdot 10^{+38}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.65e86 or 1.75000000000000001e38 < a Initial program 68.7%
+-commutative68.7%
associate-/l*96.2%
fma-define96.2%
Simplified96.2%
Taylor expanded in a around inf 52.9%
if -1.65e86 < a < 1.75000000000000001e38Initial program 66.2%
+-commutative66.2%
associate-/l*80.5%
fma-define80.5%
Simplified80.5%
Taylor expanded in y around 0 66.8%
+-commutative66.8%
div-sub66.8%
mul-1-neg66.8%
associate-/l*76.4%
distribute-lft-neg-in76.4%
distribute-rgt-in80.5%
sub-neg80.5%
associate-*l/66.2%
associate-*r/74.3%
+-commutative74.3%
fma-define74.3%
Simplified74.3%
Taylor expanded in t around inf 37.0%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 67.2%
+-commutative67.2%
associate-/l*87.0%
fma-define87.0%
Simplified87.0%
Taylor expanded in a around inf 27.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t))))))
(if (< a -1.6153062845442575e-142)
t_1
(if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
double tmp;
if (a < -1.6153062845442575e-142) {
tmp = t_1;
} else if (a < 3.774403170083174e-182) {
tmp = y - ((z / t) * (y - x));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (((y - x) / 1.0d0) * ((z - t) / (a - t)))
if (a < (-1.6153062845442575d-142)) then
tmp = t_1
else if (a < 3.774403170083174d-182) then
tmp = y - ((z / t) * (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 a) {
double t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
double tmp;
if (a < -1.6153062845442575e-142) {
tmp = t_1;
} else if (a < 3.774403170083174e-182) {
tmp = y - ((z / t) * (y - x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t))) tmp = 0 if a < -1.6153062845442575e-142: tmp = t_1 elif a < 3.774403170083174e-182: tmp = y - ((z / t) * (y - x)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - x) / 1.0) * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (a < -1.6153062845442575e-142) tmp = t_1; elseif (a < 3.774403170083174e-182) tmp = Float64(y - Float64(Float64(z / t) * Float64(y - x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t))); tmp = 0.0; if (a < -1.6153062845442575e-142) tmp = t_1; elseif (a < 3.774403170083174e-182) tmp = y - ((z / t) * (y - x)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] / 1.0), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[a, -1.6153062845442575e-142], t$95$1, If[Less[a, 3.774403170083174e-182], N[(y - N[(N[(z / t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;a < -1.6153062845442575 \cdot 10^{-142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a < 3.774403170083174 \cdot 10^{-182}:\\
\;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024170
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (if (< a -646122513817703/4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))) (if (< a 1887201585041587/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))))))
(+ x (/ (* (- y x) (- z t)) (- a t))))