
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
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(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Initial program 98.8%
Final simplification98.8%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.02e+36)
(+ x y)
(if (<= t 4.8e-55)
(+ x (/ y (/ a z)))
(if (<= t 4.8e-24)
(* y (/ (- t) (- a t)))
(if (<= t 6e+102)
(+ x (/ (* y z) a))
(if (<= t 5e+118)
(* t (/ (- y) (- a t)))
(if (<= t 3.5e+142) (+ x (* z (/ y a))) (+ x y))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.02e+36) {
tmp = x + y;
} else if (t <= 4.8e-55) {
tmp = x + (y / (a / z));
} else if (t <= 4.8e-24) {
tmp = y * (-t / (a - t));
} else if (t <= 6e+102) {
tmp = x + ((y * z) / a);
} else if (t <= 5e+118) {
tmp = t * (-y / (a - t));
} else if (t <= 3.5e+142) {
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 <= (-1.02d+36)) then
tmp = x + y
else if (t <= 4.8d-55) then
tmp = x + (y / (a / z))
else if (t <= 4.8d-24) then
tmp = y * (-t / (a - t))
else if (t <= 6d+102) then
tmp = x + ((y * z) / a)
else if (t <= 5d+118) then
tmp = t * (-y / (a - t))
else if (t <= 3.5d+142) 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 <= -1.02e+36) {
tmp = x + y;
} else if (t <= 4.8e-55) {
tmp = x + (y / (a / z));
} else if (t <= 4.8e-24) {
tmp = y * (-t / (a - t));
} else if (t <= 6e+102) {
tmp = x + ((y * z) / a);
} else if (t <= 5e+118) {
tmp = t * (-y / (a - t));
} else if (t <= 3.5e+142) {
tmp = x + (z * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.02e+36: tmp = x + y elif t <= 4.8e-55: tmp = x + (y / (a / z)) elif t <= 4.8e-24: tmp = y * (-t / (a - t)) elif t <= 6e+102: tmp = x + ((y * z) / a) elif t <= 5e+118: tmp = t * (-y / (a - t)) elif t <= 3.5e+142: tmp = x + (z * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.02e+36) tmp = Float64(x + y); elseif (t <= 4.8e-55) tmp = Float64(x + Float64(y / Float64(a / z))); elseif (t <= 4.8e-24) tmp = Float64(y * Float64(Float64(-t) / Float64(a - t))); elseif (t <= 6e+102) tmp = Float64(x + Float64(Float64(y * z) / a)); elseif (t <= 5e+118) tmp = Float64(t * Float64(Float64(-y) / Float64(a - t))); elseif (t <= 3.5e+142) 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 <= -1.02e+36) tmp = x + y; elseif (t <= 4.8e-55) tmp = x + (y / (a / z)); elseif (t <= 4.8e-24) tmp = y * (-t / (a - t)); elseif (t <= 6e+102) tmp = x + ((y * z) / a); elseif (t <= 5e+118) tmp = t * (-y / (a - t)); elseif (t <= 3.5e+142) tmp = x + (z * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.02e+36], N[(x + y), $MachinePrecision], If[LessEqual[t, 4.8e-55], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.8e-24], N[(y * N[((-t) / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e+102], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5e+118], N[(t * N[((-y) / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e+142], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.02 \cdot 10^{+36}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-55}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-24}:\\
\;\;\;\;y \cdot \frac{-t}{a - t}\\
\mathbf{elif}\;t \leq 6 \cdot 10^{+102}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+118}:\\
\;\;\;\;t \cdot \frac{-y}{a - t}\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+142}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.02000000000000003e36 or 3.49999999999999997e142 < t Initial program 100.0%
Taylor expanded in t around inf 85.6%
if -1.02000000000000003e36 < t < 4.79999999999999983e-55Initial program 97.5%
Taylor expanded in t around 0 85.1%
associate-/l*86.0%
Simplified86.0%
if 4.79999999999999983e-55 < t < 4.7999999999999996e-24Initial program 99.8%
Taylor expanded in z around 0 67.9%
mul-1-neg67.9%
associate-/l*58.1%
distribute-neg-frac58.1%
Simplified58.1%
Taylor expanded in x around 0 67.9%
mul-1-neg67.9%
unsub-neg67.9%
associate-/l*58.1%
Simplified58.1%
Taylor expanded in x around 0 67.9%
mul-1-neg67.9%
associate-*l/67.7%
*-commutative67.7%
distribute-lft-neg-in67.7%
Simplified67.7%
if 4.7999999999999996e-24 < t < 5.9999999999999996e102Initial program 99.7%
Taylor expanded in t around 0 65.6%
if 5.9999999999999996e102 < t < 4.99999999999999972e118Initial program 99.7%
Taylor expanded in z around 0 84.8%
mul-1-neg84.8%
associate-/l*99.7%
distribute-neg-frac99.7%
Simplified99.7%
Taylor expanded in x around 0 84.8%
mul-1-neg84.8%
unsub-neg84.8%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around 0 84.8%
mul-1-neg84.8%
associate-*r/99.7%
distribute-rgt-neg-out99.7%
distribute-neg-frac99.7%
Simplified99.7%
if 4.99999999999999972e118 < t < 3.49999999999999997e142Initial program 100.0%
Taylor expanded in t around 0 100.0%
associate-/l*100.0%
Simplified100.0%
associate-/r/100.0%
Applied egg-rr100.0%
Final simplification83.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.7e+36) (not (<= z 16500000000000.0))) (+ x (* y (/ z (- a t)))) (+ x (* t (/ y (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.7e+36) || !(z <= 16500000000000.0)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + (t * (y / (t - 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 ((z <= (-3.7d+36)) .or. (.not. (z <= 16500000000000.0d0))) then
tmp = x + (y * (z / (a - t)))
else
tmp = x + (t * (y / (t - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.7e+36) || !(z <= 16500000000000.0)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + (t * (y / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.7e+36) or not (z <= 16500000000000.0): tmp = x + (y * (z / (a - t))) else: tmp = x + (t * (y / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.7e+36) || !(z <= 16500000000000.0)) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); else tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.7e+36) || ~((z <= 16500000000000.0))) tmp = x + (y * (z / (a - t))); else tmp = x + (t * (y / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.7e+36], N[Not[LessEqual[z, 16500000000000.0]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+36} \lor \neg \left(z \leq 16500000000000\right):\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\end{array}
\end{array}
if z < -3.70000000000000029e36 or 1.65e13 < z Initial program 97.4%
Taylor expanded in z around inf 84.8%
if -3.70000000000000029e36 < z < 1.65e13Initial program 99.9%
Taylor expanded in z around 0 82.3%
mul-1-neg82.3%
associate-/l*93.3%
distribute-neg-frac93.3%
Simplified93.3%
frac-2neg93.3%
div-inv93.2%
remove-double-neg93.2%
distribute-neg-frac93.2%
sub-neg93.2%
distribute-neg-in93.2%
remove-double-neg93.2%
Applied egg-rr93.2%
associate-/r/93.8%
associate-*l/93.9%
*-lft-identity93.9%
+-commutative93.9%
unsub-neg93.9%
Simplified93.9%
Final simplification89.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.25e+39) (not (<= z 1.9e+15))) (+ x (/ y (/ (- a t) z))) (+ x (* t (/ y (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.25e+39) || !(z <= 1.9e+15)) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x + (t * (y / (t - 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 ((z <= (-2.25d+39)) .or. (.not. (z <= 1.9d+15))) then
tmp = x + (y / ((a - t) / z))
else
tmp = x + (t * (y / (t - a)))
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.25e+39) || !(z <= 1.9e+15)) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x + (t * (y / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.25e+39) or not (z <= 1.9e+15): tmp = x + (y / ((a - t) / z)) else: tmp = x + (t * (y / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.25e+39) || !(z <= 1.9e+15)) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); else tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.25e+39) || ~((z <= 1.9e+15))) tmp = x + (y / ((a - t) / z)); else tmp = x + (t * (y / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.25e+39], N[Not[LessEqual[z, 1.9e+15]], $MachinePrecision]], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+39} \lor \neg \left(z \leq 1.9 \cdot 10^{+15}\right):\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\end{array}
\end{array}
if z < -2.24999999999999998e39 or 1.9e15 < z Initial program 97.4%
Taylor expanded in z around inf 82.3%
associate-/l*85.7%
Simplified85.7%
if -2.24999999999999998e39 < z < 1.9e15Initial program 99.9%
Taylor expanded in z around 0 82.3%
mul-1-neg82.3%
associate-/l*93.3%
distribute-neg-frac93.3%
Simplified93.3%
frac-2neg93.3%
div-inv93.2%
remove-double-neg93.2%
distribute-neg-frac93.2%
sub-neg93.2%
distribute-neg-in93.2%
remove-double-neg93.2%
Applied egg-rr93.2%
associate-/r/93.8%
associate-*l/93.9%
*-lft-identity93.9%
+-commutative93.9%
unsub-neg93.9%
Simplified93.9%
Final simplification90.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.8e+40) (not (<= z 4.9e+38))) (+ x (/ y (/ (- a t) z))) (- x (* y (/ t (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.8e+40) || !(z <= 4.9e+38)) {
tmp = x + (y / ((a - t) / z));
} 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 ((z <= (-4.8d+40)) .or. (.not. (z <= 4.9d+38))) then
tmp = x + (y / ((a - t) / z))
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 ((z <= -4.8e+40) || !(z <= 4.9e+38)) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x - (y * (t / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.8e+40) or not (z <= 4.9e+38): tmp = x + (y / ((a - t) / z)) else: tmp = x - (y * (t / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.8e+40) || !(z <= 4.9e+38)) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); else tmp = Float64(x - Float64(y * Float64(t / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.8e+40) || ~((z <= 4.9e+38))) tmp = x + (y / ((a - t) / z)); else tmp = x - (y * (t / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.8e+40], N[Not[LessEqual[z, 4.9e+38]], $MachinePrecision]], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+40} \lor \neg \left(z \leq 4.9 \cdot 10^{+38}\right):\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{a - t}\\
\end{array}
\end{array}
if z < -4.8e40 or 4.90000000000000002e38 < z Initial program 97.3%
Taylor expanded in z around inf 82.5%
associate-/l*86.1%
Simplified86.1%
if -4.8e40 < z < 4.90000000000000002e38Initial program 99.9%
Taylor expanded in z around 0 95.4%
neg-mul-195.4%
distribute-neg-frac95.4%
Simplified95.4%
Final simplification91.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.5e+151) (+ x (/ (* y z) a)) (if (<= z 1.4e+173) (+ x (* t (/ y (- t a)))) (+ x (* z (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e+151) {
tmp = x + ((y * z) / a);
} else if (z <= 1.4e+173) {
tmp = x + (t * (y / (t - a)));
} 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 (z <= (-5.5d+151)) then
tmp = x + ((y * z) / a)
else if (z <= 1.4d+173) then
tmp = x + (t * (y / (t - a)))
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 (z <= -5.5e+151) {
tmp = x + ((y * z) / a);
} else if (z <= 1.4e+173) {
tmp = x + (t * (y / (t - a)));
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.5e+151: tmp = x + ((y * z) / a) elif z <= 1.4e+173: tmp = x + (t * (y / (t - a))) else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.5e+151) tmp = Float64(x + Float64(Float64(y * z) / a)); elseif (z <= 1.4e+173) tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); 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 (z <= -5.5e+151) tmp = x + ((y * z) / a); elseif (z <= 1.4e+173) tmp = x + (t * (y / (t - a))); else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e+151], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e+173], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+151}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+173}:\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -5.4999999999999994e151Initial program 93.6%
Taylor expanded in t around 0 73.0%
if -5.4999999999999994e151 < z < 1.39999999999999991e173Initial program 99.9%
Taylor expanded in z around 0 75.3%
mul-1-neg75.3%
associate-/l*85.2%
distribute-neg-frac85.2%
Simplified85.2%
frac-2neg85.2%
div-inv85.0%
remove-double-neg85.0%
distribute-neg-frac85.0%
sub-neg85.0%
distribute-neg-in85.0%
remove-double-neg85.0%
Applied egg-rr85.0%
associate-/r/85.5%
associate-*l/85.5%
*-lft-identity85.5%
+-commutative85.5%
unsub-neg85.5%
Simplified85.5%
if 1.39999999999999991e173 < z Initial program 96.6%
Taylor expanded in t around 0 70.8%
associate-/l*77.6%
Simplified77.6%
associate-/r/81.0%
Applied egg-rr81.0%
Final simplification83.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.4e+31) (not (<= t 1.95e+101))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.4e+31) || !(t <= 1.95e+101)) {
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 <= (-1.4d+31)) .or. (.not. (t <= 1.95d+101))) 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 <= -1.4e+31) || !(t <= 1.95e+101)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.4e+31) or not (t <= 1.95e+101): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.4e+31) || !(t <= 1.95e+101)) 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 <= -1.4e+31) || ~((t <= 1.95e+101))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.4e+31], N[Not[LessEqual[t, 1.95e+101]], $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 -1.4 \cdot 10^{+31} \lor \neg \left(t \leq 1.95 \cdot 10^{+101}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -1.40000000000000008e31 or 1.95e101 < t Initial program 99.9%
Taylor expanded in t around inf 82.0%
if -1.40000000000000008e31 < t < 1.95e101Initial program 98.0%
Taylor expanded in t around 0 76.9%
associate-/l*77.6%
Simplified77.6%
associate-/r/76.6%
Applied egg-rr76.6%
Final simplification78.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.02) (not (<= a 1.15e+91))) (+ x (/ y (/ a z))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.02) || !(a <= 1.15e+91)) {
tmp = x + (y / (a / z));
} 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 ((a <= (-1.02d0)) .or. (.not. (a <= 1.15d+91))) then
tmp = x + (y / (a / z))
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 ((a <= -1.02) || !(a <= 1.15e+91)) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.02) or not (a <= 1.15e+91): tmp = x + (y / (a / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.02) || !(a <= 1.15e+91)) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.02) || ~((a <= 1.15e+91))) tmp = x + (y / (a / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.02], N[Not[LessEqual[a, 1.15e+91]], $MachinePrecision]], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.02 \lor \neg \left(a \leq 1.15 \cdot 10^{+91}\right):\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -1.02 or 1.14999999999999996e91 < a Initial program 99.9%
Taylor expanded in t around 0 79.9%
associate-/l*82.8%
Simplified82.8%
if -1.02 < a < 1.14999999999999996e91Initial program 97.8%
Taylor expanded in t around inf 71.9%
Final simplification77.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -8.4e-104) (not (<= t 1.7e-101))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8.4e-104) || !(t <= 1.7e-101)) {
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 <= (-8.4d-104)) .or. (.not. (t <= 1.7d-101))) 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 <= -8.4e-104) || !(t <= 1.7e-101)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -8.4e-104) or not (t <= 1.7e-101): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -8.4e-104) || !(t <= 1.7e-101)) 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 <= -8.4e-104) || ~((t <= 1.7e-101))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -8.4e-104], N[Not[LessEqual[t, 1.7e-101]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.4 \cdot 10^{-104} \lor \neg \left(t \leq 1.7 \cdot 10^{-101}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -8.39999999999999994e-104 or 1.69999999999999995e-101 < t Initial program 99.4%
Taylor expanded in t around inf 69.9%
if -8.39999999999999994e-104 < t < 1.69999999999999995e-101Initial program 97.5%
Taylor expanded in z around 0 75.0%
mul-1-neg75.0%
associate-/l*76.2%
distribute-neg-frac76.2%
Simplified76.2%
Taylor expanded in x around inf 72.5%
Final simplification70.7%
(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 98.8%
Taylor expanded in z around 0 69.1%
mul-1-neg69.1%
associate-/l*76.4%
distribute-neg-frac76.4%
Simplified76.4%
Taylor expanded in x around inf 52.9%
Final simplification52.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y * ((z - t) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (a - t)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023322
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))