
(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 14 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))) -1e-8) (fma (/ y (- a t)) (- z t) x) (+ x (* y (/ (- z t) (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x + ((y * (z - t)) / (a - t))) <= -1e-8) {
tmp = fma((y / (a - t)), (z - t), x);
} else {
tmp = x + (y * ((z - t) / (a - 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))) <= -1e-8) tmp = fma(Float64(y / Float64(a - t)), Float64(z - t), x); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))); 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], -1e-8], N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + \frac{y \cdot \left(z - t\right)}{a - t} \leq -1 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a - t}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t))) < -1e-8Initial program 80.3%
+-commutative80.3%
associate-*l/100.0%
fma-def100.0%
Simplified100.0%
if -1e-8 < (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t))) Initial program 87.1%
associate-/l*99.8%
Simplified99.8%
clear-num99.8%
associate-/r/99.8%
clear-num99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* z (/ y a)))) (t_2 (- x (/ y (/ t z)))))
(if (<= t -6.5e+186)
(+ x y)
(if (<= t -2e+42)
t_2
(if (<= t -9.6e-15)
t_1
(if (<= t -4.8e-68)
t_2
(if (or (<= t -7.5e-83) (not (<= t 1360.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 / (t / z));
double tmp;
if (t <= -6.5e+186) {
tmp = x + y;
} else if (t <= -2e+42) {
tmp = t_2;
} else if (t <= -9.6e-15) {
tmp = t_1;
} else if (t <= -4.8e-68) {
tmp = t_2;
} else if ((t <= -7.5e-83) || !(t <= 1360.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 / (t / z))
if (t <= (-6.5d+186)) then
tmp = x + y
else if (t <= (-2d+42)) then
tmp = t_2
else if (t <= (-9.6d-15)) then
tmp = t_1
else if (t <= (-4.8d-68)) then
tmp = t_2
else if ((t <= (-7.5d-83)) .or. (.not. (t <= 1360.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 / (t / z));
double tmp;
if (t <= -6.5e+186) {
tmp = x + y;
} else if (t <= -2e+42) {
tmp = t_2;
} else if (t <= -9.6e-15) {
tmp = t_1;
} else if (t <= -4.8e-68) {
tmp = t_2;
} else if ((t <= -7.5e-83) || !(t <= 1360.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 / (t / z)) tmp = 0 if t <= -6.5e+186: tmp = x + y elif t <= -2e+42: tmp = t_2 elif t <= -9.6e-15: tmp = t_1 elif t <= -4.8e-68: tmp = t_2 elif (t <= -7.5e-83) or not (t <= 1360.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(t / z))) tmp = 0.0 if (t <= -6.5e+186) tmp = Float64(x + y); elseif (t <= -2e+42) tmp = t_2; elseif (t <= -9.6e-15) tmp = t_1; elseif (t <= -4.8e-68) tmp = t_2; elseif ((t <= -7.5e-83) || !(t <= 1360.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 / (t / z)); tmp = 0.0; if (t <= -6.5e+186) tmp = x + y; elseif (t <= -2e+42) tmp = t_2; elseif (t <= -9.6e-15) tmp = t_1; elseif (t <= -4.8e-68) tmp = t_2; elseif ((t <= -7.5e-83) || ~((t <= 1360.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[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.5e+186], N[(x + y), $MachinePrecision], If[LessEqual[t, -2e+42], t$95$2, If[LessEqual[t, -9.6e-15], t$95$1, If[LessEqual[t, -4.8e-68], t$95$2, If[Or[LessEqual[t, -7.5e-83], N[Not[LessEqual[t, 1360.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 - \frac{y}{\frac{t}{z}}\\
\mathbf{if}\;t \leq -6.5 \cdot 10^{+186}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -2 \cdot 10^{+42}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -9.6 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -4.8 \cdot 10^{-68}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -7.5 \cdot 10^{-83} \lor \neg \left(t \leq 1360\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.4999999999999997e186 or -4.79999999999999982e-68 < t < -7.4999999999999997e-83 or 1360 < t Initial program 66.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 79.4%
+-commutative79.4%
Simplified79.4%
if -6.4999999999999997e186 < t < -2.00000000000000009e42 or -9.5999999999999998e-15 < t < -4.79999999999999982e-68Initial program 91.5%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 81.0%
Taylor expanded in a around 0 76.9%
mul-1-neg76.9%
unsub-neg76.9%
associate-/l*79.8%
Simplified79.8%
if -2.00000000000000009e42 < t < -9.5999999999999998e-15 or -7.4999999999999997e-83 < t < 1360Initial program 94.5%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in t around 0 79.4%
+-commutative79.4%
associate-/l*80.7%
Simplified80.7%
associate-/r/83.5%
Applied egg-rr83.5%
Final simplification81.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* z (/ y a)))))
(if (<= x -7.6e+236)
t_1
(if (<= x -88.0)
(- x (/ y (/ t z)))
(if (<= x -2.9e-49)
(+ x y)
(if (<= x 1.85e-156) (* (- z t) (/ y (- a t))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z * (y / a));
double tmp;
if (x <= -7.6e+236) {
tmp = t_1;
} else if (x <= -88.0) {
tmp = x - (y / (t / z));
} else if (x <= -2.9e-49) {
tmp = x + y;
} else if (x <= 1.85e-156) {
tmp = (z - t) * (y / (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 + (z * (y / a))
if (x <= (-7.6d+236)) then
tmp = t_1
else if (x <= (-88.0d0)) then
tmp = x - (y / (t / z))
else if (x <= (-2.9d-49)) then
tmp = x + y
else if (x <= 1.85d-156) then
tmp = (z - t) * (y / (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 + (z * (y / a));
double tmp;
if (x <= -7.6e+236) {
tmp = t_1;
} else if (x <= -88.0) {
tmp = x - (y / (t / z));
} else if (x <= -2.9e-49) {
tmp = x + y;
} else if (x <= 1.85e-156) {
tmp = (z - t) * (y / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (z * (y / a)) tmp = 0 if x <= -7.6e+236: tmp = t_1 elif x <= -88.0: tmp = x - (y / (t / z)) elif x <= -2.9e-49: tmp = x + y elif x <= 1.85e-156: tmp = (z - t) * (y / (a - t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(z * Float64(y / a))) tmp = 0.0 if (x <= -7.6e+236) tmp = t_1; elseif (x <= -88.0) tmp = Float64(x - Float64(y / Float64(t / z))); elseif (x <= -2.9e-49) tmp = Float64(x + y); elseif (x <= 1.85e-156) tmp = Float64(Float64(z - t) * Float64(y / Float64(a - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (z * (y / a)); tmp = 0.0; if (x <= -7.6e+236) tmp = t_1; elseif (x <= -88.0) tmp = x - (y / (t / z)); elseif (x <= -2.9e-49) tmp = x + y; elseif (x <= 1.85e-156) tmp = (z - t) * (y / (a - t)); 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]}, If[LessEqual[x, -7.6e+236], t$95$1, If[LessEqual[x, -88.0], N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.9e-49], N[(x + y), $MachinePrecision], If[LessEqual[x, 1.85e-156], N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \frac{y}{a}\\
\mathbf{if}\;x \leq -7.6 \cdot 10^{+236}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -88:\\
\;\;\;\;x - \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{-49}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{-156}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.59999999999999973e236 or 1.85e-156 < x Initial program 87.9%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in t around 0 74.8%
+-commutative74.8%
associate-/l*73.2%
Simplified73.2%
associate-/r/78.4%
Applied egg-rr78.4%
if -7.59999999999999973e236 < x < -88Initial program 89.5%
associate-/l*97.8%
Simplified97.8%
Taylor expanded in z around inf 93.7%
Taylor expanded in a around 0 74.7%
mul-1-neg74.7%
unsub-neg74.7%
associate-/l*74.7%
Simplified74.7%
if -88 < x < -2.9e-49Initial program 79.8%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 79.7%
+-commutative79.7%
Simplified79.7%
if -2.9e-49 < x < 1.85e-156Initial program 78.6%
+-commutative78.6%
associate-*l/95.1%
fma-def95.1%
Simplified95.1%
clear-num93.2%
inv-pow93.2%
Applied egg-rr93.2%
unpow-193.2%
Simplified93.2%
Taylor expanded in y around -inf 64.2%
associate-*l/80.7%
*-commutative80.7%
Simplified80.7%
Final simplification78.6%
(FPCore (x y z t a)
:precision binary64
(if (or (<= z -5.2e+212)
(and (not (<= z 5.2e+42)) (or (<= z 9.5e+144) (not (<= z 6e+182)))))
(* z (/ y (- a t)))
(+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.2e+212) || (!(z <= 5.2e+42) && ((z <= 9.5e+144) || !(z <= 6e+182)))) {
tmp = z * (y / (a - t));
} else {
tmp = 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 ((z <= (-5.2d+212)) .or. (.not. (z <= 5.2d+42)) .and. (z <= 9.5d+144) .or. (.not. (z <= 6d+182))) then
tmp = z * (y / (a - t))
else
tmp = 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 ((z <= -5.2e+212) || (!(z <= 5.2e+42) && ((z <= 9.5e+144) || !(z <= 6e+182)))) {
tmp = z * (y / (a - t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.2e+212) or (not (z <= 5.2e+42) and ((z <= 9.5e+144) or not (z <= 6e+182))): tmp = z * (y / (a - t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.2e+212) || (!(z <= 5.2e+42) && ((z <= 9.5e+144) || !(z <= 6e+182)))) tmp = Float64(z * Float64(y / Float64(a - t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.2e+212) || (~((z <= 5.2e+42)) && ((z <= 9.5e+144) || ~((z <= 6e+182))))) tmp = z * (y / (a - t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.2e+212], And[N[Not[LessEqual[z, 5.2e+42]], $MachinePrecision], Or[LessEqual[z, 9.5e+144], N[Not[LessEqual[z, 6e+182]], $MachinePrecision]]]], N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+212} \lor \neg \left(z \leq 5.2 \cdot 10^{+42}\right) \land \left(z \leq 9.5 \cdot 10^{+144} \lor \neg \left(z \leq 6 \cdot 10^{+182}\right)\right):\\
\;\;\;\;z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -5.1999999999999997e212 or 5.1999999999999998e42 < z < 9.50000000000000031e144 or 6.0000000000000004e182 < z Initial program 80.4%
+-commutative80.4%
associate-*l/97.0%
fma-def97.0%
Simplified97.0%
clear-num97.0%
inv-pow97.0%
Applied egg-rr97.0%
unpow-197.0%
Simplified97.0%
Taylor expanded in z around inf 63.9%
*-commutative63.9%
associate-*r/73.4%
Simplified73.4%
if -5.1999999999999997e212 < z < 5.1999999999999998e42 or 9.50000000000000031e144 < z < 6.0000000000000004e182Initial program 86.0%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in t around inf 67.6%
+-commutative67.6%
Simplified67.6%
Final simplification69.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- a t))))
(if (or (<= x -9.2e-75) (not (<= x 1.75e-170)))
(+ x (* z t_1))
(* (- z t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a - t);
double tmp;
if ((x <= -9.2e-75) || !(x <= 1.75e-170)) {
tmp = x + (z * t_1);
} else {
tmp = (z - t) * 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 = y / (a - t)
if ((x <= (-9.2d-75)) .or. (.not. (x <= 1.75d-170))) then
tmp = x + (z * t_1)
else
tmp = (z - t) * 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 = y / (a - t);
double tmp;
if ((x <= -9.2e-75) || !(x <= 1.75e-170)) {
tmp = x + (z * t_1);
} else {
tmp = (z - t) * t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (a - t) tmp = 0 if (x <= -9.2e-75) or not (x <= 1.75e-170): tmp = x + (z * t_1) else: tmp = (z - t) * t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(a - t)) tmp = 0.0 if ((x <= -9.2e-75) || !(x <= 1.75e-170)) tmp = Float64(x + Float64(z * t_1)); else tmp = Float64(Float64(z - t) * t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (a - t); tmp = 0.0; if ((x <= -9.2e-75) || ~((x <= 1.75e-170))) tmp = x + (z * t_1); else tmp = (z - t) * t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -9.2e-75], N[Not[LessEqual[x, 1.75e-170]], $MachinePrecision]], N[(x + N[(z * t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a - t}\\
\mathbf{if}\;x \leq -9.2 \cdot 10^{-75} \lor \neg \left(x \leq 1.75 \cdot 10^{-170}\right):\\
\;\;\;\;x + z \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(z - t\right) \cdot t\_1\\
\end{array}
\end{array}
if x < -9.2e-75 or 1.74999999999999992e-170 < x Initial program 87.7%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in z around inf 85.6%
associate-*l/90.0%
*-commutative90.0%
Simplified90.0%
if -9.2e-75 < x < 1.74999999999999992e-170Initial program 77.7%
+-commutative77.7%
associate-*l/95.8%
fma-def95.8%
Simplified95.8%
clear-num93.7%
inv-pow93.7%
Applied egg-rr93.7%
unpow-193.7%
Simplified93.7%
Taylor expanded in y around -inf 64.1%
associate-*l/82.2%
*-commutative82.2%
Simplified82.2%
Final simplification87.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- a t))))
(if (or (<= t -3.2e+109) (not (<= t 3.1e+125)))
(- x (* t t_1))
(+ x (* z t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a - t);
double tmp;
if ((t <= -3.2e+109) || !(t <= 3.1e+125)) {
tmp = x - (t * t_1);
} else {
tmp = x + (z * 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 = y / (a - t)
if ((t <= (-3.2d+109)) .or. (.not. (t <= 3.1d+125))) then
tmp = x - (t * t_1)
else
tmp = x + (z * 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 = y / (a - t);
double tmp;
if ((t <= -3.2e+109) || !(t <= 3.1e+125)) {
tmp = x - (t * t_1);
} else {
tmp = x + (z * t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (a - t) tmp = 0 if (t <= -3.2e+109) or not (t <= 3.1e+125): tmp = x - (t * t_1) else: tmp = x + (z * t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(a - t)) tmp = 0.0 if ((t <= -3.2e+109) || !(t <= 3.1e+125)) tmp = Float64(x - Float64(t * t_1)); else tmp = Float64(x + Float64(z * t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (a - t); tmp = 0.0; if ((t <= -3.2e+109) || ~((t <= 3.1e+125))) tmp = x - (t * t_1); else tmp = x + (z * t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -3.2e+109], N[Not[LessEqual[t, 3.1e+125]], $MachinePrecision]], N[(x - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a - t}\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{+109} \lor \neg \left(t \leq 3.1 \cdot 10^{+125}\right):\\
\;\;\;\;x - t \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot t\_1\\
\end{array}
\end{array}
if t < -3.2000000000000001e109 or 3.1e125 < t Initial program 61.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 55.9%
associate-*r/55.9%
mul-1-neg55.9%
distribute-lft-neg-out55.9%
associate-*r/90.5%
distribute-lft-neg-out90.5%
unsub-neg90.5%
Simplified90.5%
if -3.2000000000000001e109 < t < 3.1e125Initial program 95.2%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in z around inf 86.9%
associate-*l/89.5%
*-commutative89.5%
Simplified89.5%
Final simplification89.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -0.0074) (not (<= t 1.45e+76))) (- x (/ y (/ t (- z t)))) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -0.0074) || !(t <= 1.45e+76)) {
tmp = x - (y / (t / (z - t)));
} else {
tmp = x + (z * (y / (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 <= (-0.0074d0)) .or. (.not. (t <= 1.45d+76))) then
tmp = x - (y / (t / (z - t)))
else
tmp = x + (z * (y / (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 <= -0.0074) || !(t <= 1.45e+76)) {
tmp = x - (y / (t / (z - t)));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -0.0074) or not (t <= 1.45e+76): tmp = x - (y / (t / (z - t))) else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -0.0074) || !(t <= 1.45e+76)) tmp = Float64(x - Float64(y / Float64(t / Float64(z - t)))); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -0.0074) || ~((t <= 1.45e+76))) tmp = x - (y / (t / (z - t))); else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -0.0074], N[Not[LessEqual[t, 1.45e+76]], $MachinePrecision]], N[(x - N[(y / N[(t / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0074 \lor \neg \left(t \leq 1.45 \cdot 10^{+76}\right):\\
\;\;\;\;x - \frac{y}{\frac{t}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -0.0074000000000000003 or 1.4500000000000001e76 < t Initial program 70.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 65.3%
mul-1-neg65.3%
unsub-neg65.3%
associate-/l*90.5%
Simplified90.5%
if -0.0074000000000000003 < t < 1.4500000000000001e76Initial program 94.9%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in z around inf 88.1%
associate-*l/92.5%
*-commutative92.5%
Simplified92.5%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -6.5e+186) (+ x y) (if (<= t 3.2e+123) (+ x (* z (/ y (- a t)))) (+ x (/ t (/ (- t a) y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.5e+186) {
tmp = x + y;
} else if (t <= 3.2e+123) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (t / ((t - a) / 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 (t <= (-6.5d+186)) then
tmp = x + y
else if (t <= 3.2d+123) then
tmp = x + (z * (y / (a - t)))
else
tmp = x + (t / ((t - a) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.5e+186) {
tmp = x + y;
} else if (t <= 3.2e+123) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (t / ((t - a) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -6.5e+186: tmp = x + y elif t <= 3.2e+123: tmp = x + (z * (y / (a - t))) else: tmp = x + (t / ((t - a) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.5e+186) tmp = Float64(x + y); elseif (t <= 3.2e+123) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x + Float64(t / Float64(Float64(t - a) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -6.5e+186) tmp = x + y; elseif (t <= 3.2e+123) tmp = x + (z * (y / (a - t))); else tmp = x + (t / ((t - a) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.5e+186], N[(x + y), $MachinePrecision], If[LessEqual[t, 3.2e+123], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{+186}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{+123}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{t - a}{y}}\\
\end{array}
\end{array}
if t < -6.4999999999999997e186Initial program 51.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 92.3%
+-commutative92.3%
Simplified92.3%
if -6.4999999999999997e186 < t < 3.20000000000000005e123Initial program 94.0%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in z around inf 86.2%
associate-*l/88.7%
*-commutative88.7%
Simplified88.7%
if 3.20000000000000005e123 < t Initial program 62.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 89.8%
associate-*r/89.8%
neg-mul-189.8%
Simplified89.8%
Taylor expanded in y around 0 56.5%
associate-/l*89.7%
Simplified89.7%
Final simplification89.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -0.024) (not (<= t 0.32))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -0.024) || !(t <= 0.32)) {
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.024d0)) .or. (.not. (t <= 0.32d0))) 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.024) || !(t <= 0.32)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -0.024) or not (t <= 0.32): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -0.024) || !(t <= 0.32)) 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.024) || ~((t <= 0.32))) 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.024], N[Not[LessEqual[t, 0.32]], $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.024 \lor \neg \left(t \leq 0.32\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -0.024 or 0.320000000000000007 < t Initial program 72.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 73.7%
+-commutative73.7%
Simplified73.7%
if -0.024 < t < 0.320000000000000007Initial program 94.7%
associate-/l*95.7%
Simplified95.7%
clear-num95.7%
associate-/r/95.7%
clear-num95.8%
Applied egg-rr95.8%
Taylor expanded in t around 0 79.4%
Final simplification76.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -0.055) (not (<= t 0.011))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -0.055) || !(t <= 0.011)) {
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.055d0)) .or. (.not. (t <= 0.011d0))) 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.055) || !(t <= 0.011)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -0.055) or not (t <= 0.011): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -0.055) || !(t <= 0.011)) 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.055) || ~((t <= 0.011))) 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.055], N[Not[LessEqual[t, 0.011]], $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.055 \lor \neg \left(t \leq 0.011\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -0.0550000000000000003 or 0.010999999999999999 < t Initial program 72.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 73.7%
+-commutative73.7%
Simplified73.7%
if -0.0550000000000000003 < t < 0.010999999999999999Initial program 94.7%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in t around 0 77.5%
+-commutative77.5%
associate-/l*79.4%
Simplified79.4%
associate-/r/81.4%
Applied egg-rr81.4%
Final simplification78.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.5e-83) (not (<= t 2.6e+110))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.5e-83) || !(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 <= (-5.5d-83)) .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 <= -5.5e-83) || !(t <= 2.6e+110)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.5e-83) 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 <= -5.5e-83) || !(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 <= -5.5e-83) || ~((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, -5.5e-83], N[Not[LessEqual[t, 2.6e+110]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{-83} \lor \neg \left(t \leq 2.6 \cdot 10^{+110}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -5.49999999999999964e-83 or 2.6e110 < t Initial program 71.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 73.5%
+-commutative73.5%
Simplified73.5%
if -5.49999999999999964e-83 < t < 2.6e110Initial program 95.8%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in x around inf 52.1%
Final simplification62.1%
(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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Initial program 84.6%
associate-/l*97.6%
Simplified97.6%
clear-num97.5%
associate-/r/97.6%
clear-num97.6%
Applied egg-rr97.6%
Final simplification97.6%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.55e+153) y x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.55e+153) {
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 (y <= (-1.55d+153)) 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 (y <= -1.55e+153) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.55e+153: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.55e+153) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.55e+153) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.55e+153], y, x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{+153}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.55e153Initial program 53.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 31.3%
+-commutative31.3%
Simplified31.3%
Taylor expanded in y around inf 31.5%
if -1.55e153 < y Initial program 89.3%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in x around inf 56.0%
Final simplification52.8%
(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%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in x around inf 49.7%
Final simplification49.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
:herbie-target
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))