
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (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 * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (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 * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (<= (+ x (/ (* y (- z t)) (- a t))) -4e+117) (+ x (* (- z t) (* y (/ -1.0 (- t a))))) (fma y (/ (- z t) (- a t)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x + ((y * (z - t)) / (a - t))) <= -4e+117) {
tmp = x + ((z - t) * (y * (-1.0 / (t - a))));
} else {
tmp = fma(y, ((z - t) / (a - t)), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) <= -4e+117) tmp = Float64(x + Float64(Float64(z - t) * Float64(y * Float64(-1.0 / Float64(t - a))))); else tmp = fma(y, Float64(Float64(z - t) / Float64(a - t)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -4e+117], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y * N[(-1.0 / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + \frac{y \cdot \left(z - t\right)}{a - t} \leq -4 \cdot 10^{+117}:\\
\;\;\;\;x + \left(z - t\right) \cdot \left(y \cdot \frac{-1}{t - a}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a - t}, x\right)\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t))) < -4.0000000000000002e117Initial program 71.7%
div-inv71.7%
*-commutative71.7%
associate-*l*99.9%
Applied egg-rr99.9%
if -4.0000000000000002e117 < (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t))) Initial program 89.0%
+-commutative89.0%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* z (/ y a)))) (t_2 (- x (* y (/ z t)))))
(if (<= t -1.26e+187)
(+ x y)
(if (<= t -2.35e+42)
t_2
(if (<= t -1.05e-14)
t_1
(if (<= t -6.7e-68)
t_2
(if (or (<= t -7.5e-83) (not (<= t 24.0))) (+ x y) t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z * (y / a));
double t_2 = x - (y * (z / t));
double tmp;
if (t <= -1.26e+187) {
tmp = x + y;
} else if (t <= -2.35e+42) {
tmp = t_2;
} else if (t <= -1.05e-14) {
tmp = t_1;
} else if (t <= -6.7e-68) {
tmp = t_2;
} else if ((t <= -7.5e-83) || !(t <= 24.0)) {
tmp = x + y;
} 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) :: t_2
real(8) :: tmp
t_1 = x + (z * (y / a))
t_2 = x - (y * (z / t))
if (t <= (-1.26d+187)) then
tmp = x + y
else if (t <= (-2.35d+42)) then
tmp = t_2
else if (t <= (-1.05d-14)) then
tmp = t_1
else if (t <= (-6.7d-68)) then
tmp = t_2
else if ((t <= (-7.5d-83)) .or. (.not. (t <= 24.0d0))) then
tmp = x + y
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 + (z * (y / a));
double t_2 = x - (y * (z / t));
double tmp;
if (t <= -1.26e+187) {
tmp = x + y;
} else if (t <= -2.35e+42) {
tmp = t_2;
} else if (t <= -1.05e-14) {
tmp = t_1;
} else if (t <= -6.7e-68) {
tmp = t_2;
} else if ((t <= -7.5e-83) || !(t <= 24.0)) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (z * (y / a)) t_2 = x - (y * (z / t)) tmp = 0 if t <= -1.26e+187: tmp = x + y elif t <= -2.35e+42: tmp = t_2 elif t <= -1.05e-14: tmp = t_1 elif t <= -6.7e-68: tmp = t_2 elif (t <= -7.5e-83) or not (t <= 24.0): tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(z * Float64(y / a))) t_2 = Float64(x - Float64(y * Float64(z / t))) tmp = 0.0 if (t <= -1.26e+187) tmp = Float64(x + y); elseif (t <= -2.35e+42) tmp = t_2; elseif (t <= -1.05e-14) tmp = t_1; elseif (t <= -6.7e-68) tmp = t_2; elseif ((t <= -7.5e-83) || !(t <= 24.0)) tmp = Float64(x + y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (z * (y / a)); t_2 = x - (y * (z / t)); tmp = 0.0; if (t <= -1.26e+187) tmp = x + y; elseif (t <= -2.35e+42) tmp = t_2; elseif (t <= -1.05e-14) tmp = t_1; elseif (t <= -6.7e-68) tmp = t_2; elseif ((t <= -7.5e-83) || ~((t <= 24.0))) tmp = x + y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.26e+187], N[(x + y), $MachinePrecision], If[LessEqual[t, -2.35e+42], t$95$2, If[LessEqual[t, -1.05e-14], t$95$1, If[LessEqual[t, -6.7e-68], t$95$2, If[Or[LessEqual[t, -7.5e-83], N[Not[LessEqual[t, 24.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \frac{y}{a}\\
t_2 := x - y \cdot \frac{z}{t}\\
\mathbf{if}\;t \leq -1.26 \cdot 10^{+187}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -2.35 \cdot 10^{+42}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -1.05 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -6.7 \cdot 10^{-68}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -7.5 \cdot 10^{-83} \lor \neg \left(t \leq 24\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.26e187 or -6.6999999999999996e-68 < t < -7.4999999999999997e-83 or 24 < t Initial program 66.1%
Taylor expanded in t around inf 79.4%
+-commutative79.4%
Simplified79.4%
if -1.26e187 < t < -2.34999999999999993e42 or -1.0499999999999999e-14 < t < -6.6999999999999996e-68Initial program 91.5%
Taylor expanded in z around inf 81.0%
Taylor expanded in a around 0 76.9%
mul-1-neg76.9%
associate-/l*79.9%
distribute-lft-neg-in79.9%
Simplified79.9%
add-sqr-sqrt30.7%
fma-define30.7%
distribute-lft-neg-out30.7%
add-sqr-sqrt14.6%
sqrt-unprod21.7%
sqr-neg21.7%
sqrt-unprod9.0%
add-sqr-sqrt15.0%
*-commutative15.0%
*-commutative15.0%
fma-neg15.0%
add-sqr-sqrt46.2%
add-sqr-sqrt21.0%
sqrt-unprod52.2%
sqr-neg52.2%
sqrt-unprod40.1%
add-sqr-sqrt79.9%
Applied egg-rr79.9%
if -2.34999999999999993e42 < t < -1.0499999999999999e-14 or -7.4999999999999997e-83 < t < 24Initial program 94.5%
Taylor expanded in t around 0 79.4%
associate-/l*80.7%
Simplified80.7%
*-commutative80.7%
associate-*l/79.4%
Applied egg-rr79.4%
associate-/l*83.5%
Applied egg-rr83.5%
Final simplification81.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (- 1.0 (/ z t))))))
(if (<= t -0.225)
t_1
(if (<= t -9e-15)
(+ x (/ y (/ a (- z t))))
(if (<= t -7.5e-83)
t_1
(if (<= t 5e-40)
(+ x (/ (* y z) (- a t)))
(if (<= t 9.5e+75) (+ x (* y (/ z (- a t)))) t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (1.0 - (z / t)));
double tmp;
if (t <= -0.225) {
tmp = t_1;
} else if (t <= -9e-15) {
tmp = x + (y / (a / (z - t)));
} else if (t <= -7.5e-83) {
tmp = t_1;
} else if (t <= 5e-40) {
tmp = x + ((y * z) / (a - t));
} else if (t <= 9.5e+75) {
tmp = x + (y * (z / (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 * (1.0d0 - (z / t)))
if (t <= (-0.225d0)) then
tmp = t_1
else if (t <= (-9d-15)) then
tmp = x + (y / (a / (z - t)))
else if (t <= (-7.5d-83)) then
tmp = t_1
else if (t <= 5d-40) then
tmp = x + ((y * z) / (a - t))
else if (t <= 9.5d+75) then
tmp = x + (y * (z / (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 * (1.0 - (z / t)));
double tmp;
if (t <= -0.225) {
tmp = t_1;
} else if (t <= -9e-15) {
tmp = x + (y / (a / (z - t)));
} else if (t <= -7.5e-83) {
tmp = t_1;
} else if (t <= 5e-40) {
tmp = x + ((y * z) / (a - t));
} else if (t <= 9.5e+75) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (1.0 - (z / t))) tmp = 0 if t <= -0.225: tmp = t_1 elif t <= -9e-15: tmp = x + (y / (a / (z - t))) elif t <= -7.5e-83: tmp = t_1 elif t <= 5e-40: tmp = x + ((y * z) / (a - t)) elif t <= 9.5e+75: tmp = x + (y * (z / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(1.0 - Float64(z / t)))) tmp = 0.0 if (t <= -0.225) tmp = t_1; elseif (t <= -9e-15) tmp = Float64(x + Float64(y / Float64(a / Float64(z - t)))); elseif (t <= -7.5e-83) tmp = t_1; elseif (t <= 5e-40) tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); elseif (t <= 9.5e+75) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (1.0 - (z / t))); tmp = 0.0; if (t <= -0.225) tmp = t_1; elseif (t <= -9e-15) tmp = x + (y / (a / (z - t))); elseif (t <= -7.5e-83) tmp = t_1; elseif (t <= 5e-40) tmp = x + ((y * z) / (a - t)); elseif (t <= 9.5e+75) tmp = x + (y * (z / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -0.225], t$95$1, If[LessEqual[t, -9e-15], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -7.5e-83], t$95$1, If[LessEqual[t, 5e-40], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e+75], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{if}\;t \leq -0.225:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -9 \cdot 10^{-15}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;t \leq -7.5 \cdot 10^{-83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-40}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+75}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -0.225000000000000006 or -8.9999999999999995e-15 < t < -7.4999999999999997e-83 or 9.50000000000000061e75 < t Initial program 73.4%
Taylor expanded in a around 0 68.3%
mul-1-neg68.3%
unsub-neg68.3%
associate-/l*91.1%
div-sub91.1%
sub-neg91.1%
*-inverses91.1%
metadata-eval91.1%
Simplified91.1%
if -0.225000000000000006 < t < -8.9999999999999995e-15Initial program 68.7%
associate-/l*99.7%
clear-num99.5%
un-div-inv99.2%
Applied egg-rr99.2%
Taylor expanded in a around inf 99.2%
if -7.4999999999999997e-83 < t < 4.99999999999999965e-40Initial program 95.8%
Taylor expanded in z around inf 91.0%
if 4.99999999999999965e-40 < t < 9.50000000000000061e75Initial program 94.1%
div-inv94.3%
*-commutative94.3%
associate-*l*100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 89.3%
associate-/l*95.1%
Simplified95.1%
Final simplification91.5%
(FPCore (x y z t a) :precision binary64 (if (<= (+ x (/ (* y (- z t)) (- a t))) -5e+38) (+ x (* (- z t) (* y (/ -1.0 (- t a))))) (+ x (/ y (/ (- a t) (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x + ((y * (z - t)) / (a - t))) <= -5e+38) {
tmp = x + ((z - t) * (y * (-1.0 / (t - a))));
} else {
tmp = x + (y / ((a - t) / (z - 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 ((x + ((y * (z - t)) / (a - t))) <= (-5d+38)) then
tmp = x + ((z - t) * (y * ((-1.0d0) / (t - a))))
else
tmp = x + (y / ((a - t) / (z - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x + ((y * (z - t)) / (a - t))) <= -5e+38) {
tmp = x + ((z - t) * (y * (-1.0 / (t - a))));
} else {
tmp = x + (y / ((a - t) / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x + ((y * (z - t)) / (a - t))) <= -5e+38: tmp = x + ((z - t) * (y * (-1.0 / (t - a)))) else: tmp = x + (y / ((a - t) / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) <= -5e+38) tmp = Float64(x + Float64(Float64(z - t) * Float64(y * Float64(-1.0 / Float64(t - a))))); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x + ((y * (z - t)) / (a - t))) <= -5e+38) tmp = x + ((z - t) * (y * (-1.0 / (t - a)))); else tmp = x + (y / ((a - t) / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e+38], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y * N[(-1.0 / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + \frac{y \cdot \left(z - t\right)}{a - t} \leq -5 \cdot 10^{+38}:\\
\;\;\;\;x + \left(z - t\right) \cdot \left(y \cdot \frac{-1}{t - a}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t))) < -4.9999999999999997e38Initial program 78.0%
div-inv78.0%
*-commutative78.0%
associate-*l*99.8%
Applied egg-rr99.8%
if -4.9999999999999997e38 < (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t))) Initial program 87.8%
associate-/l*99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.7e-48) (not (<= z 230000.0))) (+ x (* y (/ z (- a t)))) (+ x (* t (/ y (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.7e-48) || !(z <= 230000.0)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + (t * (y / (t - 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 ((z <= (-2.7d-48)) .or. (.not. (z <= 230000.0d0))) then
tmp = x + (y * (z / (a - t)))
else
tmp = x + (t * (y / (t - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.7e-48) || !(z <= 230000.0)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + (t * (y / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.7e-48) or not (z <= 230000.0): tmp = x + (y * (z / (a - t))) else: tmp = x + (t * (y / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.7e-48) || !(z <= 230000.0)) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); else tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.7e-48) || ~((z <= 230000.0))) tmp = x + (y * (z / (a - t))); else tmp = x + (t * (y / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.7e-48], N[Not[LessEqual[z, 230000.0]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-48} \lor \neg \left(z \leq 230000\right):\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\end{array}
\end{array}
if z < -2.70000000000000011e-48 or 2.3e5 < z Initial program 84.5%
div-inv84.5%
*-commutative84.5%
associate-*l*97.7%
Applied egg-rr97.7%
Taylor expanded in z around inf 79.6%
associate-/l*83.9%
Simplified83.9%
if -2.70000000000000011e-48 < z < 2.3e5Initial program 84.6%
Taylor expanded in z around 0 75.3%
mul-1-neg75.3%
associate-/l*91.5%
distribute-rgt-neg-in91.5%
distribute-frac-neg91.5%
Simplified91.5%
Final simplification87.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.95e+188) (not (<= t 2.15e+126))) (+ x y) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.95e+188) || !(t <= 2.15e+126)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (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 ((t <= (-1.95d+188)) .or. (.not. (t <= 2.15d+126))) then
tmp = x + y
else
tmp = x + (y * (z / (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 ((t <= -1.95e+188) || !(t <= 2.15e+126)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.95e+188) or not (t <= 2.15e+126): tmp = x + y else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.95e+188) || !(t <= 2.15e+126)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.95e+188) || ~((t <= 2.15e+126))) tmp = x + y; else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.95e+188], N[Not[LessEqual[t, 2.15e+126]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{+188} \lor \neg \left(t \leq 2.15 \cdot 10^{+126}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -1.95e188 or 2.1500000000000001e126 < t Initial program 58.0%
Taylor expanded in t around inf 83.6%
+-commutative83.6%
Simplified83.6%
if -1.95e188 < t < 2.1500000000000001e126Initial program 94.0%
div-inv93.9%
*-commutative93.9%
associate-*l*97.8%
Applied egg-rr97.8%
Taylor expanded in z around inf 86.2%
associate-/l*87.5%
Simplified87.5%
Final simplification86.5%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.01e-25) (- x (/ (* y z) t)) (if (<= x 1.85e-156) (* (- z t) (/ y (- a t))) (+ x (* z (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.01e-25) {
tmp = x - ((y * z) / t);
} else if (x <= 1.85e-156) {
tmp = (z - t) * (y / (a - t));
} else {
tmp = x + (z * (y / 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 (x <= (-1.01d-25)) then
tmp = x - ((y * z) / t)
else if (x <= 1.85d-156) then
tmp = (z - t) * (y / (a - t))
else
tmp = x + (z * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.01e-25) {
tmp = x - ((y * z) / t);
} else if (x <= 1.85e-156) {
tmp = (z - t) * (y / (a - t));
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.01e-25: tmp = x - ((y * z) / t) elif x <= 1.85e-156: tmp = (z - t) * (y / (a - t)) else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.01e-25) tmp = Float64(x - Float64(Float64(y * z) / t)); elseif (x <= 1.85e-156) tmp = Float64(Float64(z - t) * Float64(y / Float64(a - t))); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.01e-25) tmp = x - ((y * z) / t); elseif (x <= 1.85e-156) tmp = (z - t) * (y / (a - t)); else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.01e-25], N[(x - N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.85e-156], N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.01 \cdot 10^{-25}:\\
\;\;\;\;x - \frac{y \cdot z}{t}\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{-156}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if x < -1.01000000000000001e-25Initial program 87.7%
Taylor expanded in z around inf 90.4%
Taylor expanded in a around 0 74.4%
mul-1-neg74.4%
unsub-neg74.4%
Simplified74.4%
if -1.01000000000000001e-25 < x < 1.85e-156Initial program 78.7%
Taylor expanded in x around 0 60.6%
*-rgt-identity60.6%
times-frac77.5%
/-rgt-identity77.5%
Simplified77.5%
if 1.85e-156 < x Initial program 88.5%
Taylor expanded in t around 0 72.6%
associate-/l*74.8%
Simplified74.8%
*-commutative74.8%
associate-*l/72.6%
Applied egg-rr72.6%
associate-/l*75.8%
Applied egg-rr75.8%
Final simplification76.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -0.044) (not (<= t 490.0))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -0.044) || !(t <= 490.0)) {
tmp = x + y;
} else {
tmp = x + (z * (y / 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 ((t <= (-0.044d0)) .or. (.not. (t <= 490.0d0))) then
tmp = x + y
else
tmp = x + (z * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -0.044) || !(t <= 490.0)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -0.044) or not (t <= 490.0): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -0.044) || !(t <= 490.0)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -0.044) || ~((t <= 490.0))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -0.044], N[Not[LessEqual[t, 490.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.044 \lor \neg \left(t \leq 490\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -0.043999999999999997 or 490 < t Initial program 72.0%
Taylor expanded in t around inf 73.7%
+-commutative73.7%
Simplified73.7%
if -0.043999999999999997 < t < 490Initial program 94.7%
Taylor expanded in t around 0 77.5%
associate-/l*79.4%
Simplified79.4%
*-commutative79.4%
associate-*l/77.5%
Applied egg-rr77.5%
associate-/l*81.4%
Applied egg-rr81.4%
Final simplification78.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -0.021) (not (<= t 0.205))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -0.021) || !(t <= 0.205)) {
tmp = x + y;
} else {
tmp = x + (y * (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 ((t <= (-0.021d0)) .or. (.not. (t <= 0.205d0))) then
tmp = x + y
else
tmp = x + (y * (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 ((t <= -0.021) || !(t <= 0.205)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -0.021) or not (t <= 0.205): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -0.021) || !(t <= 0.205)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -0.021) || ~((t <= 0.205))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -0.021], N[Not[LessEqual[t, 0.205]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.021 \lor \neg \left(t \leq 0.205\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -0.0210000000000000013 or 0.204999999999999988 < t Initial program 72.0%
Taylor expanded in t around inf 73.7%
+-commutative73.7%
Simplified73.7%
if -0.0210000000000000013 < t < 0.204999999999999988Initial program 94.7%
Taylor expanded in t around 0 77.5%
associate-/l*79.4%
Simplified79.4%
Final simplification76.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7e-91) (not (<= t 2.6e+110))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7e-91) || !(t <= 2.6e+110)) {
tmp = x + 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 ((t <= (-7d-91)) .or. (.not. (t <= 2.6d+110))) then
tmp = x + 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 ((t <= -7e-91) || !(t <= 2.6e+110)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7e-91) or not (t <= 2.6e+110): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7e-91) || !(t <= 2.6e+110)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7e-91) || ~((t <= 2.6e+110))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7e-91], N[Not[LessEqual[t, 2.6e+110]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{-91} \lor \neg \left(t \leq 2.6 \cdot 10^{+110}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -6.9999999999999997e-91 or 2.6e110 < t Initial program 71.8%
Taylor expanded in t around inf 73.5%
+-commutative73.5%
Simplified73.5%
if -6.9999999999999997e-91 < t < 2.6e110Initial program 95.8%
Taylor expanded in x around inf 52.1%
Final simplification62.1%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - 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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
Initial program 84.6%
associate-/l*97.6%
clear-num97.6%
un-div-inv97.6%
Applied egg-rr97.6%
(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 84.6%
Taylor expanded in x around inf 49.7%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - 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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
herbie shell --seed 2024096
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:alt
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))