
(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 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
Initial program 84.7%
associate-/l*98.2%
Simplified98.2%
Final simplification98.2%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1e-7)
(+ x (/ y (/ (- t a) t)))
(if (<= t 1.7e+123)
(+ x (* z (/ 1.0 (/ (- a t) y))))
(- x (* y (/ t (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1e-7) {
tmp = x + (y / ((t - a) / t));
} else if (t <= 1.7e+123) {
tmp = x + (z * (1.0 / ((a - t) / y)));
} 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 (t <= (-1d-7)) then
tmp = x + (y / ((t - a) / t))
else if (t <= 1.7d+123) then
tmp = x + (z * (1.0d0 / ((a - t) / y)))
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 (t <= -1e-7) {
tmp = x + (y / ((t - a) / t));
} else if (t <= 1.7e+123) {
tmp = x + (z * (1.0 / ((a - t) / y)));
} else {
tmp = x - (y * (t / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1e-7: tmp = x + (y / ((t - a) / t)) elif t <= 1.7e+123: tmp = x + (z * (1.0 / ((a - t) / y))) else: tmp = x - (y * (t / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1e-7) tmp = Float64(x + Float64(y / Float64(Float64(t - a) / t))); elseif (t <= 1.7e+123) tmp = Float64(x + Float64(z * Float64(1.0 / Float64(Float64(a - t) / y)))); 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 (t <= -1e-7) tmp = x + (y / ((t - a) / t)); elseif (t <= 1.7e+123) tmp = x + (z * (1.0 / ((a - t) / y))); else tmp = x - (y * (t / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1e-7], N[(x + N[(y / N[(N[(t - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.7e+123], N[(x + N[(z * N[(1.0 / N[(N[(a - t), $MachinePrecision] / y), $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}\;t \leq -1 \cdot 10^{-7}:\\
\;\;\;\;x + \frac{y}{\frac{t - a}{t}}\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+123}:\\
\;\;\;\;x + z \cdot \frac{1}{\frac{a - t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{a - t}\\
\end{array}
\end{array}
if t < -9.9999999999999995e-8Initial program 68.7%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 91.2%
associate-*r/91.2%
neg-mul-191.2%
Simplified91.2%
if -9.9999999999999995e-8 < t < 1.70000000000000001e123Initial program 96.9%
associate-*l/98.7%
Simplified98.7%
Taylor expanded in z around inf 92.7%
associate-*l/94.5%
*-commutative94.5%
Simplified94.5%
clear-num94.5%
inv-pow94.5%
Applied egg-rr94.5%
unpow-194.5%
Simplified94.5%
if 1.70000000000000001e123 < t Initial program 61.1%
+-commutative61.1%
associate-*r/100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
Applied egg-rr100.0%
Taylor expanded in z around 0 97.1%
neg-mul-197.1%
distribute-neg-frac97.1%
Simplified97.1%
Final simplification94.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.02e-7) (not (<= t 1.65e+129))) (- x (/ y (/ t (- z t)))) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.02e-7) || !(t <= 1.65e+129)) {
tmp = x - (y / (t / (z - t)));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.02d-7)) .or. (.not. (t <= 1.65d+129))) then
tmp = x - (y / (t / (z - t)))
else
tmp = x + (z * (y / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.02e-7) || !(t <= 1.65e+129)) {
tmp = x - (y / (t / (z - t)));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.02e-7) or not (t <= 1.65e+129): tmp = x - (y / (t / (z - t))) else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.02e-7) || !(t <= 1.65e+129)) tmp = Float64(x - Float64(y / Float64(t / Float64(z - t)))); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.02e-7) || ~((t <= 1.65e+129))) tmp = x - (y / (t / (z - t))); else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.02e-7], N[Not[LessEqual[t, 1.65e+129]], $MachinePrecision]], N[(x - N[(y / N[(t / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.02 \cdot 10^{-7} \lor \neg \left(t \leq 1.65 \cdot 10^{+129}\right):\\
\;\;\;\;x - \frac{y}{\frac{t}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -1.02e-7 or 1.64999999999999995e129 < t Initial program 66.7%
associate-*l/93.1%
Simplified93.1%
Taylor expanded in a around 0 60.9%
+-commutative60.9%
mul-1-neg60.9%
unsub-neg60.9%
*-commutative60.9%
associate-/l*85.1%
Simplified85.1%
if -1.02e-7 < t < 1.64999999999999995e129Initial program 96.3%
associate-*l/98.7%
Simplified98.7%
Taylor expanded in z around inf 92.7%
associate-*l/94.5%
*-commutative94.5%
Simplified94.5%
Final simplification90.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.3e-9) (not (<= t 1.35e+121))) (+ x (/ y (/ (- t a) t))) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.3e-9) || !(t <= 1.35e+121)) {
tmp = x + (y / ((t - a) / t));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-5.3d-9)) .or. (.not. (t <= 1.35d+121))) then
tmp = x + (y / ((t - a) / t))
else
tmp = x + (z * (y / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.3e-9) || !(t <= 1.35e+121)) {
tmp = x + (y / ((t - a) / t));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.3e-9) or not (t <= 1.35e+121): tmp = x + (y / ((t - a) / t)) else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.3e-9) || !(t <= 1.35e+121)) tmp = Float64(x + Float64(y / Float64(Float64(t - a) / t))); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5.3e-9) || ~((t <= 1.35e+121))) tmp = x + (y / ((t - a) / t)); else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.3e-9], N[Not[LessEqual[t, 1.35e+121]], $MachinePrecision]], N[(x + N[(y / N[(N[(t - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.3 \cdot 10^{-9} \lor \neg \left(t \leq 1.35 \cdot 10^{+121}\right):\\
\;\;\;\;x + \frac{y}{\frac{t - a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -5.30000000000000031e-9 or 1.3500000000000001e121 < t Initial program 66.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 93.2%
associate-*r/93.2%
neg-mul-193.2%
Simplified93.2%
if -5.30000000000000031e-9 < t < 1.3500000000000001e121Initial program 96.9%
associate-*l/98.7%
Simplified98.7%
Taylor expanded in z around inf 92.7%
associate-*l/94.5%
*-commutative94.5%
Simplified94.5%
Final simplification94.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.05e-7) (+ x y) (if (<= t 1e+131) (+ x (* z (/ y (- a t)))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.05e-7) {
tmp = x + y;
} else if (t <= 1e+131) {
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.05d-7)) then
tmp = x + y
else if (t <= 1d+131) 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.05e-7) {
tmp = x + y;
} else if (t <= 1e+131) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.05e-7: tmp = x + y elif t <= 1e+131: 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.05e-7) tmp = Float64(x + y); elseif (t <= 1e+131) 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.05e-7) tmp = x + y; elseif (t <= 1e+131) 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.05e-7], N[(x + y), $MachinePrecision], If[LessEqual[t, 1e+131], 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.05 \cdot 10^{-7}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 10^{+131}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.05e-7 or 9.9999999999999991e130 < t Initial program 66.7%
associate-*l/93.1%
Simplified93.1%
Taylor expanded in t around inf 82.1%
if -1.05e-7 < t < 9.9999999999999991e130Initial program 96.3%
associate-*l/98.7%
Simplified98.7%
Taylor expanded in z around inf 92.7%
associate-*l/94.5%
*-commutative94.5%
Simplified94.5%
Final simplification89.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.8e-8) (+ x (/ y (/ (- t a) t))) (if (<= t 2.3e+121) (+ 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 (t <= -3.8e-8) {
tmp = x + (y / ((t - a) / t));
} else if (t <= 2.3e+121) {
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 (t <= (-3.8d-8)) then
tmp = x + (y / ((t - a) / t))
else if (t <= 2.3d+121) 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 (t <= -3.8e-8) {
tmp = x + (y / ((t - a) / t));
} else if (t <= 2.3e+121) {
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 t <= -3.8e-8: tmp = x + (y / ((t - a) / t)) elif t <= 2.3e+121: 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 (t <= -3.8e-8) tmp = Float64(x + Float64(y / Float64(Float64(t - a) / t))); elseif (t <= 2.3e+121) 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 (t <= -3.8e-8) tmp = x + (y / ((t - a) / t)); elseif (t <= 2.3e+121) 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[LessEqual[t, -3.8e-8], N[(x + N[(y / N[(N[(t - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.3e+121], 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}\;t \leq -3.8 \cdot 10^{-8}:\\
\;\;\;\;x + \frac{y}{\frac{t - a}{t}}\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{+121}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{a - t}\\
\end{array}
\end{array}
if t < -3.80000000000000028e-8Initial program 68.7%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 91.2%
associate-*r/91.2%
neg-mul-191.2%
Simplified91.2%
if -3.80000000000000028e-8 < t < 2.2999999999999999e121Initial program 96.9%
associate-*l/98.7%
Simplified98.7%
Taylor expanded in z around inf 92.7%
associate-*l/94.5%
*-commutative94.5%
Simplified94.5%
if 2.2999999999999999e121 < t Initial program 61.1%
+-commutative61.1%
associate-*r/100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
Applied egg-rr100.0%
Taylor expanded in z around 0 97.1%
neg-mul-197.1%
distribute-neg-frac97.1%
Simplified97.1%
Final simplification94.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -5.2e+168) (not (<= y 1.95e+185))) (* y (- 1.0 (/ z t))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -5.2e+168) || !(y <= 1.95e+185)) {
tmp = y * (1.0 - (z / 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 ((y <= (-5.2d+168)) .or. (.not. (y <= 1.95d+185))) then
tmp = y * (1.0d0 - (z / 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 ((y <= -5.2e+168) || !(y <= 1.95e+185)) {
tmp = y * (1.0 - (z / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -5.2e+168) or not (y <= 1.95e+185): tmp = y * (1.0 - (z / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -5.2e+168) || !(y <= 1.95e+185)) tmp = Float64(y * Float64(1.0 - Float64(z / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -5.2e+168) || ~((y <= 1.95e+185))) tmp = y * (1.0 - (z / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -5.2e+168], N[Not[LessEqual[y, 1.95e+185]], $MachinePrecision]], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{+168} \lor \neg \left(y \leq 1.95 \cdot 10^{+185}\right):\\
\;\;\;\;y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -5.2e168 or 1.9499999999999999e185 < y Initial program 55.7%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in a around 0 36.8%
+-commutative36.8%
mul-1-neg36.8%
unsub-neg36.8%
*-commutative36.8%
associate-/l*60.2%
Simplified60.2%
Taylor expanded in y around inf 56.0%
if -5.2e168 < y < 1.9499999999999999e185Initial program 92.3%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in t around inf 68.8%
Final simplification66.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.45e-24) (+ x y) (if (<= t 6.6e+129) (+ x (/ y (/ a z))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.45e-24) {
tmp = x + y;
} else if (t <= 6.6e+129) {
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.45d-24)) then
tmp = x + y
else if (t <= 6.6d+129) 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.45e-24) {
tmp = x + y;
} else if (t <= 6.6e+129) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.45e-24: tmp = x + y elif t <= 6.6e+129: tmp = x + (y / (a / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.45e-24) tmp = Float64(x + y); elseif (t <= 6.6e+129) 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.45e-24) tmp = x + y; elseif (t <= 6.6e+129) tmp = x + (y / (a / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.45e-24], N[(x + y), $MachinePrecision], If[LessEqual[t, 6.6e+129], 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.45 \cdot 10^{-24}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{+129}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.4499999999999999e-24 or 6.5999999999999998e129 < t Initial program 67.7%
associate-*l/93.3%
Simplified93.3%
Taylor expanded in t around inf 80.7%
if -1.4499999999999999e-24 < t < 6.5999999999999998e129Initial program 96.2%
associate-*l/98.7%
Simplified98.7%
Taylor expanded in t around 0 80.6%
associate-/l*80.9%
Simplified80.9%
Final simplification80.8%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (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 + ((z - t) * (y / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (a - t)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{a - t}
\end{array}
Initial program 84.7%
associate-*l/96.5%
Simplified96.5%
Final simplification96.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.15e-14) (+ x y) (if (<= t 2.35e+129) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.15e-14) {
tmp = x + y;
} else if (t <= 2.35e+129) {
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 <= (-1.15d-14)) then
tmp = x + y
else if (t <= 2.35d+129) 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 <= -1.15e-14) {
tmp = x + y;
} else if (t <= 2.35e+129) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.15e-14: tmp = x + y elif t <= 2.35e+129: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.15e-14) tmp = Float64(x + y); elseif (t <= 2.35e+129) 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 <= -1.15e-14) tmp = x + y; elseif (t <= 2.35e+129) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.15e-14], N[(x + y), $MachinePrecision], If[LessEqual[t, 2.35e+129], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{-14}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 2.35 \cdot 10^{+129}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.14999999999999999e-14 or 2.35000000000000004e129 < t Initial program 67.1%
associate-*l/93.2%
Simplified93.2%
Taylor expanded in t around inf 81.3%
if -1.14999999999999999e-14 < t < 2.35000000000000004e129Initial program 96.3%
associate-*l/98.7%
Simplified98.7%
Taylor expanded in x around inf 54.0%
Final simplification64.8%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.4e+89) y (if (<= y 2.3e+53) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.4e+89) {
tmp = y;
} else if (y <= 2.3e+53) {
tmp = x;
} else {
tmp = 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 (y <= (-1.4d+89)) then
tmp = y
else if (y <= 2.3d+53) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.4e+89) {
tmp = y;
} else if (y <= 2.3e+53) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.4e+89: tmp = y elif y <= 2.3e+53: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.4e+89) tmp = y; elseif (y <= 2.3e+53) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.4e+89) tmp = y; elseif (y <= 2.3e+53) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.4e+89], y, If[LessEqual[y, 2.3e+53], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{+89}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+53}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -1.3999999999999999e89 or 2.3000000000000002e53 < y Initial program 62.1%
associate-*l/97.8%
Simplified97.8%
Taylor expanded in a around 0 38.5%
+-commutative38.5%
mul-1-neg38.5%
unsub-neg38.5%
*-commutative38.5%
associate-/l*62.8%
Simplified62.8%
Taylor expanded in y around inf 55.2%
Taylor expanded in z around 0 32.0%
if -1.3999999999999999e89 < y < 2.3000000000000002e53Initial program 98.1%
associate-*l/95.8%
Simplified95.8%
Taylor expanded in x around inf 71.0%
Final simplification56.5%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 84.7%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in x around inf 51.0%
Final simplification51.0%
(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 2023171
(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))))