
(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 84.4%
associate-/l*98.3%
Simplified98.3%
Final simplification98.3%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4.4e-30)
(+ x y)
(if (<= t 2.5e-24)
(+ x (/ z (/ a y)))
(if (<= t 2e+88) (- x (* y (/ t a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.4e-30) {
tmp = x + y;
} else if (t <= 2.5e-24) {
tmp = x + (z / (a / y));
} else if (t <= 2e+88) {
tmp = x - (y * (t / 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 <= (-4.4d-30)) then
tmp = x + y
else if (t <= 2.5d-24) then
tmp = x + (z / (a / y))
else if (t <= 2d+88) then
tmp = x - (y * (t / 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 <= -4.4e-30) {
tmp = x + y;
} else if (t <= 2.5e-24) {
tmp = x + (z / (a / y));
} else if (t <= 2e+88) {
tmp = x - (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.4e-30: tmp = x + y elif t <= 2.5e-24: tmp = x + (z / (a / y)) elif t <= 2e+88: tmp = x - (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.4e-30) tmp = Float64(x + y); elseif (t <= 2.5e-24) tmp = Float64(x + Float64(z / Float64(a / y))); elseif (t <= 2e+88) tmp = Float64(x - Float64(y * Float64(t / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.4e-30) tmp = x + y; elseif (t <= 2.5e-24) tmp = x + (z / (a / y)); elseif (t <= 2e+88) tmp = x - (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.4e-30], N[(x + y), $MachinePrecision], If[LessEqual[t, 2.5e-24], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e+88], N[(x - N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.4 \cdot 10^{-30}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-24}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+88}:\\
\;\;\;\;x - y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -4.39999999999999967e-30 or 1.99999999999999992e88 < t Initial program 73.9%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 80.1%
+-commutative80.1%
Simplified80.1%
if -4.39999999999999967e-30 < t < 2.4999999999999999e-24Initial program 92.9%
+-commutative92.9%
associate-*l/96.8%
fma-def96.8%
Simplified96.8%
fma-udef96.8%
associate-*l/92.9%
div-inv92.9%
*-commutative92.9%
associate-*l*96.7%
div-inv96.8%
Applied egg-rr96.8%
Taylor expanded in t around 0 79.1%
associate-*l/84.1%
*-commutative84.1%
Simplified84.1%
clear-num84.1%
un-div-inv84.1%
Applied egg-rr84.1%
if 2.4999999999999999e-24 < t < 1.99999999999999992e88Initial program 90.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around inf 63.5%
+-commutative63.5%
associate-/l*72.6%
Simplified72.6%
Taylor expanded in z around 0 67.9%
mul-1-neg67.9%
unsub-neg67.9%
associate-/l*76.9%
Simplified76.9%
associate-/r/77.0%
Applied egg-rr77.0%
Final simplification81.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.05e+87) (not (<= t 2.3e+96))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.05e+87) || !(t <= 2.3e+96)) {
tmp = x + y;
} 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.05d+87)) .or. (.not. (t <= 2.3d+96))) then
tmp = x + y
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.05e+87) || !(t <= 2.3e+96)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.05e+87) or not (t <= 2.3e+96): tmp = x + y else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.05e+87) || !(t <= 2.3e+96)) tmp = Float64(x + y); 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.05e+87) || ~((t <= 2.3e+96))) tmp = x + y; else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.05e+87], N[Not[LessEqual[t, 2.3e+96]], $MachinePrecision]], N[(x + y), $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.05 \cdot 10^{+87} \lor \neg \left(t \leq 2.3 \cdot 10^{+96}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -1.05e87 or 2.30000000000000015e96 < t Initial program 67.7%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 82.3%
+-commutative82.3%
Simplified82.3%
if -1.05e87 < t < 2.30000000000000015e96Initial program 92.7%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in z around inf 85.4%
associate-*l/89.0%
*-commutative89.0%
Simplified89.0%
Final simplification86.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.9e+85) (not (<= t 9.2e+95))) (+ x y) (+ x (/ z (/ (- a t) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.9e+85) || !(t <= 9.2e+95)) {
tmp = x + y;
} else {
tmp = x + (z / ((a - t) / 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.9d+85)) .or. (.not. (t <= 9.2d+95))) then
tmp = x + y
else
tmp = x + (z / ((a - t) / 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.9e+85) || !(t <= 9.2e+95)) {
tmp = x + y;
} else {
tmp = x + (z / ((a - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.9e+85) or not (t <= 9.2e+95): tmp = x + y else: tmp = x + (z / ((a - t) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.9e+85) || !(t <= 9.2e+95)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.9e+85) || ~((t <= 9.2e+95))) tmp = x + y; else tmp = x + (z / ((a - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.9e+85], N[Not[LessEqual[t, 9.2e+95]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.9 \cdot 10^{+85} \lor \neg \left(t \leq 9.2 \cdot 10^{+95}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\end{array}
\end{array}
if t < -3.90000000000000033e85 or 9.19999999999999989e95 < t Initial program 67.7%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 82.3%
+-commutative82.3%
Simplified82.3%
if -3.90000000000000033e85 < t < 9.19999999999999989e95Initial program 92.7%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in z around inf 85.4%
associate-*l/89.0%
*-commutative89.0%
Simplified89.0%
clear-num89.0%
un-div-inv89.0%
Applied egg-rr89.0%
Final simplification86.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.5e+19) (+ x (* z (/ y (- a t)))) (if (<= z 6.4e-38) (- x (/ y (+ (/ a t) -1.0))) (+ x (/ z (/ (- a t) y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.5e+19) {
tmp = x + (z * (y / (a - t)));
} else if (z <= 6.4e-38) {
tmp = x - (y / ((a / t) + -1.0));
} else {
tmp = x + (z / ((a - t) / 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 <= (-6.5d+19)) then
tmp = x + (z * (y / (a - t)))
else if (z <= 6.4d-38) then
tmp = x - (y / ((a / t) + (-1.0d0)))
else
tmp = x + (z / ((a - t) / 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 <= -6.5e+19) {
tmp = x + (z * (y / (a - t)));
} else if (z <= 6.4e-38) {
tmp = x - (y / ((a / t) + -1.0));
} else {
tmp = x + (z / ((a - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.5e+19: tmp = x + (z * (y / (a - t))) elif z <= 6.4e-38: tmp = x - (y / ((a / t) + -1.0)) else: tmp = x + (z / ((a - t) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.5e+19) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); elseif (z <= 6.4e-38) tmp = Float64(x - Float64(y / Float64(Float64(a / t) + -1.0))); else tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.5e+19) tmp = x + (z * (y / (a - t))); elseif (z <= 6.4e-38) tmp = x - (y / ((a / t) + -1.0)); else tmp = x + (z / ((a - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.5e+19], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.4e-38], N[(x - N[(y / N[(N[(a / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+19}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-38}:\\
\;\;\;\;x - \frac{y}{\frac{a}{t} + -1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\end{array}
\end{array}
if z < -6.5e19Initial program 86.7%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in z around inf 82.2%
associate-*l/89.3%
*-commutative89.3%
Simplified89.3%
if -6.5e19 < z < 6.39999999999999955e-38Initial program 83.5%
+-commutative83.5%
associate-*l/95.8%
fma-def95.8%
Simplified95.8%
fma-udef95.8%
associate-*l/83.5%
div-inv83.4%
*-commutative83.4%
associate-*l*95.6%
div-inv95.8%
Applied egg-rr95.8%
Taylor expanded in z around 0 74.4%
mul-1-neg74.4%
associate-*l/90.8%
*-commutative90.8%
sub-neg90.8%
associate-*r/74.4%
rem-square-sqrt36.9%
associate-*r*36.9%
/-rgt-identity36.9%
associate-/r/36.9%
associate-*l/38.4%
times-frac44.3%
*-commutative44.3%
rem-square-sqrt90.7%
associate-*l/90.8%
*-lft-identity90.8%
div-sub90.8%
sub-neg90.8%
*-inverses90.8%
metadata-eval90.8%
Simplified90.8%
if 6.39999999999999955e-38 < z Initial program 83.2%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in z around inf 80.8%
associate-*l/92.4%
*-commutative92.4%
Simplified92.4%
clear-num92.4%
un-div-inv92.5%
Applied egg-rr92.5%
Final simplification90.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9.2e-31) (not (<= t 2e+88))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9.2e-31) || !(t <= 2e+88)) {
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 <= (-9.2d-31)) .or. (.not. (t <= 2d+88))) 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 <= -9.2e-31) || !(t <= 2e+88)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9.2e-31) or not (t <= 2e+88): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9.2e-31) || !(t <= 2e+88)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -9.2e-31) || ~((t <= 2e+88))) tmp = x + y; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9.2e-31], N[Not[LessEqual[t, 2e+88]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.2 \cdot 10^{-31} \lor \neg \left(t \leq 2 \cdot 10^{+88}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -9.1999999999999994e-31 or 1.99999999999999992e88 < t Initial program 73.3%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 79.5%
+-commutative79.5%
Simplified79.5%
if -9.1999999999999994e-31 < t < 1.99999999999999992e88Initial program 93.2%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in t around 0 74.9%
Final simplification76.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.4e-30) (not (<= t 2e+88))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.4e-30) || !(t <= 2e+88)) {
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 <= (-5.4d-30)) .or. (.not. (t <= 2d+88))) 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 <= -5.4e-30) || !(t <= 2e+88)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.4e-30) or not (t <= 2e+88): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.4e-30) || !(t <= 2e+88)) 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 <= -5.4e-30) || ~((t <= 2e+88))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.4e-30], N[Not[LessEqual[t, 2e+88]], $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 -5.4 \cdot 10^{-30} \lor \neg \left(t \leq 2 \cdot 10^{+88}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -5.39999999999999975e-30 or 1.99999999999999992e88 < t Initial program 73.9%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 80.1%
+-commutative80.1%
Simplified80.1%
if -5.39999999999999975e-30 < t < 1.99999999999999992e88Initial program 92.6%
+-commutative92.6%
associate-*l/97.2%
fma-def97.2%
Simplified97.2%
fma-udef97.2%
associate-*l/92.6%
div-inv92.6%
*-commutative92.6%
associate-*l*97.1%
div-inv97.2%
Applied egg-rr97.2%
Taylor expanded in t around 0 74.5%
associate-*l/78.7%
*-commutative78.7%
Simplified78.7%
Final simplification79.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.3e-30) (not (<= t 2.3e+88))) (+ x y) (+ x (/ z (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.3e-30) || !(t <= 2.3e+88)) {
tmp = x + y;
} else {
tmp = x + (z / (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 <= (-5.3d-30)) .or. (.not. (t <= 2.3d+88))) then
tmp = x + y
else
tmp = x + (z / (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 <= -5.3e-30) || !(t <= 2.3e+88)) {
tmp = x + y;
} else {
tmp = x + (z / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.3e-30) or not (t <= 2.3e+88): tmp = x + y else: tmp = x + (z / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.3e-30) || !(t <= 2.3e+88)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5.3e-30) || ~((t <= 2.3e+88))) tmp = x + y; else tmp = x + (z / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.3e-30], N[Not[LessEqual[t, 2.3e+88]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.3 \cdot 10^{-30} \lor \neg \left(t \leq 2.3 \cdot 10^{+88}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -5.29999999999999974e-30 or 2.3000000000000002e88 < t Initial program 73.9%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 80.1%
+-commutative80.1%
Simplified80.1%
if -5.29999999999999974e-30 < t < 2.3000000000000002e88Initial program 92.6%
+-commutative92.6%
associate-*l/97.2%
fma-def97.2%
Simplified97.2%
fma-udef97.2%
associate-*l/92.6%
div-inv92.6%
*-commutative92.6%
associate-*l*97.1%
div-inv97.2%
Applied egg-rr97.2%
Taylor expanded in t around 0 74.5%
associate-*l/78.7%
*-commutative78.7%
Simplified78.7%
clear-num78.7%
un-div-inv78.8%
Applied egg-rr78.8%
Final simplification79.4%
(FPCore (x y z t a) :precision binary64 (if (<= a 3.1e+179) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 3.1e+179) {
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 (a <= 3.1d+179) 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 (a <= 3.1e+179) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 3.1e+179: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 3.1e+179) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 3.1e+179) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 3.1e+179], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.1 \cdot 10^{+179}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 3.1e179Initial program 84.0%
associate-/l*98.2%
Simplified98.2%
Taylor expanded in t around inf 58.0%
+-commutative58.0%
Simplified58.0%
if 3.1e179 < a Initial program 89.5%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in x around inf 89.1%
Final simplification60.2%
(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.4%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in x around inf 47.4%
Final simplification47.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 2024013
(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))))