
(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 13 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 86.3%
associate-/l*98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.5e+27) (not (<= t 1e+22))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.5e+27) || !(t <= 1e+22)) {
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 <= (-3.5d+27)) .or. (.not. (t <= 1d+22))) 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 <= -3.5e+27) || !(t <= 1e+22)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.5e+27) or not (t <= 1e+22): tmp = x + y else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.5e+27) || !(t <= 1e+22)) 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 <= -3.5e+27) || ~((t <= 1e+22))) 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, -3.5e+27], N[Not[LessEqual[t, 1e+22]], $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 -3.5 \cdot 10^{+27} \lor \neg \left(t \leq 10^{+22}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -3.5000000000000002e27 or 1e22 < t Initial program 75.8%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 86.7%
+-commutative86.7%
Simplified86.7%
if -3.5000000000000002e27 < t < 1e22Initial program 95.2%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in z around inf 86.8%
associate-*l/90.1%
*-commutative90.1%
Simplified90.1%
Final simplification88.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.92e-10) (not (<= t 245000000000.0))) (+ x (* (/ y t) (- t z))) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.92e-10) || !(t <= 245000000000.0)) {
tmp = x + ((y / t) * (t - z));
} 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.92d-10)) .or. (.not. (t <= 245000000000.0d0))) then
tmp = x + ((y / t) * (t - z))
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.92e-10) || !(t <= 245000000000.0)) {
tmp = x + ((y / t) * (t - z));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.92e-10) or not (t <= 245000000000.0): tmp = x + ((y / t) * (t - z)) else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.92e-10) || !(t <= 245000000000.0)) tmp = Float64(x + Float64(Float64(y / t) * Float64(t - z))); 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.92e-10) || ~((t <= 245000000000.0))) tmp = x + ((y / t) * (t - z)); else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.92e-10], N[Not[LessEqual[t, 245000000000.0]], $MachinePrecision]], N[(x + N[(N[(y / t), $MachinePrecision] * N[(t - z), $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 -1.92 \cdot 10^{-10} \lor \neg \left(t \leq 245000000000\right):\\
\;\;\;\;x + \frac{y}{t} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -1.9200000000000001e-10 or 2.45e11 < t Initial program 77.9%
+-commutative77.9%
associate-*l/93.5%
fma-def93.5%
Simplified93.5%
fma-udef93.5%
associate-*l/77.9%
div-inv77.8%
*-commutative77.8%
associate-*l*93.4%
div-inv93.5%
Applied egg-rr93.5%
Taylor expanded in a around 0 73.0%
mul-1-neg73.0%
unsub-neg73.0%
associate-/l*95.1%
associate-/r/90.9%
Simplified90.9%
if -1.9200000000000001e-10 < t < 2.45e11Initial program 94.8%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in z around inf 86.5%
associate-*l/90.9%
*-commutative90.9%
Simplified90.9%
Final simplification90.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.5e-9) (not (<= t 500000000.0))) (- 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 <= -3.5e-9) || !(t <= 500000000.0)) {
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 <= (-3.5d-9)) .or. (.not. (t <= 500000000.0d0))) 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 <= -3.5e-9) || !(t <= 500000000.0)) {
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 <= -3.5e-9) or not (t <= 500000000.0): 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 <= -3.5e-9) || !(t <= 500000000.0)) 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 <= -3.5e-9) || ~((t <= 500000000.0))) 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, -3.5e-9], N[Not[LessEqual[t, 500000000.0]], $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 -3.5 \cdot 10^{-9} \lor \neg \left(t \leq 500000000\right):\\
\;\;\;\;x - \frac{y}{\frac{t}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -3.4999999999999999e-9 or 5e8 < t Initial program 77.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 73.0%
mul-1-neg73.0%
unsub-neg73.0%
associate-/l*95.1%
Simplified95.1%
if -3.4999999999999999e-9 < t < 5e8Initial program 94.8%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in z around inf 86.5%
associate-*l/90.9%
*-commutative90.9%
Simplified90.9%
Final simplification93.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.6e-235) (+ x y) (if (<= t 9e-309) (* y (/ z a)) (if (<= t 6.5e-6) x (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.6e-235) {
tmp = x + y;
} else if (t <= 9e-309) {
tmp = y * (z / a);
} else if (t <= 6.5e-6) {
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 <= (-4.6d-235)) then
tmp = x + y
else if (t <= 9d-309) then
tmp = y * (z / a)
else if (t <= 6.5d-6) 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 <= -4.6e-235) {
tmp = x + y;
} else if (t <= 9e-309) {
tmp = y * (z / a);
} else if (t <= 6.5e-6) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.6e-235: tmp = x + y elif t <= 9e-309: tmp = y * (z / a) elif t <= 6.5e-6: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.6e-235) tmp = Float64(x + y); elseif (t <= 9e-309) tmp = Float64(y * Float64(z / a)); elseif (t <= 6.5e-6) 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 <= -4.6e-235) tmp = x + y; elseif (t <= 9e-309) tmp = y * (z / a); elseif (t <= 6.5e-6) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.6e-235], N[(x + y), $MachinePrecision], If[LessEqual[t, 9e-309], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.5e-6], x, N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.6 \cdot 10^{-235}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-309}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-6}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -4.59999999999999995e-235 or 6.4999999999999996e-6 < t Initial program 83.8%
associate-/l*98.9%
Simplified98.9%
Taylor expanded in t around inf 76.6%
+-commutative76.6%
Simplified76.6%
if -4.59999999999999995e-235 < t < 9.0000000000000021e-309Initial program 91.6%
associate-/l*82.5%
Simplified82.5%
Taylor expanded in a around inf 83.2%
+-commutative83.2%
associate-/l*74.1%
Simplified74.1%
Taylor expanded in y around inf 65.4%
div-sub65.4%
Simplified65.4%
Taylor expanded in z around inf 64.8%
if 9.0000000000000021e-309 < t < 6.4999999999999996e-6Initial program 93.5%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around inf 61.2%
Final simplification72.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -6.1e-235) (+ x y) (if (<= t -5e-310) (/ y (/ a z)) (if (<= t 6.5e-6) x (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.1e-235) {
tmp = x + y;
} else if (t <= -5e-310) {
tmp = y / (a / z);
} else if (t <= 6.5e-6) {
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 <= (-6.1d-235)) then
tmp = x + y
else if (t <= (-5d-310)) then
tmp = y / (a / z)
else if (t <= 6.5d-6) 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 <= -6.1e-235) {
tmp = x + y;
} else if (t <= -5e-310) {
tmp = y / (a / z);
} else if (t <= 6.5e-6) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -6.1e-235: tmp = x + y elif t <= -5e-310: tmp = y / (a / z) elif t <= 6.5e-6: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.1e-235) tmp = Float64(x + y); elseif (t <= -5e-310) tmp = Float64(y / Float64(a / z)); elseif (t <= 6.5e-6) 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 <= -6.1e-235) tmp = x + y; elseif (t <= -5e-310) tmp = y / (a / z); elseif (t <= 6.5e-6) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.1e-235], N[(x + y), $MachinePrecision], If[LessEqual[t, -5e-310], N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.5e-6], x, N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.1 \cdot 10^{-235}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-6}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -6.09999999999999988e-235 or 6.4999999999999996e-6 < t Initial program 83.8%
associate-/l*98.9%
Simplified98.9%
Taylor expanded in t around inf 76.6%
+-commutative76.6%
Simplified76.6%
if -6.09999999999999988e-235 < t < -4.999999999999985e-310Initial program 91.6%
associate-/l*82.5%
Simplified82.5%
associate-/l*91.6%
+-commutative91.6%
associate-/l*82.5%
div-inv82.5%
fma-def82.5%
clear-num82.2%
Applied egg-rr82.2%
Taylor expanded in z around inf 62.0%
associate-/l*65.1%
Simplified65.1%
Taylor expanded in a around inf 65.1%
if -4.999999999999985e-310 < t < 6.4999999999999996e-6Initial program 93.5%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around inf 61.2%
Final simplification72.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -3e-232) (+ x y) (if (<= t 4e-309) (* y (/ (- z t) a)) (if (<= t 6.5e-6) x (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3e-232) {
tmp = x + y;
} else if (t <= 4e-309) {
tmp = y * ((z - t) / a);
} else if (t <= 6.5e-6) {
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 <= (-3d-232)) then
tmp = x + y
else if (t <= 4d-309) then
tmp = y * ((z - t) / a)
else if (t <= 6.5d-6) 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 <= -3e-232) {
tmp = x + y;
} else if (t <= 4e-309) {
tmp = y * ((z - t) / a);
} else if (t <= 6.5e-6) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3e-232: tmp = x + y elif t <= 4e-309: tmp = y * ((z - t) / a) elif t <= 6.5e-6: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3e-232) tmp = Float64(x + y); elseif (t <= 4e-309) tmp = Float64(y * Float64(Float64(z - t) / a)); elseif (t <= 6.5e-6) 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 <= -3e-232) tmp = x + y; elseif (t <= 4e-309) tmp = y * ((z - t) / a); elseif (t <= 6.5e-6) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3e-232], N[(x + y), $MachinePrecision], If[LessEqual[t, 4e-309], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.5e-6], x, N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{-232}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-309}:\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-6}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -2.9999999999999999e-232 or 6.4999999999999996e-6 < t Initial program 83.8%
associate-/l*98.9%
Simplified98.9%
Taylor expanded in t around inf 76.6%
+-commutative76.6%
Simplified76.6%
if -2.9999999999999999e-232 < t < 3.9999999999999977e-309Initial program 91.6%
associate-/l*82.5%
Simplified82.5%
Taylor expanded in a around inf 83.2%
+-commutative83.2%
associate-/l*74.1%
Simplified74.1%
Taylor expanded in y around inf 65.4%
div-sub65.4%
Simplified65.4%
if 3.9999999999999977e-309 < t < 6.4999999999999996e-6Initial program 93.5%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around inf 61.2%
Final simplification72.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -6.5e-235) (+ x y) (if (<= t -5e-309) (* (- z t) (/ y a)) (if (<= t 6.4e-6) x (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.5e-235) {
tmp = x + y;
} else if (t <= -5e-309) {
tmp = (z - t) * (y / a);
} else if (t <= 6.4e-6) {
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 <= (-6.5d-235)) then
tmp = x + y
else if (t <= (-5d-309)) then
tmp = (z - t) * (y / a)
else if (t <= 6.4d-6) 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 <= -6.5e-235) {
tmp = x + y;
} else if (t <= -5e-309) {
tmp = (z - t) * (y / a);
} else if (t <= 6.4e-6) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -6.5e-235: tmp = x + y elif t <= -5e-309: tmp = (z - t) * (y / a) elif t <= 6.4e-6: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.5e-235) tmp = Float64(x + y); elseif (t <= -5e-309) tmp = Float64(Float64(z - t) * Float64(y / a)); elseif (t <= 6.4e-6) 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 <= -6.5e-235) tmp = x + y; elseif (t <= -5e-309) tmp = (z - t) * (y / a); elseif (t <= 6.4e-6) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.5e-235], N[(x + y), $MachinePrecision], If[LessEqual[t, -5e-309], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.4e-6], x, N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{-235}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -5 \cdot 10^{-309}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq 6.4 \cdot 10^{-6}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -6.49999999999999973e-235 or 6.3999999999999997e-6 < t Initial program 83.8%
associate-/l*98.9%
Simplified98.9%
Taylor expanded in t around inf 76.6%
+-commutative76.6%
Simplified76.6%
if -6.49999999999999973e-235 < t < -4.9999999999999995e-309Initial program 91.6%
associate-/l*82.5%
Simplified82.5%
associate-/l*91.6%
+-commutative91.6%
associate-/l*82.5%
div-inv82.5%
fma-def82.5%
clear-num82.2%
Applied egg-rr82.2%
Taylor expanded in y around -inf 76.5%
associate-*l/76.1%
Applied egg-rr76.1%
Taylor expanded in a around inf 76.1%
if -4.9999999999999995e-309 < t < 6.3999999999999997e-6Initial program 93.5%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around inf 61.2%
Final simplification73.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -9.4e-184) (+ x y) (if (<= t 7e-309) (* z (/ y (- a t))) (if (<= t 6.4e-6) x (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9.4e-184) {
tmp = x + y;
} else if (t <= 7e-309) {
tmp = z * (y / (a - t));
} else if (t <= 6.4e-6) {
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 <= (-9.4d-184)) then
tmp = x + y
else if (t <= 7d-309) then
tmp = z * (y / (a - t))
else if (t <= 6.4d-6) 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 <= -9.4e-184) {
tmp = x + y;
} else if (t <= 7e-309) {
tmp = z * (y / (a - t));
} else if (t <= 6.4e-6) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -9.4e-184: tmp = x + y elif t <= 7e-309: tmp = z * (y / (a - t)) elif t <= 6.4e-6: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -9.4e-184) tmp = Float64(x + y); elseif (t <= 7e-309) tmp = Float64(z * Float64(y / Float64(a - t))); elseif (t <= 6.4e-6) 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 <= -9.4e-184) tmp = x + y; elseif (t <= 7e-309) tmp = z * (y / (a - t)); elseif (t <= 6.4e-6) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -9.4e-184], N[(x + y), $MachinePrecision], If[LessEqual[t, 7e-309], N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.4e-6], x, N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.4 \cdot 10^{-184}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-309}:\\
\;\;\;\;z \cdot \frac{y}{a - t}\\
\mathbf{elif}\;t \leq 6.4 \cdot 10^{-6}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -9.40000000000000039e-184 or 6.3999999999999997e-6 < t Initial program 83.4%
associate-/l*98.8%
Simplified98.8%
Taylor expanded in t around inf 78.7%
+-commutative78.7%
Simplified78.7%
if -9.40000000000000039e-184 < t < 6.9999999999999984e-309Initial program 90.9%
associate-/l*90.3%
Simplified90.3%
associate-/l*90.9%
+-commutative90.9%
associate-/l*90.3%
div-inv90.4%
fma-def90.4%
clear-num90.2%
Applied egg-rr90.2%
Taylor expanded in z around inf 52.1%
associate-/l*58.3%
Simplified58.3%
associate-/r/61.0%
Applied egg-rr61.0%
if 6.9999999999999984e-309 < t < 6.3999999999999997e-6Initial program 93.5%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around inf 61.2%
Final simplification73.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.8e+15) (not (<= t 350.0))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.8e+15) || !(t <= 350.0)) {
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 <= (-1.8d+15)) .or. (.not. (t <= 350.0d0))) 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 <= -1.8e+15) || !(t <= 350.0)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.8e+15) or not (t <= 350.0): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.8e+15) || !(t <= 350.0)) 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 <= -1.8e+15) || ~((t <= 350.0))) tmp = x + y; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.8e+15], N[Not[LessEqual[t, 350.0]], $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 -1.8 \cdot 10^{+15} \lor \neg \left(t \leq 350\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -1.8e15 or 350 < t Initial program 77.5%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 86.1%
+-commutative86.1%
Simplified86.1%
if -1.8e15 < t < 350Initial program 94.9%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in t around 0 75.5%
Final simplification80.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -15000000000000.0) (not (<= t 4400.0))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -15000000000000.0) || !(t <= 4400.0)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
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 <= (-15000000000000.0d0)) .or. (.not. (t <= 4400.0d0))) then
tmp = x + y
else
tmp = x + (y / (a / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -15000000000000.0) || !(t <= 4400.0)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -15000000000000.0) or not (t <= 4400.0): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -15000000000000.0) || !(t <= 4400.0)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -15000000000000.0) || ~((t <= 4400.0))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -15000000000000.0], N[Not[LessEqual[t, 4400.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -15000000000000 \lor \neg \left(t \leq 4400\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -1.5e13 or 4400 < t Initial program 77.5%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 86.1%
+-commutative86.1%
Simplified86.1%
if -1.5e13 < t < 4400Initial program 94.9%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in t around 0 75.5%
+-commutative75.5%
associate-/l*77.7%
Simplified77.7%
Final simplification81.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.2e-216) (not (<= t 6.4e-6))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.2e-216) || !(t <= 6.4e-6)) {
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 <= (-2.2d-216)) .or. (.not. (t <= 6.4d-6))) 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 <= -2.2e-216) || !(t <= 6.4e-6)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.2e-216) or not (t <= 6.4e-6): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.2e-216) || !(t <= 6.4e-6)) 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 <= -2.2e-216) || ~((t <= 6.4e-6))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.2e-216], N[Not[LessEqual[t, 6.4e-6]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{-216} \lor \neg \left(t \leq 6.4 \cdot 10^{-6}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.1999999999999999e-216 or 6.3999999999999997e-6 < t Initial program 83.5%
associate-/l*98.9%
Simplified98.9%
Taylor expanded in t around inf 77.3%
+-commutative77.3%
Simplified77.3%
if -2.1999999999999999e-216 < t < 6.3999999999999997e-6Initial program 93.4%
associate-/l*97.1%
Simplified97.1%
Taylor expanded in x around inf 53.9%
Final simplification70.6%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 86.3%
associate-/l*98.4%
Simplified98.4%
Taylor expanded in x around inf 54.9%
Final simplification54.9%
(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 2024027
(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))))