
(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 10 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 (+ 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 88.4%
associate-/l*99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.45e+96)
(+ x y)
(if (<= t -5.2e-59)
(- x (/ (* y z) t))
(if (<= t 2.8e+105) (+ x (* (- z t) (/ y a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.45e+96) {
tmp = x + y;
} else if (t <= -5.2e-59) {
tmp = x - ((y * z) / t);
} else if (t <= 2.8e+105) {
tmp = x + ((z - t) * (y / a));
} 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 (t <= (-1.45d+96)) then
tmp = x + y
else if (t <= (-5.2d-59)) then
tmp = x - ((y * z) / t)
else if (t <= 2.8d+105) then
tmp = x + ((z - t) * (y / a))
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 (t <= -1.45e+96) {
tmp = x + y;
} else if (t <= -5.2e-59) {
tmp = x - ((y * z) / t);
} else if (t <= 2.8e+105) {
tmp = x + ((z - t) * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.45e+96: tmp = x + y elif t <= -5.2e-59: tmp = x - ((y * z) / t) elif t <= 2.8e+105: tmp = x + ((z - t) * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.45e+96) tmp = Float64(x + y); elseif (t <= -5.2e-59) tmp = Float64(x - Float64(Float64(y * z) / t)); elseif (t <= 2.8e+105) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.45e+96) tmp = x + y; elseif (t <= -5.2e-59) tmp = x - ((y * z) / t); elseif (t <= 2.8e+105) tmp = x + ((z - t) * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.45e+96], N[(x + y), $MachinePrecision], If[LessEqual[t, -5.2e-59], N[(x - N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.8e+105], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{+96}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -5.2 \cdot 10^{-59}:\\
\;\;\;\;x - \frac{y \cdot z}{t}\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{+105}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.44999999999999989e96 or 2.8000000000000001e105 < t Initial program 71.9%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in t around inf 77.2%
if -1.44999999999999989e96 < t < -5.19999999999999996e-59Initial program 94.5%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 77.8%
+-commutative77.8%
mul-1-neg77.8%
unsub-neg77.8%
*-commutative77.8%
associate-/l*75.0%
Simplified75.0%
Taylor expanded in t around 0 77.8%
if -5.19999999999999996e-59 < t < 2.8000000000000001e105Initial program 95.2%
associate-*l/96.8%
Simplified96.8%
Taylor expanded in a around inf 86.2%
Final simplification82.5%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.1e+90)
(+ x y)
(if (<= t -3.9e-63)
(- x (/ (* y z) t))
(if (<= t 9.2e+104) (+ x (* z (/ y a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.1e+90) {
tmp = x + y;
} else if (t <= -3.9e-63) {
tmp = x - ((y * z) / t);
} else if (t <= 9.2e+104) {
tmp = x + (z * (y / a));
} 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 (t <= (-3.1d+90)) then
tmp = x + y
else if (t <= (-3.9d-63)) then
tmp = x - ((y * z) / t)
else if (t <= 9.2d+104) then
tmp = x + (z * (y / a))
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 (t <= -3.1e+90) {
tmp = x + y;
} else if (t <= -3.9e-63) {
tmp = x - ((y * z) / t);
} else if (t <= 9.2e+104) {
tmp = x + (z * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.1e+90: tmp = x + y elif t <= -3.9e-63: tmp = x - ((y * z) / t) elif t <= 9.2e+104: tmp = x + (z * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.1e+90) tmp = Float64(x + y); elseif (t <= -3.9e-63) tmp = Float64(x - Float64(Float64(y * z) / t)); elseif (t <= 9.2e+104) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.1e+90) tmp = x + y; elseif (t <= -3.9e-63) tmp = x - ((y * z) / t); elseif (t <= 9.2e+104) tmp = x + (z * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.1e+90], N[(x + y), $MachinePrecision], If[LessEqual[t, -3.9e-63], N[(x - N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.2e+104], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{+90}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -3.9 \cdot 10^{-63}:\\
\;\;\;\;x - \frac{y \cdot z}{t}\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{+104}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -3.09999999999999988e90 or 9.19999999999999938e104 < t Initial program 71.9%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in t around inf 77.2%
if -3.09999999999999988e90 < t < -3.90000000000000022e-63Initial program 94.5%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 77.8%
+-commutative77.8%
mul-1-neg77.8%
unsub-neg77.8%
*-commutative77.8%
associate-/l*75.0%
Simplified75.0%
Taylor expanded in t around 0 77.8%
if -3.90000000000000022e-63 < t < 9.19999999999999938e104Initial program 95.2%
+-commutative95.2%
associate-*r/98.6%
fma-def98.6%
Simplified98.6%
fma-udef98.6%
Applied egg-rr98.6%
Taylor expanded in t around 0 83.2%
associate-*l/85.4%
*-commutative85.4%
Simplified85.4%
Final simplification82.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.7e-59) (not (<= t 1e+29))) (- x (* y (/ t (- a t)))) (+ x (* (- z t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.7e-59) || !(t <= 1e+29)) {
tmp = x - (y * (t / (a - t)));
} else {
tmp = x + ((z - t) * (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 <= (-3.7d-59)) .or. (.not. (t <= 1d+29))) then
tmp = x - (y * (t / (a - t)))
else
tmp = x + ((z - t) * (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 <= -3.7e-59) || !(t <= 1e+29)) {
tmp = x - (y * (t / (a - t)));
} else {
tmp = x + ((z - t) * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.7e-59) or not (t <= 1e+29): tmp = x - (y * (t / (a - t))) else: tmp = x + ((z - t) * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.7e-59) || !(t <= 1e+29)) tmp = Float64(x - Float64(y * Float64(t / Float64(a - t)))); else tmp = Float64(x + Float64(Float64(z - t) * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.7e-59) || ~((t <= 1e+29))) tmp = x - (y * (t / (a - t))); else tmp = x + ((z - t) * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.7e-59], N[Not[LessEqual[t, 1e+29]], $MachinePrecision]], N[(x - N[(y * N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.7 \cdot 10^{-59} \lor \neg \left(t \leq 10^{+29}\right):\\
\;\;\;\;x - y \cdot \frac{t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -3.6999999999999999e-59 or 9.99999999999999914e28 < t Initial program 81.7%
+-commutative81.7%
associate-*r/99.2%
fma-def99.2%
Simplified99.2%
fma-udef99.2%
Applied egg-rr99.2%
Taylor expanded in z around 0 72.4%
mul-1-neg72.4%
distribute-frac-neg72.4%
+-commutative72.4%
distribute-frac-neg72.4%
associate-*r/86.8%
sub-neg86.8%
Simplified86.8%
if -3.6999999999999999e-59 < t < 9.99999999999999914e28Initial program 95.1%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in a around inf 88.4%
Final simplification87.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -2e+62) (not (<= y 3.8e+105))) (* y (- 1.0 (/ z t))) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2e+62) || !(y <= 3.8e+105)) {
tmp = y * (1.0 - (z / t));
} 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 <= (-2d+62)) .or. (.not. (y <= 3.8d+105))) then
tmp = y * (1.0d0 - (z / t))
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 <= -2e+62) || !(y <= 3.8e+105)) {
tmp = y * (1.0 - (z / t));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -2e+62) or not (y <= 3.8e+105): tmp = y * (1.0 - (z / t)) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -2e+62) || !(y <= 3.8e+105)) tmp = Float64(y * Float64(1.0 - Float64(z / t))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -2e+62) || ~((y <= 3.8e+105))) tmp = y * (1.0 - (z / t)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -2e+62], N[Not[LessEqual[y, 3.8e+105]], $MachinePrecision]], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+62} \lor \neg \left(y \leq 3.8 \cdot 10^{+105}\right):\\
\;\;\;\;y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.00000000000000007e62 or 3.8e105 < y Initial program 70.8%
associate-*l/96.8%
Simplified96.8%
Taylor expanded in a around 0 41.8%
+-commutative41.8%
mul-1-neg41.8%
unsub-neg41.8%
*-commutative41.8%
associate-/l*56.1%
Simplified56.1%
Taylor expanded in y around inf 47.8%
if -2.00000000000000007e62 < y < 3.8e105Initial program 98.5%
associate-*l/97.7%
Simplified97.7%
Taylor expanded in x around inf 71.0%
Final simplification62.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.55e+59) (not (<= t 6.6e+105))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.55e+59) || !(t <= 6.6e+105)) {
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 <= (-2.55d+59)) .or. (.not. (t <= 6.6d+105))) 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 <= -2.55e+59) || !(t <= 6.6e+105)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.55e+59) or not (t <= 6.6e+105): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.55e+59) || !(t <= 6.6e+105)) 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 <= -2.55e+59) || ~((t <= 6.6e+105))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.55e+59], N[Not[LessEqual[t, 6.6e+105]], $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 -2.55 \cdot 10^{+59} \lor \neg \left(t \leq 6.6 \cdot 10^{+105}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -2.5500000000000002e59 or 6.59999999999999995e105 < t Initial program 73.1%
associate-*l/97.5%
Simplified97.5%
Taylor expanded in t around inf 75.5%
if -2.5500000000000002e59 < t < 6.59999999999999995e105Initial program 95.4%
+-commutative95.4%
associate-*r/98.3%
fma-def98.3%
Simplified98.3%
fma-udef98.3%
Applied egg-rr98.3%
Taylor expanded in t around 0 79.9%
associate-*l/82.2%
*-commutative82.2%
Simplified82.2%
Final simplification80.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.9e+59) (+ x y) (if (<= t 2.25e+105) (+ x (* y (/ z a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.9e+59) {
tmp = x + y;
} else if (t <= 2.25e+105) {
tmp = x + (y * (z / a));
} 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 (t <= (-2.9d+59)) then
tmp = x + y
else if (t <= 2.25d+105) then
tmp = x + (y * (z / a))
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 (t <= -2.9e+59) {
tmp = x + y;
} else if (t <= 2.25e+105) {
tmp = x + (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.9e+59: tmp = x + y elif t <= 2.25e+105: tmp = x + (y * (z / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.9e+59) tmp = Float64(x + y); elseif (t <= 2.25e+105) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.9e+59) tmp = x + y; elseif (t <= 2.25e+105) tmp = x + (y * (z / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.9e+59], N[(x + y), $MachinePrecision], If[LessEqual[t, 2.25e+105], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{+59}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{+105}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -2.89999999999999991e59 or 2.2500000000000001e105 < t Initial program 73.1%
associate-*l/97.5%
Simplified97.5%
Taylor expanded in t around inf 75.5%
if -2.89999999999999991e59 < t < 2.2500000000000001e105Initial program 95.4%
+-commutative95.4%
associate-*r/98.3%
fma-def98.3%
Simplified98.3%
fma-udef98.3%
Applied egg-rr98.3%
Taylor expanded in t around 0 81.5%
Final simplification79.6%
(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 88.4%
associate-*l/97.4%
Simplified97.4%
Final simplification97.4%
(FPCore (x y z t a) :precision binary64 (if (<= t -7.5e+60) (+ x y) (if (<= t 1.62e-72) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.5e+60) {
tmp = x + y;
} else if (t <= 1.62e-72) {
tmp = x;
} 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 (t <= (-7.5d+60)) then
tmp = x + y
else if (t <= 1.62d-72) then
tmp = x
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 (t <= -7.5e+60) {
tmp = x + y;
} else if (t <= 1.62e-72) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7.5e+60: tmp = x + y elif t <= 1.62e-72: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.5e+60) tmp = Float64(x + y); elseif (t <= 1.62e-72) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7.5e+60) tmp = x + y; elseif (t <= 1.62e-72) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.5e+60], N[(x + y), $MachinePrecision], If[LessEqual[t, 1.62e-72], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{+60}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 1.62 \cdot 10^{-72}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -7.5e60 or 1.62000000000000003e-72 < t Initial program 80.7%
associate-*l/98.2%
Simplified98.2%
Taylor expanded in t around inf 71.9%
if -7.5e60 < t < 1.62000000000000003e-72Initial program 94.9%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in x around inf 53.2%
Final simplification61.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 88.4%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in x around inf 52.4%
Final simplification52.4%
(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 2023240
(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))))