
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (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 / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
Initial program 98.8%
clear-num98.8%
un-div-inv99.0%
Applied egg-rr99.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -115000000000.0)
(+ x y)
(if (<= z 1.5e-47)
(+ x (* t (/ y a)))
(if (<= z 4.1e+153) (- x (* t (/ y z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -115000000000.0) {
tmp = x + y;
} else if (z <= 1.5e-47) {
tmp = x + (t * (y / a));
} else if (z <= 4.1e+153) {
tmp = x - (t * (y / 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 (z <= (-115000000000.0d0)) then
tmp = x + y
else if (z <= 1.5d-47) then
tmp = x + (t * (y / a))
else if (z <= 4.1d+153) then
tmp = x - (t * (y / 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 (z <= -115000000000.0) {
tmp = x + y;
} else if (z <= 1.5e-47) {
tmp = x + (t * (y / a));
} else if (z <= 4.1e+153) {
tmp = x - (t * (y / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -115000000000.0: tmp = x + y elif z <= 1.5e-47: tmp = x + (t * (y / a)) elif z <= 4.1e+153: tmp = x - (t * (y / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -115000000000.0) tmp = Float64(x + y); elseif (z <= 1.5e-47) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 4.1e+153) tmp = Float64(x - Float64(t * Float64(y / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -115000000000.0) tmp = x + y; elseif (z <= 1.5e-47) tmp = x + (t * (y / a)); elseif (z <= 4.1e+153) tmp = x - (t * (y / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -115000000000.0], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.5e-47], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.1e+153], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -115000000000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-47}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+153}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.15e11 or 4.10000000000000017e153 < z Initial program 100.0%
Taylor expanded in z around inf 85.1%
+-commutative85.1%
Simplified85.1%
if -1.15e11 < z < 1.50000000000000008e-47Initial program 97.1%
Taylor expanded in z around 0 72.1%
+-commutative72.1%
associate-/l*76.3%
Simplified76.3%
if 1.50000000000000008e-47 < z < 4.10000000000000017e153Initial program 99.9%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 84.1%
mul-1-neg84.1%
distribute-frac-neg84.1%
sub-neg84.1%
distribute-neg-in84.1%
remove-double-neg84.1%
+-commutative84.1%
sub-neg84.1%
Simplified84.1%
Taylor expanded in a around 0 72.6%
mul-1-neg72.6%
associate-/l*74.9%
distribute-lft-neg-in74.9%
cancel-sign-sub-inv74.9%
Simplified74.9%
Final simplification79.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.06e+89) (not (<= z 1.04e+43))) (+ x (* y (- 1.0 (/ t z)))) (+ x (/ y (/ (- a z) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.06e+89) || !(z <= 1.04e+43)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y / ((a - z) / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.06d+89)) .or. (.not. (z <= 1.04d+43))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + (y / ((a - z) / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.06e+89) || !(z <= 1.04e+43)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y / ((a - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.06e+89) or not (z <= 1.04e+43): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (y / ((a - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.06e+89) || !(z <= 1.04e+43)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.06e+89) || ~((z <= 1.04e+43))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (y / ((a - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.06e+89], N[Not[LessEqual[z, 1.04e+43]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.06 \cdot 10^{+89} \lor \neg \left(z \leq 1.04 \cdot 10^{+43}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\end{array}
\end{array}
if z < -1.05999999999999997e89 or 1.03999999999999996e43 < z Initial program 100.0%
Taylor expanded in a around 0 63.7%
associate-/l*90.4%
div-sub90.4%
*-inverses90.4%
Simplified90.4%
if -1.05999999999999997e89 < z < 1.03999999999999996e43Initial program 97.9%
clear-num97.8%
un-div-inv98.2%
Applied egg-rr98.2%
Taylor expanded in t around inf 90.2%
mul-1-neg90.2%
distribute-frac-neg90.2%
sub-neg90.2%
distribute-neg-in90.2%
remove-double-neg90.2%
+-commutative90.2%
sub-neg90.2%
Simplified90.2%
Final simplification90.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.5e+90) (not (<= z 1.55e+43))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.5e+90) || !(z <= 1.55e+43)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y * (t / (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 ((z <= (-5.5d+90)) .or. (.not. (z <= 1.55d+43))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + (y * (t / (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 ((z <= -5.5e+90) || !(z <= 1.55e+43)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.5e+90) or not (z <= 1.55e+43): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.5e+90) || !(z <= 1.55e+43)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.5e+90) || ~((z <= 1.55e+43))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.5e+90], N[Not[LessEqual[z, 1.55e+43]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+90} \lor \neg \left(z \leq 1.55 \cdot 10^{+43}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -5.49999999999999999e90 or 1.5500000000000001e43 < z Initial program 100.0%
Taylor expanded in a around 0 63.7%
associate-/l*90.4%
div-sub90.4%
*-inverses90.4%
Simplified90.4%
if -5.49999999999999999e90 < z < 1.5500000000000001e43Initial program 97.9%
Taylor expanded in t around inf 85.9%
associate-*r/85.9%
mul-1-neg85.9%
distribute-lft-neg-out85.9%
*-commutative85.9%
*-lft-identity85.9%
times-frac89.8%
/-rgt-identity89.8%
distribute-neg-frac89.8%
distribute-neg-frac289.8%
neg-sub089.8%
sub-neg89.8%
+-commutative89.8%
associate--r+89.8%
neg-sub089.8%
remove-double-neg89.8%
Simplified89.8%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1e-103) (not (<= z 8.8e+42))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1e-103) || !(z <= 8.8e+42)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (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 ((z <= (-1d-103)) .or. (.not. (z <= 8.8d+42))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + (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 ((z <= -1e-103) || !(z <= 8.8e+42)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1e-103) or not (z <= 8.8e+42): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1e-103) || !(z <= 8.8e+42)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1e-103) || ~((z <= 8.8e+42))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1e-103], N[Not[LessEqual[z, 8.8e+42]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-103} \lor \neg \left(z \leq 8.8 \cdot 10^{+42}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -9.99999999999999958e-104 or 8.8000000000000005e42 < z Initial program 99.9%
Taylor expanded in a around 0 66.9%
associate-/l*85.4%
div-sub85.4%
*-inverses85.4%
Simplified85.4%
if -9.99999999999999958e-104 < z < 8.8000000000000005e42Initial program 96.7%
Taylor expanded in z around 0 76.6%
+-commutative76.6%
associate-/l*81.4%
Simplified81.4%
Final simplification84.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -5.6e+85)
(+ x (* y (/ t (- a z))))
(if (<= t 21000000000000.0)
(+ x (* y (/ z (- z a))))
(+ x (* t (/ y (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.6e+85) {
tmp = x + (y * (t / (a - z)));
} else if (t <= 21000000000000.0) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (t * (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 <= (-5.6d+85)) then
tmp = x + (y * (t / (a - z)))
else if (t <= 21000000000000.0d0) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + (t * (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 <= -5.6e+85) {
tmp = x + (y * (t / (a - z)));
} else if (t <= 21000000000000.0) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.6e+85: tmp = x + (y * (t / (a - z))) elif t <= 21000000000000.0: tmp = x + (y * (z / (z - a))) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.6e+85) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); elseif (t <= 21000000000000.0) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5.6e+85) tmp = x + (y * (t / (a - z))); elseif (t <= 21000000000000.0) tmp = x + (y * (z / (z - a))); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.6e+85], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 21000000000000.0], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.6 \cdot 10^{+85}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{elif}\;t \leq 21000000000000:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if t < -5.5999999999999998e85Initial program 97.7%
Taylor expanded in t around inf 78.1%
associate-*r/78.1%
mul-1-neg78.1%
distribute-lft-neg-out78.1%
*-commutative78.1%
*-lft-identity78.1%
times-frac90.5%
/-rgt-identity90.5%
distribute-neg-frac90.5%
distribute-neg-frac290.5%
neg-sub090.5%
sub-neg90.5%
+-commutative90.5%
associate--r+90.5%
neg-sub090.5%
remove-double-neg90.5%
Simplified90.5%
if -5.5999999999999998e85 < t < 2.1e13Initial program 99.9%
Taylor expanded in t around 0 72.4%
+-commutative72.4%
associate-/l*89.9%
Simplified89.9%
if 2.1e13 < t Initial program 97.1%
Taylor expanded in t around inf 84.5%
mul-1-neg84.5%
associate-/l*94.2%
Simplified94.2%
Final simplification91.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.8e+85) (+ x (* y (/ t (- a z)))) (if (<= t 3.5e+16) (+ x (* y (/ z (- z a)))) (+ x (/ y (/ (- a z) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.8e+85) {
tmp = x + (y * (t / (a - z)));
} else if (t <= 3.5e+16) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y / ((a - z) / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-4.8d+85)) then
tmp = x + (y * (t / (a - z)))
else if (t <= 3.5d+16) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + (y / ((a - z) / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.8e+85) {
tmp = x + (y * (t / (a - z)));
} else if (t <= 3.5e+16) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y / ((a - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.8e+85: tmp = x + (y * (t / (a - z))) elif t <= 3.5e+16: tmp = x + (y * (z / (z - a))) else: tmp = x + (y / ((a - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.8e+85) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); elseif (t <= 3.5e+16) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.8e+85) tmp = x + (y * (t / (a - z))); elseif (t <= 3.5e+16) tmp = x + (y * (z / (z - a))); else tmp = x + (y / ((a - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.8e+85], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e+16], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+85}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+16}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\end{array}
\end{array}
if t < -4.79999999999999993e85Initial program 97.7%
Taylor expanded in t around inf 78.1%
associate-*r/78.1%
mul-1-neg78.1%
distribute-lft-neg-out78.1%
*-commutative78.1%
*-lft-identity78.1%
times-frac90.5%
/-rgt-identity90.5%
distribute-neg-frac90.5%
distribute-neg-frac290.5%
neg-sub090.5%
sub-neg90.5%
+-commutative90.5%
associate--r+90.5%
neg-sub090.5%
remove-double-neg90.5%
Simplified90.5%
if -4.79999999999999993e85 < t < 3.5e16Initial program 99.9%
Taylor expanded in t around 0 72.4%
+-commutative72.4%
associate-/l*89.9%
Simplified89.9%
if 3.5e16 < t Initial program 97.1%
clear-num97.1%
un-div-inv97.8%
Applied egg-rr97.8%
Taylor expanded in t around inf 92.1%
mul-1-neg92.1%
distribute-frac-neg92.1%
sub-neg92.1%
distribute-neg-in92.1%
remove-double-neg92.1%
+-commutative92.1%
sub-neg92.1%
Simplified92.1%
Final simplification90.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -750000000000.0) (not (<= z 3.1e+141))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -750000000000.0) || !(z <= 3.1e+141)) {
tmp = x + y;
} else {
tmp = x + (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 ((z <= (-750000000000.0d0)) .or. (.not. (z <= 3.1d+141))) then
tmp = x + y
else
tmp = x + (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 ((z <= -750000000000.0) || !(z <= 3.1e+141)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -750000000000.0) or not (z <= 3.1e+141): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -750000000000.0) || !(z <= 3.1e+141)) tmp = Float64(x + y); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -750000000000.0) || ~((z <= 3.1e+141))) tmp = x + y; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -750000000000.0], N[Not[LessEqual[z, 3.1e+141]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -750000000000 \lor \neg \left(z \leq 3.1 \cdot 10^{+141}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -7.5e11 or 3.10000000000000004e141 < z Initial program 100.0%
Taylor expanded in z around inf 84.6%
+-commutative84.6%
Simplified84.6%
if -7.5e11 < z < 3.10000000000000004e141Initial program 97.9%
Taylor expanded in z around 0 68.5%
+-commutative68.5%
associate-/l*73.1%
Simplified73.1%
Final simplification78.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -95000000000.0) (not (<= z 3.1e+141))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -95000000000.0) || !(z <= 3.1e+141)) {
tmp = x + y;
} else {
tmp = x + (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 ((z <= (-95000000000.0d0)) .or. (.not. (z <= 3.1d+141))) then
tmp = x + y
else
tmp = x + (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 ((z <= -95000000000.0) || !(z <= 3.1e+141)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -95000000000.0) or not (z <= 3.1e+141): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -95000000000.0) || !(z <= 3.1e+141)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -95000000000.0) || ~((z <= 3.1e+141))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -95000000000.0], N[Not[LessEqual[z, 3.1e+141]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -95000000000 \lor \neg \left(z \leq 3.1 \cdot 10^{+141}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -9.5e10 or 3.10000000000000004e141 < z Initial program 100.0%
Taylor expanded in z around inf 84.6%
+-commutative84.6%
Simplified84.6%
if -9.5e10 < z < 3.10000000000000004e141Initial program 97.9%
clear-num97.8%
un-div-inv98.2%
Applied egg-rr98.2%
Taylor expanded in z around 0 72.4%
Final simplification77.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -120000000000.0) (not (<= z 3.1e+141))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -120000000000.0) || !(z <= 3.1e+141)) {
tmp = x + y;
} else {
tmp = x + (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 <= (-120000000000.0d0)) .or. (.not. (z <= 3.1d+141))) then
tmp = x + y
else
tmp = x + (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 <= -120000000000.0) || !(z <= 3.1e+141)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -120000000000.0) or not (z <= 3.1e+141): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -120000000000.0) || !(z <= 3.1e+141)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -120000000000.0) || ~((z <= 3.1e+141))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -120000000000.0], N[Not[LessEqual[z, 3.1e+141]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -120000000000 \lor \neg \left(z \leq 3.1 \cdot 10^{+141}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.2e11 or 3.10000000000000004e141 < z Initial program 100.0%
Taylor expanded in z around inf 84.6%
+-commutative84.6%
Simplified84.6%
if -1.2e11 < z < 3.10000000000000004e141Initial program 97.9%
Taylor expanded in z around 0 71.4%
Final simplification77.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -2e+226) x (if (<= a 8e+230) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2e+226) {
tmp = x;
} else if (a <= 8e+230) {
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 <= (-2d+226)) then
tmp = x
else if (a <= 8d+230) 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 <= -2e+226) {
tmp = x;
} else if (a <= 8e+230) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2e+226: tmp = x elif a <= 8e+230: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2e+226) tmp = x; elseif (a <= 8e+230) 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 <= -2e+226) tmp = x; elseif (a <= 8e+230) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2e+226], x, If[LessEqual[a, 8e+230], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{+226}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 8 \cdot 10^{+230}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.99999999999999992e226 or 8.0000000000000008e230 < a Initial program 99.8%
Taylor expanded in x around inf 79.1%
if -1.99999999999999992e226 < a < 8.0000000000000008e230Initial program 98.6%
Taylor expanded in z around inf 65.4%
+-commutative65.4%
Simplified65.4%
Final simplification67.0%
(FPCore (x y z t a) :precision binary64 (if (<= x -2.6e-126) x (if (<= x 9e-38) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.6e-126) {
tmp = x;
} else if (x <= 9e-38) {
tmp = 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 (x <= (-2.6d-126)) then
tmp = x
else if (x <= 9d-38) then
tmp = 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 (x <= -2.6e-126) {
tmp = x;
} else if (x <= 9e-38) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -2.6e-126: tmp = x elif x <= 9e-38: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.6e-126) tmp = x; elseif (x <= 9e-38) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -2.6e-126) tmp = x; elseif (x <= 9e-38) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.6e-126], x, If[LessEqual[x, 9e-38], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-126}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-38}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.59999999999999999e-126 or 9.00000000000000018e-38 < x Initial program 99.9%
Taylor expanded in x around inf 71.4%
if -2.59999999999999999e-126 < x < 9.00000000000000018e-38Initial program 96.7%
Taylor expanded in z around inf 46.3%
+-commutative46.3%
Simplified46.3%
Taylor expanded in y around inf 35.4%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 98.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 98.8%
Taylor expanded in x around inf 52.0%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (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 / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024139
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (* y (/ (- z t) (- z a)))))