
(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 (/ (- t z) (/ (- a t) y))))
double code(double x, double y, double z, double t, double a) {
return x - ((t - z) / ((a - t) / y));
}
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 - ((t - z) / ((a - t) / y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((t - z) / ((a - t) / y));
}
def code(x, y, z, t, a): return x - ((t - z) / ((a - t) / y))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(t - z) / Float64(Float64(a - t) / y))) end
function tmp = code(x, y, z, t, a) tmp = x - ((t - z) / ((a - t) / y)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(t - z), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{t - z}{\frac{a - t}{y}}
\end{array}
Initial program 85.7%
*-commutative85.7%
associate-/l*98.2%
Simplified98.2%
Final simplification98.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- z t) y) (- a t))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+298)))
(+ x (- y (* z (/ y t))))
(- x (/ (* y (- t z)) (- a t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) * y) / (a - t);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+298)) {
tmp = x + (y - (z * (y / t)));
} else {
tmp = x - ((y * (t - z)) / (a - t));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) * y) / (a - t);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+298)) {
tmp = x + (y - (z * (y / t)));
} else {
tmp = x - ((y * (t - z)) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((z - t) * y) / (a - t) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 1e+298): tmp = x + (y - (z * (y / t))) else: tmp = x - ((y * (t - z)) / (a - t)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(z - t) * y) / Float64(a - t)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+298)) tmp = Float64(x + Float64(y - Float64(z * Float64(y / t)))); else tmp = Float64(x - Float64(Float64(y * Float64(t - z)) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((z - t) * y) / (a - t); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 1e+298))) tmp = x + (y - (z * (y / t))); else tmp = x - ((y * (t - z)) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+298]], $MachinePrecision]], N[(x + N[(y - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 10^{+298}\right):\\
\;\;\;\;x + \left(y - z \cdot \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot \left(t - z\right)}{a - t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -inf.0 or 9.9999999999999996e297 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) Initial program 29.0%
Taylor expanded in a around 0 24.7%
mul-1-neg24.7%
unsub-neg24.7%
associate-/l*75.7%
Simplified75.7%
Taylor expanded in t around 0 62.1%
+-commutative62.1%
neg-mul-162.1%
unsub-neg62.1%
associate-*l/75.7%
*-commutative75.7%
Simplified75.7%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 9.9999999999999996e297Initial program 99.8%
Final simplification95.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.8e+94)
(+ x y)
(if (<= t -1.65e-90)
(+ x (* y (/ z (- a t))))
(if (<= t -4e-241)
(+ x (/ (- z t) (/ a y)))
(if (<= t 1.12e+33) (+ x (* z (/ y (- a t)))) (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.8e+94) {
tmp = x + y;
} else if (t <= -1.65e-90) {
tmp = x + (y * (z / (a - t)));
} else if (t <= -4e-241) {
tmp = x + ((z - t) / (a / y));
} else if (t <= 1.12e+33) {
tmp = x + (z * (y / (a - t)));
} 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.8d+94)) then
tmp = x + y
else if (t <= (-1.65d-90)) then
tmp = x + (y * (z / (a - t)))
else if (t <= (-4d-241)) then
tmp = x + ((z - t) / (a / y))
else if (t <= 1.12d+33) then
tmp = x + (z * (y / (a - t)))
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.8e+94) {
tmp = x + y;
} else if (t <= -1.65e-90) {
tmp = x + (y * (z / (a - t)));
} else if (t <= -4e-241) {
tmp = x + ((z - t) / (a / y));
} else if (t <= 1.12e+33) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.8e+94: tmp = x + y elif t <= -1.65e-90: tmp = x + (y * (z / (a - t))) elif t <= -4e-241: tmp = x + ((z - t) / (a / y)) elif t <= 1.12e+33: tmp = x + (z * (y / (a - t))) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.8e+94) tmp = Float64(x + y); elseif (t <= -1.65e-90) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); elseif (t <= -4e-241) tmp = Float64(x + Float64(Float64(z - t) / Float64(a / y))); elseif (t <= 1.12e+33) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.8e+94) tmp = x + y; elseif (t <= -1.65e-90) tmp = x + (y * (z / (a - t))); elseif (t <= -4e-241) tmp = x + ((z - t) / (a / y)); elseif (t <= 1.12e+33) tmp = x + (z * (y / (a - t))); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.8e+94], N[(x + y), $MachinePrecision], If[LessEqual[t, -1.65e-90], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4e-241], N[(x + N[(N[(z - t), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.12e+33], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+94}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -1.65 \cdot 10^{-90}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{elif}\;t \leq -4 \cdot 10^{-241}:\\
\;\;\;\;x + \frac{z - t}{\frac{a}{y}}\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{+33}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.79999999999999996e94 or 1.12e33 < t Initial program 66.4%
Taylor expanded in t around inf 84.3%
+-commutative84.3%
Simplified84.3%
if -1.79999999999999996e94 < t < -1.65e-90Initial program 99.8%
+-commutative99.8%
associate-*l/96.6%
fma-def96.6%
Simplified96.6%
fma-udef96.6%
associate-*l/99.8%
associate-/l*99.8%
div-inv99.9%
clear-num99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 77.8%
if -1.65e-90 < t < -3.9999999999999999e-241Initial program 99.9%
*-commutative99.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around inf 96.0%
if -3.9999999999999999e-241 < t < 1.12e33Initial program 93.5%
Taylor expanded in z around inf 90.8%
associate-*l/38.5%
*-commutative38.5%
Simplified96.2%
Final simplification88.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.6e+20) (not (<= z 185.0))) (+ x (* z (/ y (- a t)))) (- x (* y (/ t (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.6e+20) || !(z <= 185.0)) {
tmp = x + (z * (y / (a - t)));
} 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 <= (-2.6d+20)) .or. (.not. (z <= 185.0d0))) then
tmp = x + (z * (y / (a - t)))
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 <= -2.6e+20) || !(z <= 185.0)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x - (y * (t / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.6e+20) or not (z <= 185.0): tmp = x + (z * (y / (a - t))) else: tmp = x - (y * (t / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.6e+20) || !(z <= 185.0)) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); 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 <= -2.6e+20) || ~((z <= 185.0))) tmp = x + (z * (y / (a - t))); else tmp = x - (y * (t / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.6e+20], N[Not[LessEqual[z, 185.0]], $MachinePrecision]], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $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 -2.6 \cdot 10^{+20} \lor \neg \left(z \leq 185\right):\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{a - t}\\
\end{array}
\end{array}
if z < -2.6e20 or 185 < z Initial program 82.4%
Taylor expanded in z around inf 83.4%
associate-*l/46.9%
*-commutative46.9%
Simplified91.9%
if -2.6e20 < z < 185Initial program 88.0%
Taylor expanded in z around 0 79.9%
mul-1-neg79.9%
associate-*l/91.2%
unsub-neg91.2%
*-commutative91.2%
Simplified91.2%
Final simplification91.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.5e+94) (+ x y) (if (<= t 4.2e+31) (+ x (* z (/ y (- a t)))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.5e+94) {
tmp = x + y;
} else if (t <= 4.2e+31) {
tmp = x + (z * (y / (a - t)));
} 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.5d+94)) then
tmp = x + y
else if (t <= 4.2d+31) then
tmp = x + (z * (y / (a - t)))
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.5e+94) {
tmp = x + y;
} else if (t <= 4.2e+31) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.5e+94: tmp = x + y elif t <= 4.2e+31: tmp = x + (z * (y / (a - t))) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.5e+94) tmp = Float64(x + y); elseif (t <= 4.2e+31) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.5e+94) tmp = x + y; elseif (t <= 4.2e+31) tmp = x + (z * (y / (a - t))); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.5e+94], N[(x + y), $MachinePrecision], If[LessEqual[t, 4.2e+31], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{+94}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{+31}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.5e94 or 4.19999999999999958e31 < t Initial program 66.4%
Taylor expanded in t around inf 84.3%
+-commutative84.3%
Simplified84.3%
if -1.5e94 < t < 4.19999999999999958e31Initial program 96.4%
Taylor expanded in z around inf 86.2%
associate-*l/33.7%
*-commutative33.7%
Simplified88.1%
Final simplification86.8%
(FPCore (x y z t a)
:precision binary64
(if (<= t -7.8e-84)
(+ x y)
(if (<= t 3.4e-190)
x
(if (<= t 4e-122) (/ y (/ a z)) (if (<= t 2.6e+23) x (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.8e-84) {
tmp = x + y;
} else if (t <= 3.4e-190) {
tmp = x;
} else if (t <= 4e-122) {
tmp = y / (a / z);
} else if (t <= 2.6e+23) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-7.8d-84)) then
tmp = x + y
else if (t <= 3.4d-190) then
tmp = x
else if (t <= 4d-122) then
tmp = y / (a / z)
else if (t <= 2.6d+23) then
tmp = x
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.8e-84) {
tmp = x + y;
} else if (t <= 3.4e-190) {
tmp = x;
} else if (t <= 4e-122) {
tmp = y / (a / z);
} else if (t <= 2.6e+23) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7.8e-84: tmp = x + y elif t <= 3.4e-190: tmp = x elif t <= 4e-122: tmp = y / (a / z) elif t <= 2.6e+23: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.8e-84) tmp = Float64(x + y); elseif (t <= 3.4e-190) tmp = x; elseif (t <= 4e-122) tmp = Float64(y / Float64(a / z)); elseif (t <= 2.6e+23) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7.8e-84) tmp = x + y; elseif (t <= 3.4e-190) tmp = x; elseif (t <= 4e-122) tmp = y / (a / z); elseif (t <= 2.6e+23) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.8e-84], N[(x + y), $MachinePrecision], If[LessEqual[t, 3.4e-190], x, If[LessEqual[t, 4e-122], N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.6e+23], x, N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{-84}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{-190}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-122}:\\
\;\;\;\;\frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+23}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -7.80000000000000045e-84 or 2.59999999999999992e23 < t Initial program 78.2%
Taylor expanded in t around inf 76.1%
+-commutative76.1%
Simplified76.1%
if -7.80000000000000045e-84 < t < 3.39999999999999981e-190 or 4.00000000000000024e-122 < t < 2.59999999999999992e23Initial program 96.3%
Taylor expanded in x around inf 63.9%
if 3.39999999999999981e-190 < t < 4.00000000000000024e-122Initial program 79.4%
Taylor expanded in x around 0 68.9%
Taylor expanded in t around 0 47.4%
associate-/l*67.4%
Simplified67.4%
Final simplification70.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.5e+129) (not (<= z 2.1e+123))) (* z (/ y (- a t))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.5e+129) || !(z <= 2.1e+123)) {
tmp = z * (y / (a - t));
} 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 <= (-9.5d+129)) .or. (.not. (z <= 2.1d+123))) then
tmp = z * (y / (a - t))
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 <= -9.5e+129) || !(z <= 2.1e+123)) {
tmp = z * (y / (a - t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.5e+129) or not (z <= 2.1e+123): tmp = z * (y / (a - t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.5e+129) || !(z <= 2.1e+123)) tmp = Float64(z * Float64(y / Float64(a - t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -9.5e+129) || ~((z <= 2.1e+123))) tmp = z * (y / (a - t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.5e+129], N[Not[LessEqual[z, 2.1e+123]], $MachinePrecision]], N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+129} \lor \neg \left(z \leq 2.1 \cdot 10^{+123}\right):\\
\;\;\;\;z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -9.5000000000000004e129 or 2.09999999999999994e123 < z Initial program 80.8%
Taylor expanded in x around 0 55.8%
Taylor expanded in z around inf 52.9%
associate-*l/62.7%
*-commutative62.7%
Simplified62.7%
if -9.5000000000000004e129 < z < 2.09999999999999994e123Initial program 87.4%
Taylor expanded in t around inf 72.0%
+-commutative72.0%
Simplified72.0%
Final simplification69.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -8.2e+26) (not (<= t 1.1e+31))) (+ x y) (+ x (/ (* z y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8.2e+26) || !(t <= 1.1e+31)) {
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 <= (-8.2d+26)) .or. (.not. (t <= 1.1d+31))) 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 <= -8.2e+26) || !(t <= 1.1e+31)) {
tmp = x + y;
} else {
tmp = x + ((z * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -8.2e+26) or not (t <= 1.1e+31): tmp = x + y else: tmp = x + ((z * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -8.2e+26) || !(t <= 1.1e+31)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(z * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -8.2e+26) || ~((t <= 1.1e+31))) tmp = x + y; else tmp = x + ((z * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -8.2e+26], N[Not[LessEqual[t, 1.1e+31]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.2 \cdot 10^{+26} \lor \neg \left(t \leq 1.1 \cdot 10^{+31}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot y}{a}\\
\end{array}
\end{array}
if t < -8.19999999999999967e26 or 1.10000000000000005e31 < t Initial program 73.1%
Taylor expanded in t around inf 79.5%
+-commutative79.5%
Simplified79.5%
if -8.19999999999999967e26 < t < 1.10000000000000005e31Initial program 95.9%
Taylor expanded in t around 0 80.3%
Final simplification79.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.2e+25) (+ x y) (if (<= t 9.5e+31) (+ x (* y (/ z a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.2e+25) {
tmp = x + y;
} else if (t <= 9.5e+31) {
tmp = x + (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-4.2d+25)) then
tmp = x + y
else if (t <= 9.5d+31) then
tmp = x + (y * (z / a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.2e+25) {
tmp = x + y;
} else if (t <= 9.5e+31) {
tmp = x + (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.2e+25: tmp = x + y elif t <= 9.5e+31: tmp = x + (y * (z / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.2e+25) tmp = Float64(x + y); elseif (t <= 9.5e+31) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.2e+25) tmp = x + y; elseif (t <= 9.5e+31) tmp = x + (y * (z / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.2e+25], N[(x + y), $MachinePrecision], If[LessEqual[t, 9.5e+31], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+25}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+31}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -4.1999999999999998e25 or 9.5000000000000008e31 < t Initial program 73.1%
Taylor expanded in t around inf 79.5%
+-commutative79.5%
Simplified79.5%
if -4.1999999999999998e25 < t < 9.5000000000000008e31Initial program 95.9%
+-commutative95.9%
associate-*l/98.2%
fma-def98.2%
Simplified98.2%
fma-udef98.2%
associate-*l/95.9%
associate-/l*95.8%
div-inv95.2%
clear-num95.2%
Applied egg-rr95.2%
Taylor expanded in t around 0 80.3%
associate-*r/81.4%
Simplified81.4%
Final simplification80.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.1e+27) (+ x y) (if (<= t 1.9e+30) (+ x (/ y (/ a z))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.1e+27) {
tmp = x + y;
} else if (t <= 1.9e+30) {
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 (t <= (-1.1d+27)) then
tmp = x + y
else if (t <= 1.9d+30) 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 (t <= -1.1e+27) {
tmp = x + y;
} else if (t <= 1.9e+30) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.1e+27: tmp = x + y elif t <= 1.9e+30: tmp = x + (y / (a / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.1e+27) tmp = Float64(x + y); elseif (t <= 1.9e+30) 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 (t <= -1.1e+27) tmp = x + y; elseif (t <= 1.9e+30) tmp = x + (y / (a / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.1e+27], N[(x + y), $MachinePrecision], If[LessEqual[t, 1.9e+30], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{+27}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{+30}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.0999999999999999e27 or 1.9000000000000001e30 < t Initial program 73.1%
Taylor expanded in t around inf 79.5%
+-commutative79.5%
Simplified79.5%
if -1.0999999999999999e27 < t < 1.9000000000000001e30Initial program 95.9%
Taylor expanded in t around 0 80.3%
+-commutative80.3%
associate-/l*81.9%
Simplified81.9%
Final simplification80.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -7.8e-84) (+ x y) (if (<= t 1.9e+23) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.8e-84) {
tmp = x + y;
} else if (t <= 1.9e+23) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-7.8d-84)) then
tmp = x + y
else if (t <= 1.9d+23) then
tmp = x
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.8e-84) {
tmp = x + y;
} else if (t <= 1.9e+23) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7.8e-84: tmp = x + y elif t <= 1.9e+23: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.8e-84) tmp = Float64(x + y); elseif (t <= 1.9e+23) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7.8e-84) tmp = x + y; elseif (t <= 1.9e+23) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.8e-84], N[(x + y), $MachinePrecision], If[LessEqual[t, 1.9e+23], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{-84}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{+23}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -7.80000000000000045e-84 or 1.89999999999999987e23 < t Initial program 78.2%
Taylor expanded in t around inf 76.1%
+-commutative76.1%
Simplified76.1%
if -7.80000000000000045e-84 < t < 1.89999999999999987e23Initial program 94.9%
Taylor expanded in x around inf 60.0%
Final simplification68.8%
(FPCore (x y z t a) :precision binary64 (if (<= x -6.5e-251) x (if (<= x 1.2e-287) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -6.5e-251) {
tmp = x;
} else if (x <= 1.2e-287) {
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 <= (-6.5d-251)) then
tmp = x
else if (x <= 1.2d-287) 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 <= -6.5e-251) {
tmp = x;
} else if (x <= 1.2e-287) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -6.5e-251: tmp = x elif x <= 1.2e-287: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -6.5e-251) tmp = x; elseif (x <= 1.2e-287) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -6.5e-251) tmp = x; elseif (x <= 1.2e-287) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -6.5e-251], x, If[LessEqual[x, 1.2e-287], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{-251}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-287}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -6.5000000000000002e-251 or 1.2e-287 < x Initial program 87.1%
Taylor expanded in x around inf 62.8%
if -6.5000000000000002e-251 < x < 1.2e-287Initial program 73.3%
Taylor expanded in a around 0 53.8%
mul-1-neg53.8%
unsub-neg53.8%
associate-/l*69.4%
Simplified69.4%
Taylor expanded in y around inf 69.4%
Taylor expanded in z around 0 54.1%
Final simplification61.9%
(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 85.7%
Taylor expanded in x around inf 57.8%
Final simplification57.8%
(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 2023279
(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))))