
(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 15 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 (fma y (/ (- z t) (- a t)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((z - t) / (a - t)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(z - t) / Float64(a - t)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{z - t}{a - t}, x\right)
\end{array}
Initial program 85.3%
+-commutative85.3%
associate-*r/99.2%
fma-def99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a)
:precision binary64
(if (or (<= z -2.7e+265)
(and (not (<= z 6.9e+109))
(or (<= z 1.1e+137) (not (<= z 6.5e+194)))))
(* y (/ z (- a t)))
(+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.7e+265) || (!(z <= 6.9e+109) && ((z <= 1.1e+137) || !(z <= 6.5e+194)))) {
tmp = y * (z / (a - t));
} else {
tmp = y + 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 ((z <= (-2.7d+265)) .or. (.not. (z <= 6.9d+109)) .and. (z <= 1.1d+137) .or. (.not. (z <= 6.5d+194))) then
tmp = y * (z / (a - t))
else
tmp = y + x
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+265) || (!(z <= 6.9e+109) && ((z <= 1.1e+137) || !(z <= 6.5e+194)))) {
tmp = y * (z / (a - t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.7e+265) or (not (z <= 6.9e+109) and ((z <= 1.1e+137) or not (z <= 6.5e+194))): tmp = y * (z / (a - t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.7e+265) || (!(z <= 6.9e+109) && ((z <= 1.1e+137) || !(z <= 6.5e+194)))) tmp = Float64(y * Float64(z / Float64(a - t))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.7e+265) || (~((z <= 6.9e+109)) && ((z <= 1.1e+137) || ~((z <= 6.5e+194))))) tmp = y * (z / (a - t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.7e+265], And[N[Not[LessEqual[z, 6.9e+109]], $MachinePrecision], Or[LessEqual[z, 1.1e+137], N[Not[LessEqual[z, 6.5e+194]], $MachinePrecision]]]], N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+265} \lor \neg \left(z \leq 6.9 \cdot 10^{+109}\right) \land \left(z \leq 1.1 \cdot 10^{+137} \lor \neg \left(z \leq 6.5 \cdot 10^{+194}\right)\right):\\
\;\;\;\;y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -2.69999999999999984e265 or 6.8999999999999999e109 < z < 1.10000000000000008e137 or 6.50000000000000005e194 < z Initial program 81.5%
associate-*l/92.0%
Simplified92.0%
Taylor expanded in x around 0 75.5%
Taylor expanded in z around inf 75.3%
*-commutative75.3%
Simplified75.3%
Taylor expanded in z around 0 75.3%
associate-*r/85.9%
Simplified85.9%
if -2.69999999999999984e265 < z < 6.8999999999999999e109 or 1.10000000000000008e137 < z < 6.50000000000000005e194Initial program 85.9%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in t around inf 70.8%
Final simplification72.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.4e+178) (not (<= t 9.2e-17))) (+ y x) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.4e+178) || !(t <= 9.2e-17)) {
tmp = y + x;
} 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 <= (-1.4d+178)) .or. (.not. (t <= 9.2d-17))) then
tmp = y + x
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 <= -1.4e+178) || !(t <= 9.2e-17)) {
tmp = y + x;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.4e+178) or not (t <= 9.2e-17): tmp = y + x else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.4e+178) || !(t <= 9.2e-17)) tmp = Float64(y + x); 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 <= -1.4e+178) || ~((t <= 9.2e-17))) tmp = y + x; else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.4e+178], N[Not[LessEqual[t, 9.2e-17]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{+178} \lor \neg \left(t \leq 9.2 \cdot 10^{-17}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -1.39999999999999997e178 or 9.20000000000000035e-17 < t Initial program 73.5%
associate-*l/95.9%
Simplified95.9%
Taylor expanded in t around inf 89.7%
if -1.39999999999999997e178 < t < 9.20000000000000035e-17Initial program 92.0%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in z around inf 83.6%
associate-*l/84.6%
*-commutative84.6%
Simplified84.6%
Final simplification86.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- a t))))
(if (or (<= t -1.22e+61) (not (<= t 3.2e-19)))
(- 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 <= -1.22e+61) || !(t <= 3.2e-19)) {
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 <= (-1.22d+61)) .or. (.not. (t <= 3.2d-19))) 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 <= -1.22e+61) || !(t <= 3.2e-19)) {
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 <= -1.22e+61) or not (t <= 3.2e-19): 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 <= -1.22e+61) || !(t <= 3.2e-19)) 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 <= -1.22e+61) || ~((t <= 3.2e-19))) 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, -1.22e+61], N[Not[LessEqual[t, 3.2e-19]], $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 -1.22 \cdot 10^{+61} \lor \neg \left(t \leq 3.2 \cdot 10^{-19}\right):\\
\;\;\;\;x - t \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot t_1\\
\end{array}
\end{array}
if t < -1.22e61 or 3.19999999999999982e-19 < t Initial program 74.1%
associate-*l/96.0%
Simplified96.0%
Taylor expanded in z around 0 66.4%
+-commutative66.4%
associate-*r/66.4%
mul-1-neg66.4%
distribute-rgt-neg-out66.4%
associate-*l/87.1%
*-commutative87.1%
distribute-lft-neg-out87.1%
unsub-neg87.1%
Simplified87.1%
if -1.22e61 < t < 3.19999999999999982e-19Initial program 95.7%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in z around inf 89.1%
associate-*l/89.1%
*-commutative89.1%
Simplified89.1%
Final simplification88.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.8e-15) (not (<= t 3.1e-24))) (+ 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 <= -6.8e-15) || !(t <= 3.1e-24)) {
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 <= (-6.8d-15)) .or. (.not. (t <= 3.1d-24))) 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 <= -6.8e-15) || !(t <= 3.1e-24)) {
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 <= -6.8e-15) or not (t <= 3.1e-24): 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 <= -6.8e-15) || !(t <= 3.1e-24)) tmp = Float64(x + Float64(y * Float64(Float64(t - 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 <= -6.8e-15) || ~((t <= 3.1e-24))) 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, -6.8e-15], N[Not[LessEqual[t, 3.1e-24]], $MachinePrecision]], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $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 -6.8 \cdot 10^{-15} \lor \neg \left(t \leq 3.1 \cdot 10^{-24}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -6.8000000000000001e-15 or 3.1e-24 < t Initial program 75.9%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in a around 0 67.5%
+-commutative67.5%
mul-1-neg67.5%
unsub-neg67.5%
*-commutative67.5%
associate-/l*89.7%
Simplified89.7%
clear-num89.6%
associate-/r/89.7%
clear-num89.7%
Applied egg-rr89.7%
if -6.8000000000000001e-15 < t < 3.1e-24Initial program 96.6%
associate-*l/96.0%
Simplified96.0%
Taylor expanded in z around inf 92.5%
associate-*l/91.9%
*-commutative91.9%
Simplified91.9%
Final simplification90.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.1e-19) (+ x (* y (/ (- t z) t))) (if (<= t 5.4e-25) (+ x (* z (/ y (- a t)))) (- x (/ y (/ t (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.1e-19) {
tmp = x + (y * ((t - z) / t));
} else if (t <= 5.4e-25) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x - (y / (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 (t <= (-2.1d-19)) then
tmp = x + (y * ((t - z) / t))
else if (t <= 5.4d-25) then
tmp = x + (z * (y / (a - t)))
else
tmp = x - (y / (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 (t <= -2.1e-19) {
tmp = x + (y * ((t - z) / t));
} else if (t <= 5.4e-25) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x - (y / (t / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.1e-19: tmp = x + (y * ((t - z) / t)) elif t <= 5.4e-25: tmp = x + (z * (y / (a - t))) else: tmp = x - (y / (t / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.1e-19) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / t))); elseif (t <= 5.4e-25) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x - Float64(y / Float64(t / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.1e-19) tmp = x + (y * ((t - z) / t)); elseif (t <= 5.4e-25) tmp = x + (z * (y / (a - t))); else tmp = x - (y / (t / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.1e-19], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.4e-25], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(t / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{-19}:\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\mathbf{elif}\;t \leq 5.4 \cdot 10^{-25}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z - t}}\\
\end{array}
\end{array}
if t < -2.0999999999999999e-19Initial program 73.6%
associate-*l/95.7%
Simplified95.7%
Taylor expanded in a around 0 62.6%
+-commutative62.6%
mul-1-neg62.6%
unsub-neg62.6%
*-commutative62.6%
associate-/l*86.8%
Simplified86.8%
clear-num86.8%
associate-/r/86.9%
clear-num86.9%
Applied egg-rr86.9%
if -2.0999999999999999e-19 < t < 5.40000000000000032e-25Initial program 96.6%
associate-*l/96.0%
Simplified96.0%
Taylor expanded in z around inf 92.5%
associate-*l/91.9%
*-commutative91.9%
Simplified91.9%
if 5.40000000000000032e-25 < t Initial program 78.7%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in a around 0 73.5%
+-commutative73.5%
mul-1-neg73.5%
unsub-neg73.5%
*-commutative73.5%
associate-/l*93.2%
Simplified93.2%
Final simplification90.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.7e-14) (+ x (* y (/ (- t z) t))) (if (<= t 1e-18) (+ x (* z (/ y (- a t)))) (+ x (/ y (/ (- t a) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.7e-14) {
tmp = x + (y * ((t - z) / t));
} else if (t <= 1e-18) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (y / ((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 (t <= (-2.7d-14)) then
tmp = x + (y * ((t - z) / t))
else if (t <= 1d-18) then
tmp = x + (z * (y / (a - t)))
else
tmp = x + (y / ((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 (t <= -2.7e-14) {
tmp = x + (y * ((t - z) / t));
} else if (t <= 1e-18) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (y / ((t - a) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.7e-14: tmp = x + (y * ((t - z) / t)) elif t <= 1e-18: tmp = x + (z * (y / (a - t))) else: tmp = x + (y / ((t - a) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.7e-14) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / t))); elseif (t <= 1e-18) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x + Float64(y / Float64(Float64(t - a) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.7e-14) tmp = x + (y * ((t - z) / t)); elseif (t <= 1e-18) tmp = x + (z * (y / (a - t))); else tmp = x + (y / ((t - a) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.7e-14], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-18], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(t - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{-14}:\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\mathbf{elif}\;t \leq 10^{-18}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t - a}{t}}\\
\end{array}
\end{array}
if t < -2.6999999999999999e-14Initial program 73.6%
associate-*l/95.7%
Simplified95.7%
Taylor expanded in a around 0 62.6%
+-commutative62.6%
mul-1-neg62.6%
unsub-neg62.6%
*-commutative62.6%
associate-/l*86.8%
Simplified86.8%
clear-num86.8%
associate-/r/86.9%
clear-num86.9%
Applied egg-rr86.9%
if -2.6999999999999999e-14 < t < 1.0000000000000001e-18Initial program 96.0%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in z around inf 91.2%
associate-*l/91.3%
*-commutative91.3%
Simplified91.3%
if 1.0000000000000001e-18 < t Initial program 78.9%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 95.8%
associate-*r/95.8%
neg-mul-195.8%
Simplified95.8%
Final simplification91.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -7.4e-47) (+ y x) (if (<= t 7e-18) (+ x (* y (/ z a))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.4e-47) {
tmp = y + x;
} else if (t <= 7e-18) {
tmp = x + (y * (z / a));
} else {
tmp = y + 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 <= (-7.4d-47)) then
tmp = y + x
else if (t <= 7d-18) then
tmp = x + (y * (z / a))
else
tmp = y + 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 <= -7.4e-47) {
tmp = y + x;
} else if (t <= 7e-18) {
tmp = x + (y * (z / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7.4e-47: tmp = y + x elif t <= 7e-18: tmp = x + (y * (z / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.4e-47) tmp = Float64(y + x); elseif (t <= 7e-18) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7.4e-47) tmp = y + x; elseif (t <= 7e-18) tmp = x + (y * (z / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.4e-47], N[(y + x), $MachinePrecision], If[LessEqual[t, 7e-18], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.4 \cdot 10^{-47}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-18}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -7.4000000000000001e-47 or 6.9999999999999997e-18 < t Initial program 76.5%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in t around inf 78.0%
if -7.4000000000000001e-47 < t < 6.9999999999999997e-18Initial program 96.5%
+-commutative96.5%
associate-*r/98.2%
fma-def98.3%
Simplified98.3%
fma-udef98.2%
Applied egg-rr98.2%
Taylor expanded in t around 0 81.3%
Final simplification79.4%
(FPCore (x y z t a) :precision binary64 (if (<= t -7.8e-47) (+ y x) (if (<= t 2.6e-18) (+ x (/ y (/ a z))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.8e-47) {
tmp = y + x;
} else if (t <= 2.6e-18) {
tmp = x + (y / (a / z));
} else {
tmp = y + 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 <= (-7.8d-47)) then
tmp = y + x
else if (t <= 2.6d-18) then
tmp = x + (y / (a / z))
else
tmp = y + 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 <= -7.8e-47) {
tmp = y + x;
} else if (t <= 2.6e-18) {
tmp = x + (y / (a / z));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7.8e-47: tmp = y + x elif t <= 2.6e-18: tmp = x + (y / (a / z)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.8e-47) tmp = Float64(y + x); elseif (t <= 2.6e-18) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7.8e-47) tmp = y + x; elseif (t <= 2.6e-18) tmp = x + (y / (a / z)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.8e-47], N[(y + x), $MachinePrecision], If[LessEqual[t, 2.6e-18], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{-47}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-18}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -7.79999999999999956e-47 or 2.6e-18 < t Initial program 76.5%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in t around inf 78.0%
if -7.79999999999999956e-47 < t < 2.6e-18Initial program 96.5%
associate-*l/95.8%
Simplified95.8%
Taylor expanded in t around 0 79.7%
associate-/l*81.4%
Simplified81.4%
Final simplification79.5%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (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 + ((z - t) * (y / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (a - t)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{a - t}
\end{array}
Initial program 85.3%
associate-*l/96.2%
Simplified96.2%
Final simplification96.2%
(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 85.3%
associate-/l*99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a) :precision binary64 (- x (* y (/ (- t z) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (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 * ((t - z) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (a - t)));
}
def code(x, y, z, t, a): return x - (y * ((t - z) / (a - t)))
function code(x, y, z, t, a) return Float64(x - Float64(y * Float64(Float64(t - z) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y * ((t - z) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot \frac{t - z}{a - t}
\end{array}
Initial program 85.3%
+-commutative85.3%
associate-*r/99.2%
fma-def99.2%
Simplified99.2%
fma-udef99.2%
Applied egg-rr99.2%
Final simplification99.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.9e+264) (/ (* y z) a) (if (<= z 8e+203) (+ y x) (* y (/ (- z) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e+264) {
tmp = (y * z) / a;
} else if (z <= 8e+203) {
tmp = y + x;
} else {
tmp = y * (-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 (z <= (-1.9d+264)) then
tmp = (y * z) / a
else if (z <= 8d+203) then
tmp = y + x
else
tmp = y * (-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 (z <= -1.9e+264) {
tmp = (y * z) / a;
} else if (z <= 8e+203) {
tmp = y + x;
} else {
tmp = y * (-z / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.9e+264: tmp = (y * z) / a elif z <= 8e+203: tmp = y + x else: tmp = y * (-z / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e+264) tmp = Float64(Float64(y * z) / a); elseif (z <= 8e+203) tmp = Float64(y + x); else tmp = Float64(y * Float64(Float64(-z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.9e+264) tmp = (y * z) / a; elseif (z <= 8e+203) tmp = y + x; else tmp = y * (-z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e+264], N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 8e+203], N[(y + x), $MachinePrecision], N[(y * N[((-z) / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+264}:\\
\;\;\;\;\frac{y \cdot z}{a}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+203}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{-z}{t}\\
\end{array}
\end{array}
if z < -1.9000000000000001e264Initial program 99.8%
associate-*l/78.8%
Simplified78.8%
Taylor expanded in x around 0 99.8%
Taylor expanded in z around inf 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in a around inf 77.9%
if -1.9000000000000001e264 < z < 7.9999999999999999e203Initial program 85.5%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in t around inf 68.8%
if 7.9999999999999999e203 < z Initial program 76.3%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in z around inf 76.3%
associate-*l/95.2%
*-commutative95.2%
Simplified95.2%
Taylor expanded in a around 0 56.3%
+-commutative56.3%
mul-1-neg56.3%
unsub-neg56.3%
associate-*l/65.6%
*-commutative65.6%
Simplified65.6%
Taylor expanded in x around 0 51.7%
*-commutative51.7%
associate-*r/60.9%
neg-mul-160.9%
*-commutative60.9%
distribute-rgt-neg-in60.9%
Simplified60.9%
Taylor expanded in y around 0 51.7%
mul-1-neg51.7%
associate-*r/61.0%
distribute-lft-neg-in61.0%
Simplified61.0%
Final simplification68.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.55e-51) (+ y x) (if (<= t 3.15e-21) x (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.55e-51) {
tmp = y + x;
} else if (t <= 3.15e-21) {
tmp = x;
} else {
tmp = y + 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 <= (-2.55d-51)) then
tmp = y + x
else if (t <= 3.15d-21) then
tmp = x
else
tmp = y + 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 <= -2.55e-51) {
tmp = y + x;
} else if (t <= 3.15e-21) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.55e-51: tmp = y + x elif t <= 3.15e-21: tmp = x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.55e-51) tmp = Float64(y + x); elseif (t <= 3.15e-21) tmp = x; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.55e-51) tmp = y + x; elseif (t <= 3.15e-21) tmp = x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.55e-51], N[(y + x), $MachinePrecision], If[LessEqual[t, 3.15e-21], x, N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.55 \cdot 10^{-51}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 3.15 \cdot 10^{-21}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -2.5499999999999999e-51 or 3.15e-21 < t Initial program 76.5%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in t around inf 77.3%
if -2.5499999999999999e-51 < t < 3.15e-21Initial program 97.3%
associate-*l/95.7%
Simplified95.7%
Taylor expanded in x around inf 56.0%
Final simplification68.3%
(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 85.3%
associate-*l/96.2%
Simplified96.2%
Taylor expanded in x around inf 50.6%
Final simplification50.6%
(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 2023192
(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))))